Snippets about cmd

53 snippets

Back to all snippets

  1. SNP153

    Find the slowest pages in a Stati 2 build

    The metrics count the templates each page really rendered now, and the cache manifest names them.

    11 lines of sh in 2 blocks, 18 lines of explanation.

    #64A stati cmd
  2. SNP143

    Trusted certificates for localhost with mkcert

    HTTPS on your dev server without the browser warning, in three commands.

    8 lines of sh and js in 2 blocks, 10 lines of explanation.

    #46B ssl webdev cmd
  3. SNP139

    Tail CloudWatch logs

    Watch a Lambda's logs live, from the terminal, like tail -f.

    3 lines of sh in 3 blocks, 5 lines of explanation.

    #369 aws cmd
  4. SNP138

    Resize images in bulk with ImageMagick

    Shrink a folder of photos for the web in one command.

    3 lines of sh in 2 blocks, 10 lines of explanation with 4 notes.

  5. SNP136

    Open WSL folders in Explorer and the other way around

    Moving between the Linux and the Windows side without copying files.

    3 lines of sh in 3 blocks, 9 lines of explanation.

    #A51 wsl windows cmd
  6. SNP130

    Find the slowest pages in a Stati build

    Build metrics, the HTML report, and two jq one-liners.

    8 lines of sh in 2 blocks, 13 lines of explanation.

    #316 stati cmd
  7. SNP125

    Run a throwaway container with the current folder mounted

    Try a tool, a Node version or a Python version without installing anything.

    2 lines of sh in 2 blocks, 10 lines of explanation with 4 notes.

    #A45 docker cmd
  8. SNP124

    Rerun a command whenever a file changes

    A poor man's watch mode for anything that doesn't have one.

    3 lines of sh in 3 blocks, 6 lines of explanation.

    #316 cmd linux
  9. SNP120

    Reverse proxy a Node app with nginx

    Your app listens on 3000, the world talks to nginx on 443.

    18 lines of nginx and sh in 2 blocks, 3 lines of explanation.

    #593 nginx node cmd
  10. SNP119

    Copy your public key to a server

    One command instead of pasting into authorized_keys by hand.

    3 lines of sh in 3 blocks, 5 lines of explanation.

    #1B5 ssh cmd
  11. SNP115

    chmod numbers explained

    What 755 and 644 actually mean, so you stop copying them blindly.

    3 lines of sh in 1 block, 16 lines of explanation.

    #26B cmd linux
  12. SNP113

    Check when an SSL certificate expires from the terminal

    Before the browser warning does it for you.

    4 lines of sh in 3 blocks, 6 lines of explanation.

    #531 cmd ssl linux
  13. SNP109

    stati invalidate cheat sheet

    Clear Stati's build cache by tag, path, glob or age, and what each query really matches.

    17 lines of sh in 1 block, 10 lines of explanation with 4 notes.

    #942 stati cmd
  14. SNP108

    Purge the Cloudflare cache from the terminal

    After a deploy, make Cloudflare forget the old pages, without clicking through the dashboard.

    5 lines of sh in 2 blocks, 5 lines of explanation.

  15. SNP104

    Run a Node app as a systemd service

    Start on boot, restart on crash, logs in journalctl. No pm2 needed.

    20 lines of ini and sh in 2 blocks, 6 lines of explanation.

  16. SNP103

    Scale pixel art video without blur in ffmpeg

    Recording a 320 × 180 game and uploading it at 1080p without the smear.

    2 lines of sh in 2 blocks, 5 lines of explanation.

  17. SNP100

    tmux basics

    Start a long job on a server, close the laptop, come back to it later.

    3 lines of sh in 2 blocks, 7 lines of explanation.

    #2B6 cmd tmux linux
  18. SNP097

    Switch AWS CLI profiles

    Work and personal accounts in one terminal without mixing them up.

    5 lines of sh in 4 blocks, 6 lines of explanation.

    #935 aws cmd
  19. SNP096

    Resume a broken download with curl or wget

    The 8 GB ISO died at 97%. Don't start over.

    2 lines of sh in 2 blocks, 6 lines of explanation.

    #163 cmd linux
  20. SNP095

    jq basics

    Read, filter and reshape JSON in the terminal.

    7 lines of sh in 3 blocks, 6 lines of explanation.

    #4B2 jq cmd
  21. SNP086

    Sync a folder to S3

    Upload a built site to a bucket, sending only what changed.

    5 lines of sh in 2 blocks, 5 lines of explanation.

    #3B1 aws cmd
  22. SNP083

    Tunnel to a remote database over SSH

    Use your local database tools on a server's database that isn't exposed to the internet.

    2 lines of sh in 2 blocks, 7 lines of explanation.

    #962 ssh sql cmd
  23. SNP080

    List listening ports on linux

    What is this server actually exposing to the world?

    1 line of sh in 1 block, 9 lines of explanation with 4 notes.

  24. SNP074

    Upscale pixel art with ImageMagick without blur

    Turn a 32 px sprite into a 256 px image where every pixel stays a square.

    2 lines of sh in 2 blocks, 7 lines of explanation.

  25. SNP071

    Find and replace text in many files with sed

    Rename a function across a project from the terminal.

    2 lines of sh in 2 blocks, 7 lines of explanation.

    #426 cmd linux
  26. SNP070

    Disable SSH password login on a server

    Once your key works, close the door the bots keep knocking on.

    5 lines of sh in 3 blocks, 6 lines of explanation.

    #15A cmd ssh linux
  27. SNP065

    Check if a port is open from the terminal

    Is it the firewall, the service, or me?

    2 lines of sh in 2 blocks, 4 lines of explanation.

  28. SNP062

    Find the processes eating your memory

    The server is swapping. Who's responsible?

    3 lines of sh in 3 blocks, 6 lines of explanation.

    #295 cmd linux
  29. SNP058

    Send JSON with curl

    POST a JSON body to an API from the terminal, and read the answer.

    5 lines of sh in 2 blocks, 4 lines of explanation.

    #B12 curl cmd
  30. SNP051

    Crontab cheat sheet

    The five fields, the shortcuts and the two mistakes everybody makes.

    11 lines of sh in 3 blocks, 5 lines of explanation.

    #941 cmd linux
  31. SNP047

    Copy files with rsync over SSH

    Like scp, but it only sends what changed, and it can resume.

    1 line of sh in 1 block, 9 lines of explanation with 4 notes.

    #459 cmd ssh linux
  32. SNP046

    Open a shell in a running container

    Poke around inside a container to see what it actually looks like in there.

    3 lines of sh in 3 blocks, 4 lines of explanation.

    #B27 docker cmd
  33. SNP043

    Create a new user with sudo rights on Ubuntu

    Stop working as root on a fresh server.

    3 lines of sh in 2 blocks, 7 lines of explanation.

  34. SNP041

    Create a swap file on Ubuntu

    Small VPS, no swap, and npm install gets killed. Give it some room.

    7 lines of sh in 3 blocks, 2 lines of explanation.

  35. SNP037

    Redirect www and http to https in nginx

    One canonical address for your site, everything else gets a 301.

    23 lines of nginx and sh in 2 blocks, 1 line of explanation.

    #529 nginx cmd
  36. SNP035

    Trim a video without re-encoding with ffmpeg

    Cut a clip out of a long recording in a second, with no quality loss.

    2 lines of sh in 2 blocks, 4 lines of explanation.

    #397 ffmpeg cmd
  37. SNP033

    Dump and restore a MariaDB database

    Backups, moving a database to another server, or copying production to your machine.

    4 lines of sh in 3 blocks, 6 lines of explanation.

    #953 sql mariadb cmd
  38. SNP032

    Generate a random password in the terminal

    No password generator website needed.

    3 lines of sh in 3 blocks, 4 lines of explanation.

    #42B cmd linux
  39. SNP029

    Follow a log file live

    Watch a log as it is being written, with and without systemd.

    2 lines of sh in 2 blocks, 5 lines of explanation.

    #269 cmd linux
  40. SNP025

    Clean up Docker disk space

    Docker quietly ate 40 GB of my disk. Here is how to get it back.

    3 lines of sh in 3 blocks, 6 lines of explanation.

    #A42 docker cmd
  41. SNP023

    SSH config aliases

    Stop typing user@very-long-hostname.example.com -p 2222 every single time.

    10 lines of sh in 2 blocks, 4 lines of explanation.

    #159 ssh cmd
  42. SNP021

    Find the largest files and folders on linux

    The disk is full again. Here is how to find what is eating it.

    2 lines of sh in 2 blocks, 8 lines of explanation.

    #24B cmd linux
  43. SNP019

    Kill the process that is using a port

    Find out what is squatting on port 3000 and get rid of it.

    5 lines of sh in 4 blocks, 6 lines of explanation.

    #395 cmd linux
  44. SNP011

    Add more VSFTPD virtual user accounts

    How to add more virtual user accounts to your VSFTPD on linux.

    7 lines of sh in 3 blocks, 3 lines of explanation.

    #419 cmd
  45. SNP010

    Mount samba share on Ubuntu 20.04 server

    How to mount samba shares on the latest Ubuntu LTS release.

    3 lines of sh in 3 blocks, 4 lines of explanation.

    #2B1 cmd
  46. SNP009

    Compress and extract TAR files on linux

    How to compress and extract TAR files on linux with gzip easily.

    3 lines of sh in 3 blocks, 8 lines of explanation with 4 notes.

    #65B cmd
  47. SNP008

    File sizes on linux

    See files sizes easily in megabyte or gigabyte values.

    2 lines of sh in 2 blocks, 3 lines of explanation.

    #513 cmd
  48. SNP007

    Reset MariaDB root password on linux

    An easy way to reset the password of the root user on linux.

    11 lines of sh in 8 blocks, 11 lines of explanation.

    #139 cmd
  49. SNP006

    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.

    8 lines of sh in 5 blocks, 8 lines of explanation.

    #931 cmd
  50. SNP005

    List all users and groups on linux

    Simple way to check your user list with your groups.

    3 lines of sh in 3 blocks, 3 lines of explanation.

    #962 cmd
  51. SNP004

    Chown basics on linux

    Change the owner of files on a linux machine.

    4 lines of sh in 4 blocks, 4 lines of explanation.

    #523 cmd
  52. SNP002

    Ubuntu run command in the background

    Sometimes you just need to run commands in the background.

    1 line of sh in 1 block, 1 line of explanation.

    #123 cmd
  53. SNP001

    Certbot snippets

    Useful commands for SSL cert generation with Certbot.

    4 lines of sh in 3 blocks, 3 lines of explanation.

    #26A cmd