0
score
|
Get the HTTP status code of a URL$ curl -Lw '%{http_code}' -s -o /dev/null -I SOME_URL |
0
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 | cowsay |
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 |
0
score
|
Shuffle lines$ seq 5 | shuf |
0
score
|
Print the window title of current mpv session to display what is playing$ wmctrl -pl | grep $(pidof mpv) | cut -d- -f2- |
0
score
|
Shuffle lines$ ... | perl -MList::Util -e 'print List::Util::shuffle <>' |
0
score
|
Open Windows internet shortcut (*.url) files in firefox$ firefox $(grep -i ^url='*' file.url | cut -b 5-) |
0
score
|
Check if a file exists and has a size greater than X$ [[ $(find /path/to/file -type f -size +51200c 2>/dev/null) ]] && echo true || echo false |
0
score
|
Replace sequences of the same characters with a single character$ echo heeeeeeelllo | sed 's/\(.\)\1\+/\1/g' |
0
score
|
Count the lines of each file extension in a list of files$ git ls-files | xargs wc -l | awk -F ' +|\\.|/' '{ sumlines[$NF] += $2 } END { for (ext in sumlines) print ext, sumlines[ext] }' |
0
score
|
Add all unknown files in a Subversion checkout$ svn add . --force |
0
score
|
Find files that are not executable$ find /some/path -type f ! -perm -111 -ls |
0
score
|
Create a heap dump of a Java process$ jmap -dump:format=b,file=/var/tmp/dump.hprof 1234 |
0
score
|
Insert lines from one text file to another one$ awk 'NR % 10 == 1 {getline f2 < "file1"; print f2} 1' file2 | cat -n |
0
score
|
Check that a directory is a parent of another$ is_parent() { [[ "$2" =~ $1/? ]]; } |
0
score
|
Create fattal tone mapped images from a directory of raw images$ for img in /path/to/rawimages/*.RW2; do pfsin ${img} | pfssize -x 1024 -y 768 | pfstmo_fattal02 -v -s 1 | pfsout /path/to/finished/${img%%}.jpg; done |
0
score
|
Calculate md5sum from an input string$ md5sum <<< YOUR_TEXT | cut -f1 -d' ' |
0
score
|
Get streamed FLV from Chrome with lsof$ export psid=$(pgrep -f libflashplayer.so); cp /proc/$psid/fd/$(lsof -p $psid | grep eleted | awk {' print $4 '} | sed -e "s/[a-z]//g") saved.flv |
0
score
|
Rename all files in a directory to upper case$ for i in *; do mv "$i" "${i^^}"; done |
0
score
|
Print file owners and permissions of a directory tree$ find /path/to/dir1 -printf "%U %G %m %p\n" > /tmp/dir1.txt |
0
score
|
Get only the latest version of a file from across mutiple directories$ find . -name custlist\* | perl -ne '$path = $_; s?.*/??; $name = $_; $map{$name} = $path; ++$c; END { print $map{(sort(keys(%map)))[$c-1]} }' |
0
score
|
Recreate or update an existing zip file and remove files that do not exist anymore$ zip --filesync -r /path/to/out.zip /path/to/dir |
0
score
|
How to expand a CIDR notation to its IPs$ for j in $(seq 0 255); do for i in $(seq 0 255) ; do seq -f "10.$j.$i.%g" 0 255; done; done |
0
score
|
Make the output of the `time` builtin easier to parse$ TIMEFORMAT=%R |