Snippets about cmd
52 snippets
-
SNP 143
#46B
Trusted certificates for localhost with mkcert
HTTPS on your dev server without the browser warning, in three commands.
-
SNP 139
#369
Tail CloudWatch logs
Watch a Lambda's logs live, from the terminal, like tail -f.
-
SNP 138
#13B
Resize images in bulk with ImageMagick
Shrink a folder of photos for the web in one command.
-
SNP 136
#A51
Open WSL folders in Explorer and the other way around
Moving between the Linux and the Windows side without copying files.
-
SNP 130
#316
Find the slowest pages in a Stati build
Build metrics, the HTML report, and two jq one-liners.
-
SNP 125
#A45
Run a throwaway container with the current folder mounted
Try a tool, a Node version or a Python version without installing anything.
-
SNP 124
#316
Rerun a command whenever a file changes
A poor man's watch mode for anything that doesn't have one.
-
SNP 120
#593
Reverse proxy a Node app with nginx
Your app listens on 3000, the world talks to nginx on 443.
-
SNP 119
#1B5
Copy your public key to a server
One command instead of pasting into authorized_keys by hand.
-
SNP 115
#26B
chmod numbers explained
What 755 and 644 actually mean, so you stop copying them blindly.
-
SNP 113
#531
Check when an SSL certificate expires from the terminal
Before the browser warning does it for you.
-
SNP 109
#942
stati invalidate cheat sheet
Clear Stati's build cache by tag, path, glob or age, and what each query really matches.
-
SNP 108
#3B6
Purge the Cloudflare cache from the terminal
After a deploy, make Cloudflare forget the old pages, without clicking through the dashboard.
-
SNP 104
#64B
Run a Node app as a systemd service
Start on boot, restart on crash, logs in journalctl. No pm2 needed.
-
SNP 103
#359
Scale pixel art video without blur in ffmpeg
Recording a 320 × 180 game and uploading it at 1080p without the smear.
-
SNP 100
#2B6
tmux basics
Start a long job on a server, close the laptop, come back to it later.
-
SNP 097
#935
Switch AWS CLI profiles
Work and personal accounts in one terminal without mixing them up.
-
SNP 096
#163
Resume a broken download with curl or wget
The 8 GB ISO died at 97%. Don't start over.
-
SNP 095
#4B2
jq basics
Read, filter and reshape JSON in the terminal.
-
SNP 086
#3B1
Sync a folder to S3
Upload a built site to a bucket, sending only what changed.
-
SNP 083
#962
Tunnel to a remote database over SSH
Use your local database tools on a server's database that isn't exposed to the internet.
-
SNP 080
#259
List listening ports on linux
What is this server actually exposing to the world?
-
SNP 074
#52B
Upscale pixel art with ImageMagick without blur
Turn a 32 px sprite into a 256 px image where every pixel stays a square.
-
SNP 071
#426
Find and replace text in many files with sed
Rename a function across a project from the terminal.
-
SNP 070
#15A
Disable SSH password login on a server
Once your key works, close the door the bots keep knocking on.
-
SNP 065
#513
Check if a port is open from the terminal
Is it the firewall, the service, or me?
-
SNP 062
#295
Find the processes eating your memory
The server is swapping. Who's responsible?
-
SNP 058
#B12
Send JSON with curl
POST a JSON body to an API from the terminal, and read the answer.
-
SNP 051
#941
Crontab cheat sheet
The five fields, the shortcuts and the two mistakes everybody makes.
-
SNP 047
#459
Copy files with rsync over SSH
Like scp, but it only sends what changed, and it can resume.
-
SNP 046
#B27
Open a shell in a running container
Poke around inside a container to see what it actually looks like in there.
-
SNP 043
#591
Create a new user with sudo rights on Ubuntu
Stop working as root on a fresh server.
-
SNP 041
#369
Create a swap file on Ubuntu
Small VPS, no swap, and npm install gets killed. Give it some room.
-
SNP 037
#529
Redirect www and http to https in nginx
One canonical address for your site, everything else gets a 301.
-
SNP 035
#397
Trim a video without re-encoding with ffmpeg
Cut a clip out of a long recording in a second, with no quality loss.
-
SNP 033
#953
Dump and restore a MariaDB database
Backups, moving a database to another server, or copying production to your machine.
-
SNP 032
#42B
Generate a random password in the terminal
No password generator website needed.
-
SNP 029
#269
Follow a log file live
Watch a log as it is being written, with and without systemd.
-
SNP 025
#A42
Clean up Docker disk space
Docker quietly ate 40 GB of my disk. Here is how to get it back.
-
SNP 023
#159
SSH config aliases
Stop typing [email protected] -p 2222 every single time.
-
SNP 021
#24B
Find the largest files and folders on linux
The disk is full again. Here is how to find what is eating it.
-
SNP 019
#395
Kill the process that is using a port
Find out what is squatting on port 3000 and get rid of it.
-
SNP 011
#419
Add more VSFTPD virtual user accounts
How to add more virtual user accounts to your VSFTPD on linux.
-
SNP 010
#2B1
Mount samba share on Ubuntu 20.04 server
How to mount samba shares on the latest Ubuntu LTS release.
-
SNP 009
#65B
Compress and extract TAR files on linux
How to compress and extract TAR files on linux with gzip easily.
-
SNP 008
#513
File sizes on linux
See files sizes easily in megabyte or gigabyte values.
-
SNP 007
#139
Reset MariaDB root password on linux
An easy way to reset the password of the root user on linux.
-
SNP 006
#931
Fix MariaDB missing tables on Manjaro/Arch linux
Here is how to fix the missing tables in MariaDB that you may encounter on a fresh install on Manjaro or Arch linux.
-
SNP 005
#962
List all users and groups on linux
Simple way to check your user list with your groups.
-
SNP 004
#523
Chown basics on linux
Change the owner of files on a linux machine.
-
SNP 002
#123
Ubuntu run command in the background
Sometimes you just need to run commands in the background.
-
SNP 001
#26A
Certbot snippets
Useful commands for SSL cert generation with Certbot.