Commands using dump (12)

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

Compare copies of a file with md5

See all the commits for which searchstring appear in the git diff

Easily find latex package documentation
If the pdf/dvi/etc documentation for a latex package is already part of your local texmf tree, then texdoc will find and display it for you. If the documentation is not available on your system, it will bring up the package's webpage at CTAN to help you investigate.

Generate RSA private key and self-signed certificate
This will create, in the current directory, a file called 'pk.pem' containing an unencrypted 2048-bit RSA private key and a file called 'cert.pem' containing a certificate signed by 'pk.pem'. The private key file will have mode 600. !!ATTENTION!! ==> this command will overwrite both files if present.

Remote screenshot
Admittedly, I'd never have thought of this without the earlier examples, but here's one that you can execute from your workstation to just display the image from another, without separately doing a file transfer, etc. By the way, I hear a loud beep coming from the other room, so I guess it's not too stealthy :-D

Check a nfs mountpoint and force a remount if it does not reply after a given timeout.
Based on the execute with timeout command in this site. A more complex script: #!/bin/sh # This script will check the avaliability of a list of NFS mount point, # forcing a remount of those that do not respond in 5 seconds. # # It basically does this: # NFSPATH=/mountpoint TIMEOUT=5; perl -e "alarm $TIMEOUT; exec @ARGV" "test -d $NFSPATH" || (umount -fl $NFSPATH; mount $NFSPATH) # TIMEOUT=5 SCRIPT_NAME=$(basename $0) for i in $@; do echo "Checking $i..." if ! perl -e "alarm $TIMEOUT; exec @ARGV" "test -d $i" > /dev/null 2>&1; then echo "$SCRIPT_NAME: $i is failing with retcode $?."1>&2 echo "$SCRIPT_NAME: Submmiting umount -fl $i" 1>&2 umount -fl $i; echo "$SCRIPT_NAME: Submmiting mount $i" 1>&2 mount $i; fi done

Set up alarm with fade-in, for graceful awakening
There are a lot of commands, which invokes your player at specified time. But I prefer not to jump from by bed, when alarm start to play. Instead, this script increases volume of mpd over time, which much more pleasant when you just woke up :)

Update IP filter for qBittorrent
Downloads Bluetack's level 1 IP blocklist in .p2p format, suitable for various Bittorrent clients.

Check if you partition are aligned
To get most of you HDD/SSD driver you need to make sure you partition are aligned, if not the speed penalty can be up to 50% slower! this simple one liner will check to see if each partition start sector is divided by 512 you need to change sda with your driver if you find the one of your partitions is not aligned use gparted to move the start sector of the partition to be divided of 512

Find files that are older than x days
Find files that are older than x days in the working directory and list them. This will recurse all the sub-directories inside the working directory. By changing the value for -mtime, you can adjust the time and by replacing the ls command with, say, rm, you can remove those files if you wish to.

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: