Check These Out
This command can be used to revert a particular changeset in the local copy.
I find this useful because I frequently import files into the wrong directory. After the import it says "Committed revision 123" or similar. to revert this change in the working copy do:
svn merge -c -123 .
(don't forget the .) and then commit.
When trying to play a sound you may sometimes get an error saying that your sound card is already used, but not by what process. This will list all processes playing sound, useful to kill processes that you no longer need but that keep using your sound card.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Convert some SVG files into PNG using ImageMagick's convert command.
Run the conversions in parallel to save time.
This is safer than robinro's forkbomb approach :-)
xargs runs four processes at a time -P4
Using this command you can track a moment when usb device was attached.
Batch rename extension of all files in a folder, in the example from .txt to .md
mmv most likely must be installed, but is very powerfull when you want to move/copy/append/link multiple files by wildcard patterns.
Shows a tree view of parent to child processes in the output of ps (linux). Similar output can be achieved with pstree (also linux) or ptree (Solaris).
This bash function uses albumart.org to find the cover for an album. It returns an amazon.com url to the image.
Usage: albumart [artist] [album]
These arguments can be reversed and if the album name is distinct enough, it may be possible to omit the artist.
The command can be extended with wget to automatically download the matching image like this:
$ albumart(){ local x y="$@";x=$(awk '/View larger image/{gsub(/^.*largeImagePopup\(.|., .*$/,"");print;exit}'
The above output is for a custom compiled version of Vim on Arch Linux.
Just a quick shell one liner, and presents a list of all the enabled and disabled (those prefixed with a '-') features.