💾 Archived View for tommi.space › Cheat%20sheets.gmi captured on 2023-07-22 at 16:36:39. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Useful terminal commands
change screenshot format
defaults write com.apple.screencapture type jpg killall SystemUIServer
build a Jekyll website and deploy it
#!/bin/bash JEKYLL_ENV=production bundle exec jekyll build rsync -avr --rsh='ssh' --delete-after --delete-excluded _site/ username@IP.Add.re.ss:~/notes/_site
note: -avr could be -avz instead
Compress a file or a folder
zip -r -X archive-name.zip folder-to-compress
prevent sleep
caffeinate -i -t 3600
Change update interval
defaults write com.apple.SoftwareUpdate 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](https://en.wikipedia.org/wiki/Star_Wars_(film) ''“Star Wars” on Wikipedia') in ASCII (not a joke)
https://en.wikipedia.org/wiki/Star_Wars_(film
nc towel.blinkenlights.nl 23
Erase disk
sudo diskutil eraseDisk /dev/disk2
Disk space usage
du # dust
lsblk -a -T -h
Storage analyser - YunoHost Forum
With say, convert a text file to an audio file with Apple’s TTS engine:
say -v Alex -f file.txt -o output.m4a
recursively count files in a directory
find . -type f | wc -l
Recursively copying files from subdirectories to root directory
find ./input/ -type file -exec cp {} ./output/ \; # or a more modern alternative fd . ./input/ -t f -x cp {} ./output/ \;
Take a screenshot:
man screencapture
subliminal --opensubtitles xplosionmind 'z#5Br1&9b7niM~QZ$2hJTkn2gQRReJWy4i8zwuF6Pc1wXA#fVIcykUjb' download -l en La.Casa.de.Papel.S05E10.1080p.WEB-DL.DUAL.5.1.mkv
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 https://raw.githubusercontent.com/Homebrew/homebrew-core/7c7f18795fac61747fe383d7c22ec183d5283362/Formula/navi.rb # install older version brew install navi.rb && rm navi.rb # optional, pin until fix is known brew pin navi
Handy Bash Shell Aliases For Linux
Shell commands for simple tasks of processing CSV file
GnuPG Cheat Sheets:
<script src='https://gist.github.com/turingbirds/3df43f1920a98010667a.js'></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 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/tommi.space/\_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]]
![[Server Setup#Nextcloud Cheat Sheet]]