Commands by hypnojazz (5)

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Speak the top 6 lines of your twitter timeline every 5 minutes.....
Pump up the chatter, run this script on a regular basis to listen to your twitter timeline. This is a rough first cut using several cli clips I have spotted around. There is no facility to not read those things already read to you. This could also easily be put in a loop for timed onslaught from the chatterverse, though I think it might violate several pointsof the Geneva Convention UPDATE - added a loop, only reads the first 6 twits, and does this every 5 mins.

Converts to PDF all the files in the directory
Requieres unoconv (debian package)

shortcut to scp a file to the same location on a remote machine
This will copy a file from your current directory to the same location on another machine. Handy for configuring ha, copying your resolv.conf, .bashrc, anything in /usr/local, etc.

Generate random number with shuf
If you don't have seq or shuf, bash can be used.

Inverted cowsay
It's quite fun to invert text using "" (ref: ). Slightly more challenging is to flip a whole "cowsay". :-)

docker kill all containers

direct a single stream of input (ls) to multiple readers (grep & wc) without using temporary files

Encrypt and password-protect execution of any bash script, Version 2
(Please see sample output for usage) Use any script name (the read command gets it) and it will be encrypted with the extension .crypt, i.e.: myscript --> myscript.crypt You can execute myscript.crypt only if you know the password. If you die, your script dies with you. If you modify the startup line, be careful with the offset calculation of the crypted block (the XX string). Not difficult to make script editable (an offset-dd piped to a gpg -d piped to a vim - piped to a gpg -c directed to ), but not enough space to do it on a one liner. Sorry for the chmod on parentheses, I dont like "-" at the end. Thanks flatcap for the subshell abbreviation to /dev/null

Make the "tree" command pretty and useful by default
I got really tired of having tree always show me tons of .svn and .git stuff that I don't care about. With this alias, "tree" uses pretty colors, snazzy line graphics, and ignores any source control and package mumbojumbo. (Customize the *.*.package glob, of course.)

Pick a random line from a file

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: