Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
date updated tags aliases description redirect_from image
2020-05-07 02:00:00 +0200
2022-01-24 15:28:24 +0100
Cheat Sheet, cmd, CLI, Command Line, Terminal
I use tech devices a lot, maybe too much, but I do not dive in too technically. The few times I have to get things done with more technical tools, I need some reference.



Useful terminal commands

change screenshot format

defaults write type jpg
killall SystemUIServer

build a Jekyll website and deploy it


JEKYLL_ENV=production bundle exec jekyll build
rsync -avr --rsh='ssh' --delete-after --delete-excluded _site/

note: -avr could be -avz instead

Compress a file or a folder

zip -r -X folder-to-compress

prevent sleep

caffeinate -i -t 3600

Change update interval

defaults write ScheduleFrequency -int 1

A quick for loop

for f in *.txt; do pandoc '$f' -s -o '${f%.txt}.rtf'; done

watch Star Wars - A New Hope in ASCII (not a joke)

nc 23

Erase disk

sudo diskutil eraseDisk /dev/disk2 

Disk space usage

du # dust

With say, convert a text file to an audio file with Apple’s TTS engine:

say -v Alex -f file.txt -o "output.m4a"
  • -v allows you to select the kind of voice for the output

recursively count files in a directory

find . -type f | wc -l

Take a screenshot:

man screencapture


subliminal --opensubtitles xplosionmind 'z#5Br1&9b7niM~QZ$2hJTkn2gQRReJWy4i8zwuF6Pc1wXA#fVIcykUjb' download -l en

Downgrade package with Homebrew

# remove current version
brew uninstall navi

# find formula/bottle
# launches url
brew info --github navi

# from github url
# 1. locate version 
# 2. click 'History'
# 3. locate for the version from @BrewTestBot
# 4. click 'Commit' > 'View File' > Raw
# 5. fetch using `cURL`
curl -O

# install older version
brew install navi.rb && rm navi.rb

# optional, pin until fix is known
brew pin navi



GnuPG Cheat Sheets:

<script src=''></script>


sd is a wonderful command-line tool to find and replace sub-strings in files. Its original version is sed, which comes by default in shell.

Replace foo with bar in all files inside pwd:

sd 'foo' 'bar' ./*

HTML proofer

HTML proofer is a Ruby script to check HTML quality of a local folder. It can both be used as a library and as a command line tool.

basic check of a Jekyll website

bundle exec htmlproofer --assume-extension --allow_hash_href --check_favicon --check_opengraph --check_html --check_img_http --http_status_ignore 429 --url_ignore '#!' --checks_to_ignore '#!' --report_eof_tags --report_invalid_tags --report_mismatched_tags --report_missing_names --report_script_embeds /Users/tommi/\_site # --report_missing_doctype

See HTML Proofer > Configuration for the complete parameters list.


![[Linuxplosion#Cheat sheet]]


![[Vim#Cheat Sheet]]


![[Pandoc#Cheat sheet]]


![[Exiftool#Cheat Sheet]]


![[FFMPEG#Cheat Sheet]]


![[git#Cheat sheet]]

Nextcloud manteinance

![[Server Setup#Nextcloud Cheat Sheet]]