1
score
|
Get the latest Arch Linux news$ w3m https://www.archlinux.org/ | sed -n "/Latest News/,/Older News/p" | head -n -1 |
1
score
|
Listen to the radio (radio2 in example)$ mpv http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/llnw/bbc_radio_two.m3u8 |
1
score
|
Go up to a particular folder$ alias ph='cd ${PWD%/public_html*}/public_html' |
1
score
|
Preserve your fingers from cd ..; cd ..; cd..; cd..;$ up(){ DEEP=$1; for i in $(seq 1 ${DEEP:-"1"}); do cd ../; done; } |
1
score
|
List the content of a GitHub repository without cloning it$ svn ls https://github.com/user/repo/trunk/some/path |
1
score
|
Delete static and dynamic arp for /24 subnet$ for i in {1..254}; do arp -d 192.168.0.$i; done |
1
score
|
Shuffle lines$ ... | perl -MList::Util=shuffle -e 'print shuffle <>;' |
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' |
1
score
|
Download a file from a webserver with telnet$ (echo 'GET /'; echo; sleep 1; ) | telnet www.google.com 80 |
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 |
1
score
|
Remove all at jobs$ atq | sed 's_\([0-9]\{1,8\}\).*_\1_g' | xargs atrm |
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 |
1
score
|
Extensive "cleanup" operations following "sudo yum upgrade"$ sudo yum upgrade && for pkg in $(package-cleanup --orphans -q); do repoquery $(rpm -q $pkg --queryformat="%{NAME}") | grep -q ".*" && echo $pkg; done | xargs sudo yum -y remove && for pkg in $(package-cleanup --leaves --all -q); do repoquery --groupmember $pkg | grep -q "@" || echo $pkg; done |
1
score
|
Get average CPU temperature from all cores.$ __=`sensors | grep Core` && echo \(`echo $__ | sed 's/.*+\(.*\).C\(\s\)\+(.*/\1/g' | tr "\n" "+" | head -c-1`\)\/`echo $__ | wc -l` | bc && unset __ |
1
score
|
Concatenate multiple SSL certificate files to make one PEM file$ files=("yourcert.crt" "provider.ca.pem") && for i in ${files[@]} ; do $(cat $i >> yourcert.pem && echo "" >> yourcert.pem) ; done |
1
score
|
List all non Git comited files and make a gzip archive with them$ GITFOLDER="/srv/some/folder" ls-files --others --exclude-standard | tar czf ${GITFOLDER}-archives/uploads-$(date '+%Y%m%d%H%M').tar.gz -T - |
1
score
|
Converts DD/MM/YYYY date format to ISO-8601 (YYYY-MM-DD)$ sed 's_\([0-9]\{1,2\}\)/\([0-9]\{1,2\}\)/\([0-9]\{4\}\)_\3-\2-\1_g' |
1
score
|
Counting the number of commas in CSV format$ perl -ne 'print tr/,//, "\n"' < file.csv | sort -u |
1
score
|
Find which log files contain or don't contain a specific error message$ for i in *.log; do grep OutOfMemo $i >/dev/null && echo $i oom || echo $i ok; done |
1
score
|
Convert text from decimal to little endian hexadecimal$ echo $(printf %08X 256 | grep -o .. | tac | tr -d '\n') |
1
score
|
Md5sum the last 5 files in a folder$ find /directory1/directory2/ -maxdepth 1 -type f | sort | tail -n 5 | xargs md5sum |
1
score
|
Create a transparent image of given dimensions$ convert -size 100x100 xc:none transparency.png |
1
score
|
Print a random cat$ wget -O - http://placekitten.com/$[500 + RANDOM % 500] | lp |