Check These Out
Place in .bashrc and invoke like this: "mecp /path/to/file", and it will copy the specified file(s) back to the desktop of the host you're ssh'ing in from. To easily upload a file from the host you're ssh'ing in from use this:
ucp (){ scp ${SSH_CLIENT%% *}:Desktop/upload/* .; }
This version works on Mac (avoids grep -P, adding a sed step instead, and invokes /usr/bin/perl with full path in case you have another one installed).
Still requires that you install perl module HTML::Entities ? here's how: http://www.perlmonks.org/?node_id=640489
ss is a tool that will help you to get all kinds of useful information about the current sockets on a localhost. You can also get the uid of the daemons process using the flag:
$ ss -le
Description is moved to "Sample output" because the html sanitizer for commandlinefu breaks the examples..
curl ifconfig.me/ip -> IP Adress
curl ifconfig.me/host -> Remote Host
curl ifconfig.me/ua ->User Agent
curl ifconfig.me/port -> Port
thonks to http://ifconfig.me/
This command will tell you the 20 biggest directories starting from your working directory and skips directories on other filesystems. Useful for resolving disk space issues.
Uses GNU Parallel.
The (in)famous "FizzBuzz" programming challenge, answered in a single line of Bash code. The "|column" part at the end merely formats the output a bit, so if "column" is not installed on your machine you can simply omit that part. Without "|column", the solution only uses 75 characters.
The version below is expanded to multiple lines, with comments added.
for i in {1..100} # Use i to loop from "1" to "100", inclusive.
do ((i % 3)) && # If i is not divisible by 3...
x= || # ...blank out x (yes, "x= " does that). Otherwise,...
x=Fizz # ...set x to the string "Fizz".
((i % 5)) || # If i is not divisible by 5, skip (there's no "&&")...
x+=Buzz # ...Otherwise, append (not set) the string "Buzz" to x.
echo ${x:-$i} # Print x unless it is blanked out. Otherwise, print i.
done | column # Wrap output into columns (not part of the test).