💾 Archived View for tommi.space › Cheat%20sheets.gmi captured on 2023-01-29 at 03:02:57. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Terminal

Useful terminal commands

terminal

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

Storage analyser

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:

Take a screenshot

man screencapture

Subliminal

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

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

Resources

The art of command line

awesome-macos-command-line

Marcel Bischoff

Commandlinefu best commands

Handy Bash Shell Aliases For Linux

Shell commands for simple tasks of processing CSV file

chmod guide

Linux command line

GPG

GnuPG Cheat Sheets:

<script src='https://gist.github.com/turingbirds/3df43f1920a98010667a.js'></script>

GnuPG CheatSheet

devhints.io

GPG Cheat Sheet

sd

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.

sd

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.

HTML proofer

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.

HTML Proofer > Configuration

Linux

![[Linuxplosion#Cheat sheet]]

Vim

![[Vim#Cheat Sheet]]

Pandoc

![[Pandoc#Cheat sheet]]

Exiftool

![[ExifTool#Cheat Sheet]]

FFMPEG

![[FFMPEG#Cheat Sheet]]

git

![[git#Cheat sheet]]

Nextcloud manteinance

![[Server Setup#Nextcloud Cheat Sheet]]