commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
What this does is, if I type ?ssh ? then hit the page-up key, it will complete the line to the last time in my history file that I typed ssh. Hitting page up again will go to the 2nd to last time I typed it. Incredibly handy if you ever type the same commands more than once.
echo "\"\e[6~\": history-search-forward" >> ~/.inputrc
I often forget to type sudo before a command that needs it. This is the quickest way to rerun the command prefixed by sudo.