How to Start Godoc on Mac
Fish: godoc -http=:6060 &; disown (pidof godoc) Bash: godoc -http=:6060 &; disown `pidof godoc` And pidof can be installed with Homebrew.
Fish: godoc -http=:6060 &; disown (pidof godoc) Bash: godoc -http=:6060 &; disown `pidof godoc` And pidof can be installed with Homebrew.
curl [args] --write-out "%{time_total}s" --output /dev/null --silent [URL]
wget --recursive --level=2 --no-parent --no-clobber --convert-links --continue [URL]
mongo --eval "JSON.stringify(db.currentOp(true))" | \ tail -n +3 | \ jq -r .inprog[].client | \ sed 's/\(.*\):.*/\1/' \ | sort | uniq -c | sort -nr dump connection information in standard JSON format remove MongoDB header extract IP:port as a list trim port sort IPs by freqencies
cat book.txt | \ tr '!()[]{};:",<.>?“”‘’*/\r' ' ' | \ tr ' ' '\n' | \ grep -a -P "^[\p{L}\p{N}\-']+\$" | \ grep -a -P -v "^[\p{N}\-']+\$" | \ sed "s/'s\$//" | \ sed "s/^'//" | sed "s/'\$//" > words.txt cat words.txt | \ sort | uniq -c | \ sort -nr | \ cut -c9- > words_desc.txt replace punctuations with space; remove \r from `\r\n' one word per line keep only words composed of unicode letters, numbers, hyphen and apostrophe remove pure numbers remove ’s remove starting and ending apostrophe output words.txt sort and count unique words ...
Updates at 2020-07-08: docker system prune Old tricks: docker ps --quiet --filter=status=exited | xargs docker rm docker images --no-trunc=true --filter="dangling=true" --quiet=true | xargs docker rmi
Generate SSH keys ssh-keygen -C [email protected] Authorize public key at remote server ssh-copy-id user@host On Mac OSX, ssh-copy-id should be installed first. brew install ssh-copy-id Generate PEM ssh-keygen -f ~/.ssh/id_rsa -e -m pem > ~/.ssh/id_rsa.pem Copy file by base64 On remote session, run base64 < myfile and copy the output. On local terminal, run base64 -d > myfile, paste the content and press ctrl+D.
Have you ever been annoyed by accidentally touching the touchpad on your laptop when you are typing? I am using a Linux laptop with both trackpoint and touchpad so the touchpad is just an annoying redundant thing. Here is the one-liner to disable it: xinput list | grep TouchPad | grep -Po 'id=\K([0-9]+)' | xargs xinput disable