MacOS keyboard shortcuts

Full manual here

In Finder:

Screenshot one window +Shift+4+Spacebar

Force quit an app +Shift+ESC


Terminal cheatsheet

Basic commands

ls _ _ _ List the normal files and folders in the current directory in condensed format
pwd _ _ _ Output the full path of the current working directory for this terminal
cd _ _ _ Change directory. When used by itself, it will change to your home directory
cd [FOLDER] _ _ _ Change current working directory to the desired [FOLDER]
cd .. _ _ _ Change your current working directory to the parent directory
cat [FILE] _ _ _ Output the contents of a [FILE] to the terminal
mkdir [FOLDER_NAME] _ _ _ Create (make) a new folder (directory) with the desired [FOLDER_NAME]. This occurs in your current working directory
cp [FILE] [DUPLICATE_FILE] _ _ _ Make a copy of a file
mv [FILE] [MOVED_FILE] _ _ _ Move files and folders. Can also rename files and folders
rm [FILE] _ _ _ (remove) Delete [FILE]
rm -r [FOLDER] _ _ _ Delete a [FOLDER] recursively (the folder and everything in it)


Start a web server with Python

Navigate to the folder that includes web content, ex: cd Desktop/neocities-e0x0e0

(Optional) Make sure we’re in the right folder with pwd, check content with ls and check content of each file if needed using cat.

Start the basic Python web server. Server port doesn’t need to be 8000, it can be anything.
python3 -m http.server 8000

Terminal will return something like:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)

Check your web content: Open up a browser and go to http:// localhost:8000

Stop the server: in Terminal press Cltr+C on keyboard.
Terminal will return:

^C
Keyboard interrupt received, exiting.

Painless method to convert PNG to ICNS

ICNS files are specific MacOS app icon files, because of course Apple have to make it super hard for anyone to change the icon of an app. Online converters are total shit, and all the Python scripts I found online didn't work for some reasons. This shell script is the fastest method (takes like half a second) and also the only thing that worked for me.

Note: the size of the PNG doesn't need to be 1024px, it only needs to be >= 512px but as we're using sips to resize I'm just scaling it up to 1024px to prevent blurry downsizing.

Create file CreateICNS.src with the script:

mkdir MyIcon.iconset
sips -z 16 16     Icon1024.png --out MyIcon.iconset/icon_16x16.png
sips -z 32 32     Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png
sips -z 32 32     Icon1024.png --out MyIcon.iconset/icon_32x32.png
sips -z 64 64     Icon1024.png --out MyIcon.iconset/icon_32x32@2x.png
sips -z 128 128   Icon1024.png --out MyIcon.iconset/icon_128x128.png
sips -z 256 256   Icon1024.png --out MyIcon.iconset/icon_128x128@2x.png
sips -z 256 256   Icon1024.png --out MyIcon.iconset/icon_256x256.png
sips -z 512 512   Icon1024.png --out MyIcon.iconset/icon_256x256@2x.png
sips -z 512 512   Icon1024.png --out MyIcon.iconset/icon_512x512.png
cp Icon1024.png MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns MyIcon.iconset
rm -R MyIcon.iconset

Prepare your PNG: name it Icon1024.png, place it in the same directory as CreateICNS.src

On Terminal, navigate to the folder that contains both the script and image file. Ex: cd /Desktop

Type source CreateICNS.src

Ta-da. The MyIcon.icns file is now created in the same folder.