11
score
|
Show 10 Largest Open Files$ lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | sort -n -u | tail |
8
score
|
List status of all GIT repos$ find ~ -name ".git" 2> /dev/null | sed 's/\/.git/\//g' | awk '{print "-------------------------\n\033[1;32mGit Repo:\033[0m " $1; system("git --git-dir="$1".git --work-tree="$1" status")}' |
8
score
|
Generate a sequence of numbers$ echo {01..10} |
7
score
|
Displays the quantity of connections to port 80 on a per IP basis$ clear;while x=0; do clear;date;echo "";echo " [Count] | [IP ADDR]";echo "-------------------";netstat -np|grep :80|grep -v LISTEN|awk '{print $5}'|cut -d: -f1|uniq -c; sleep 5;done |
6
score
|
Convert directory of videos to MP4 in parallel$ for INPUT in *.avi ; do echo "${INPUT%.avi}" ; done | xargs -i -P9 HandBrakeCLI -i "{}".avi -o "{}".mp4 |
5
score
|
Nmap scan every interface that is assigned an IP$ ifconfig -a | grep -Po '\b(?!255)(?:\d{1,3}\.){3}(?!255)\d{1,3}\b' | xargs nmap -A -p0- |
5
score
|
Corporate random bullshit generator (cbsg)$ curl -s http://cbsg.sourceforge.net/cgi-bin/live | grep -Eo '^<li>.*</li>' | sed s,\</\\?li\>,,g | shuf -n 1 |
5
score
|
Rename all items in a directory to lower case$ for i in *; do mv "$i" "${i,,}"; done |
5
score
|
Show dd status every so often$ watch --interval 5 killall -USR1 dd |
4
score
|
Find all log files modified 24 hours ago, and zip them$ find . -type f -mtime +1 -name "*.log" -exec zip -m {}.zip {} \; >/dev/null |
4
score
|
List IP addresses connected to your server on port 80$ netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head |
4
score
|
Ternary conditional clause$ [ test_statement ] && ( then_statement ) || ( else_statement ); |
4
score
|
Open another terminal at current location$ $TERMINAL & disown |
4
score
|
Ban all IPs that attempted to access phpmyadmin on your site$ grep "phpmyadmin" $path_to_access.log | grep -Po "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" | sort | uniq | xargs -I% sudo iptables -A INPUT -s % -j DROP |
4
score
|
Run a command and copy its output to clipboard (Mac OSX)$ echo "Here comes the output of my failing code" | tee >(pbcopy) |
4
score
|
Change the encoding of all files in a directory and subdirectories$ find . -type f -name '*.java' -exec sh -c 'iconv -f cp1252 -t utf-8 "$1" > converted && mv converted "$1"' -- {} \; |
4
score
|
Tree-like output in ls$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' |
3
score
|
Get executed script's current working directory$ CWD=$(cd "$(dirname "$0")" && pwd) |
3
score
|
Random Git Commit$ git commit -m "$(w3m whatthecommit.com | head -n 1)" |
3
score
|
Generate a sequence of numbers$ for ((i=1; i<=10; ++i)); do echo $i; done |
3
score
|
Compute factorial of positive integer$ fac() { (echo 1; seq $1) | paste -s -d\* | bc; } |
3
score
|
Find all files recursively with specified string in the filename and output any lines found containing a different string.$ find . -name *conf* -exec grep -Hni 'matching_text' {} \; > matching_text.conf.list |
3
score
|
Extract your external IP address using dig$ dig +short myip.opendns.com @resolver1.opendns.com |
3
score
|
Remove offending key from known_hosts file with one swift move$ ssh-keygen -R <hostname> |
3
score
|
Convert a music file (mp3) to a mp4 video with a static image$ ffmpeg -loop_input -i cover.jpg -i soundtrack.mp3 -shortest -acodec copy output_video.mp4 |