Check These Out
This is useful if you use a shell with a lot of other users. You will be able to run "topu" to see your running processes instead of the complete 'top -u username'.
Read more on alias: http://man.cx/alias
This function takes a word or a phrase as arguments and then fetches definitions using Google's "define" syntax. The "nl" and perl portion isn't strictly necessary. It just makes the output a bit more readable, but this also works:
$define(){ local y="$@";curl -sA"Opera" "http://www.google.com/search?q=define:${y// /+}"|grep -Po '(?/dev/null;}
Delete all your branches except master (useful after archiving branches)
Displays last month, current month, and next month side by side.
This will keep trying to reconnect your netcat connection
can be used with SSH or Telnet, just substitute nc for ssh or telnet
very useful for troubleshooting VPNs were you want to send continuous packets towards a destination to trace.
Oneliner to run commands on multiple servers over ssh.
- First parameter "$1" is the command you want to execute remotely.
( It can be multiple commands e.g. "hostname;uptime")
- Second parameter "${@:2}" represents the remote host/s you want to run the command/s on.
This will affect all invocations of grep, even when it is called from inside a script.
It's very common to have cron jobs that send emails as their output, but the From: address is whatever account the cron job is running under, which is often not the address you want replies to go to. Here's a way to change the From: address right on the command line.
What's happening here is that the "--" separates the options to the mail client from options for the sendmail backend. So the -f and -F get passed through to sendmail and interpreted there. This works on even on a system where postfix is the active mailer - looks like postfix supports the same options.
I think it's possible to customize the From: address using mutt as a command line mailer also, but most servers don't have mutt preinstalled.