• take screenshot of active android device
  adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
  • parse json in vim / through python
  :%!python -m json.tool
  • regex to delete x characters
  • create password protected zip (will prompt for password)
  zip -er myfolder
  • export mov to gif
  ffmpeg -i -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > test.gif


  • setup dock properly
  defaults write autohide-delay -int 0;killall Dock
  • screenshot settings: folder on desktop + don’t show thumbnail on capture
  mkdir ~/Desktop/screenshots
  defaults write location ~/Desktop/screenshots
  defaults write "show-thumbnail" -bool "false"
  • keep mac awake
  caffeinate -d


  • start mosquitto server (homebrew)
  launchctl load /usr/local/Cellar/mosquitto/1.4.14_2/homebrew.mxcl.mosquitto.plist 
  launchctl start homebrew.mxcl.mosquitto
  • listen to all topics (also tests if mosquitto server was succesfully started)
  mosquitto_sub -v -t '#'


  • DNS checks
  dig A
  dig CNAME
  • upload file to server
  scp myfile.txt [email protected]:/srv/www/files/files/myfile.txt
  • verify ssl certificate
  openssl s_client -showcerts -connect


  • remove last N commits
  git reset --hard HEAD~N
  • squash last N commits
  git rebase -i HEAD~N
  • update last commit with currently staged changes
  git commit --amend

Notes overview