0
score
|
Puppet/Bash: test compare json objects.$ unless => "client_remote=\"$(curl localhost:9200/_cluster/settings | python -c \"import json,sys;obj=json.load(sys.stdin);print(obj['persistent']['search']['remote'])\")\"; new_remote=\"$( echo $persistent_json | python -c \"import json,sys;obj=json.load(sys.stdin);print(obj['persistent']['search']['remote'])\")\"; [ \"$client_remote\" = \"$new_remote\" ]", |
0
score
|
Print wifi access points sorted by signal$ iw dev IFACE scan | egrep "SSID|signal" | awk -F ":" '{print $2}' | sed 'N;s/\n/:/' | sort |
0
score
|
Delete all untagged Docker images$ docker images -q -f dangling=true | xargs --no-run-if-empty --delim='\n' docker rmi |
0
score
|
Source without circular reference$ [ ! "${LIB}" ] && ( readonly LIB; . "${ $( cd $( dirname $0 ) && pwd ) }/<path_to>/LIB.sh" ) |
0
score
|
Remove new lines from files and folders$ rename 's/[\r\n]//g' * |
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 |