====== COMMANDLINEFU ====== ===== Cycle through a 256 colour palette ===== $ yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done Just for fun. Link: https://www.commandlinefu.com/commands/view/72/cycle-through-a-256-colour-palette ===== Generates a TV noise alike output in the terminal ===== $ while true;do printf "$(awk -v c="$(tput cols)" -v s="$RANDOM" 'BEGIN{srand(s);while(--c>=0){printf("\xe2\x96\\%s",sprintf("%o",150+int(10*rand())));}}')";done Generates a TV noise alike output in the terminal. Link: https://www.commandlinefu.com/commands/view/24930/generates-a-tv-noise-alike-output-in-the-terminal ===== List packages manually installed with process currently running ===== $ ps -eo cmd | awk '{print $1}'| sort -u | grep "^/" | xargs dpkg -S 2>/dev/null | awk -F: '{print $1}' | sort -u | xargs apt-mark showmanual Sometimes we install programs, we forget about them, and they stay there wasting RAM. This one-liner try to find them. Link: https://www.commandlinefu.com/commands/view/24903/list-packages-manually-installed-with-process-currently-running ===== Calculate pi to an arbitrary number of decimal places ===== $ bc -l <<< "scale=1000; 4*a(1)" Link: https://www.commandlinefu.com/commands/view/24900/calculate-pi-to-an-arbitrary-number-of-decimal-places ===== Host cpu performance ===== $ openssl speed md5 Measure the cpu performance: In-case if the cpu is thermal throttling then you can find it using this command. Check the first line of the output. Example: Doing md5 for 3s on 16 size blocks: 11406892 md5's in 2.98s ? #(When cpu is not throttling) Doing md5 for 3s on 16 size blocks: 110692 md5's in 2.98s ?? #(When cpu is thermal throttling) Practical use case: Once we had cooling outage in data center which caused thermal throttling in some of the worker nodes. We used this tool to prove that some servers are not performing well because of the cpu thermal throttling. Link: https://www.commandlinefu.com/commands/view/24725/host-cpu-performance ===== Display which distro is installed ===== $ cat /etc/issue Link: https://www.commandlinefu.com/commands/view/42/display-which-distro-is-installed ===== Rip audio from a video file. ===== $ mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile eplace and accordingly. Link: https://www.commandlinefu.com/commands/view/52/rip-audio-from-a-video-file. ===== Make bash look like DOS ===== $ export PS1='C:${PWD//\//\\\}>' Link: https://www.commandlinefu.com/commands/view/149/make-bash-look-like-dos ===== Create a DOS floppy image ===== $ dd if=/dev/zero bs=1024 count=1440 > floppy.img && mkdosfs floppy.img mount with: mount -t msdos -o loop ./floppy.img /tmp/mnt Link: https://www.commandlinefu.com/commands/view/181/create-a-dos-floppy-image ===== Convert a date to timestamp ===== $ date --utc --date "2009-02-06 09:57:54" +%s Simple way to get a timestamp from a date. Link: https://www.commandlinefu.com/commands/view/248/convert-a-date-to-timestamp ===== Equivalent of alias in cmd.exe: doskey (macros) ===== $ doskey l=dir /OD $* doskey is the Windows cmd.exe equivalent of the Unix alias. '$*' means 'all parameters' This example is like alias l='ls -alrt': it will display files from oldest to newest, for one or more directories. doskey /MACROS list macros defined for cmd.exe, like 'alias' list aliases defined for the current Unix shell. Link: https://www.commandlinefu.com/commands/view/692/equivalent-of-alias-in-cmd.exe-doskey-macros ===== Another Curl your IP command ===== $ curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z<>/ :]//g' Just another curl command to get your public facing IP. Link: https://www.commandlinefu.com/commands/view/746/another-curl-your-ip-command ===== List of commands you use most often ===== $ history | awk '{print $2}' | sort | uniq -c | sort -rn | head Link: https://www.commandlinefu.com/commands/view/869/list-of-commands-you-use-most-often ===== Count down from 10 ===== $ for (( i = 10; i > 0; i-- )); do echo "$i"; sleep 1; done Countdown from 10 or whatever you want. Link: https://www.commandlinefu.com/commands/view/974/count-down-from-10 ===== Get your public IP address using Amazon ===== $ curl checkip.amazonaws.com Link: https://www.commandlinefu.com/commands/view/24670/get-your-public-ip-address-using-amazon ===== Console clock ===== $ while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done & You will see it on the corner of your running terminal. Link: https://www.commandlinefu.com/commands/view/24714/console-clock