HistSync automatically uploads every command you type,
and lets you bookmark and share the most important commands.
Dump 1 frame using mplayer(i.e. take a screenshot)
$ mplayer -vo jpeg -frames 1 -ss 40 <file>
Squash commits
$ git reset --soft HEAD~<number of commits to squash> && git commit
Find the largest top 5 files and directories from cwd
$ sudo du -hsx * | sort -rh | head -5
Count the number of times each line occurs in a file
$ cat <something> | awk '{a[$0]++} END{for (i in a) print i, a[i]}'
Restore datababase from dump file
$ pg_restore -d mydb dumpfile
$ echo This is awesome!
(On OS X) count how many characters are in the clipboard
$ pbpaste | wc -c
select all interval more than 3 days when there is no date
$ cat huh.dmp | xargs -n 1 -I {} date --date={} +%s | awk '{if (prev != 0) if ($1 - prev > 3 * 24 * 60 * 60) {print "@" prev "\n" "@" $1}; prev = $1}' | xargs -n 1 -I {} date --date={} +%d.%m.%y | awk 'ORS=NR%2 ? "\t" : "\n"'
All user processes launched from tty
$ ps x
$ git add -A
count length of string
$ echo -n string | wc -m
run docker container
$ docker run -it --rm image command
built docker image
$ docker build -t image_name directory
$ vim /etc/yum.repos.d/epel.repo
$ yum install man