Linux
General Info
Web server management
Apache setup & Virtual servers
Initial setup Install packages sudo apt install apache2 mariadb-server libapache2-mod-php php-my...
SQL
After install ensure secure access sudo mysql_secure_installation Logging in mysql -u USER...
SSL & Certificate management
Install certbot and run setup sudo apt install certbot python3-certbot-apache a2enmod ssl sudo...
PostgreSQL
Install Install postgresql and postgis for coordinates data sudo apt install postgresql postgis...
SQL Reference
Create a table that auto deletes on other table deletion CREATE TABLE tradie_postcode_covered ( ...
Mail Server
Initial setup 1 - Updates sudo apt update && sudo apt upgrade -y 2 - Install docker and do...
Software & packages
Image manipulation
Compression Install sudo apt-get install imagemagick Compress command mogrify -quality 80% *.jp...
yt-dlp
Download video as mp3 yt-dlp -x --audio-format mp3 URL_HERE Convert webm to mp4 ffmpeg -i i...
Python packages and commands
Managing Virtual Envrionments Create a new venv python3 -m venv /path/to/new/virtual/environment...
spotdl
Install & Setup Best to load a venv first Installing spotdl pip install spotdl Open the confi...
ffmpeg
Installing sudo apt install ffmpeg Compress a video to h265 ffmpeg -i example_h264.mp4 -c:v...
IPFS
Installation for Linux 1 - Download the package wget https://dist.ipfs.tech/kubo/v0.31.0/kubo_...
Wireguard
Setup Script #!/bin/bash # Checks to see if script is being run as root if [ "$EUID" -ne 0 ]...
Node & NVM
1 - install node version manager (NVM) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0....
Syncthing
Screen
Screen lets you make virtual terminals with screen New session with name screen -S sessi...
SMB
Editing SMB shares on linux 1 - Open the config file at /etc/samba/smb.conf 2 - Edit the SMB ...
Mounting & Unmounting
Get disk information List information about all available block devices, including disks and the...
Symbolic Links
Regular SymLink ln -s /path/to/target /path/to_where_new_shortcut_is_made -s = softlink like a...
Users & Permissions
Users and groups List all groups and users in groups getent group Add a user to a group su...
General Management & commands
Get the size of a folder ncdu /path/to/view/ Strip all metadata from files exiftool -all= -o...
SSH
Generate a keypair 1 - Generate the key ssh-keygen -t ed25519 -a 100 -f $HOME/.ssh/SSH_KEY_NAM...
Fail2Ban
Setup Update and install apt update && apt upgrade -y && apt install -y fail2ban Start fail2b...
wget
General Usage wget -Flags URL Full site mirror wget -mkprE -np -nc -l inf -e robots=off --re...
Bash
Edit shortcuts Open .bashrc file and add alias 1="command" Auto run commands on terminal op...
UFW
General Info By default, UFW is set to deny all incoming connections and allow all outgoing conn...
Swap
Clear swap file 1 - Disable Swap sudo swapoff -a 2 - Re-enable swap sudo swapon -a V...
Disk Stuff
List disks: fdisk -l OR df -h Scanning 1 - Check if SMART scans are enabled smartc...
Auto updates
1 - Install and setup unattended-upgrades package sudo apt update && sudo apt install unattended...
SSH Tunnel
ssh -L 127.0.0.1:3389:192.168.4.222:3389 -N conor@cbcore -N = Don't execute command on remote se...