1
score
|
Delete static and dynamic arp for /24 subnet$ for i in {1..254}; do arp -d 192.168.0.$i; done |
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")}' |
1
score
|
Shuffle lines$ ... | perl -MList::Util=shuffle -e 'print shuffle <>;' |
0
score
|
Create an array of CPU frequencies in GHz$ cpus=($({ echo scale=2; awk '/cpu MHz/ {print $4 " / 1000"}' /proc/cpuinfo; } | bc)) |
0
score
|
Test git archive before actually creating an archive // fake dry run$ git archive master some/project/subdir | tar t |
2
score
|
Convert all flac files in dir to mp3 320kbps using ffmpeg$ for FILE in *.flac; do ffmpeg -i "$FILE" -b:a 320k "${FILE[@]/%flac/mp3}"; done; |
1
score
|
Preserve your fingers from cd ..; cd ..; cd..; cd..;$ upup(){ DEEP=$1; [ -z "${DEEP}" ] && { DEEP=1; }; for i in $(seq 1 ${DEEP}); do cd ../; done; } |
1
score
|
Get number of all Python Behave scenarios (including all examples from Scenario Outlines)$ behave -d | grep "scenarios passed" | cut -d, -f4 | sed -e 's/^[[:space:]]*//' | sed 's/untested/scenarios/g' |
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 |
-1
score
|
Get a free shell account on a community server$ sh <(curl hashbang.sh | gpg) |
0
score
|
Shuffle lines$ seq 5 | shuf |
8
score
|
Generate a sequence of numbers$ echo {01..10} |
4
score
|
Run a command and copy its output to clipboard (Mac OSX)$ echo "Here comes the output of my failing code" | tee >(pbcopy) |
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- |
1
score
|
Download a file from a webserver with telnet$ (echo 'GET /'; echo; sleep 1; ) | telnet www.google.com 80 |
0
score
|
Print the window title of current mpv session to display what is playing$ wmctrl -pl | grep $(pidof mpv) | cut -d- -f2- |
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"' -- {} \; |
3
score
|
Generate a sequence of numbers$ for ((i=1; i<=10; ++i)); do echo $i; done |
0
score
|
Shuffle lines$ ... | perl -MList::Util -e 'print List::Util::shuffle <>' |
1
score
|
Print a flat list of dependencies of a Maven project$ mvn dependency:list | sed -ne s/..........// -e /patterntoexclude/d -e s/:compile//p -e s/:runtime//p | sort | uniq |
1
score
|
Open Windows internet shortcut (*.url) files in firefox$ grep -i url='*' file.url | cut -b 5- | xargs firefox |
0
score
|
Open Windows internet shortcut (*.url) files in firefox$ firefox $(grep -i ^url='*' file.url | cut -b 5-) |
1
score
|
Remove all at jobs$ atq | sed 's_\([0-9]\{1,8\}\).*_\1_g' | xargs atrm |
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 |
1
score
|
Deletes orphan vim undo files$ find . -type f -iname '*.un~' | while read UNDOFILE ; do FILE=$( echo "$UNDOFILE" | sed -r -e 's/.un~$//' -e 's&/\.([^/]*)&/\1&' ) ; [[ -e "$FILE" ]] || rm "$UNDOFILE" ; done |