Snippets about cmd

52 snippets

Back to all snippets

  1. SNP 143 #46B

    Trusted certificates for localhost with mkcert

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

  2. SNP 139 #369

    Tail CloudWatch logs

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

  3. SNP 138 #13B

    Resize images in bulk with ImageMagick

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

  4. SNP 136 #A51

    Open WSL folders in Explorer and the other way around

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

  5. SNP 130 #316

    Find the slowest pages in a Stati build

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

  6. 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.

  7. SNP 124 #316

    Rerun a command whenever a file changes

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

  8. SNP 120 #593

    Reverse proxy a Node app with nginx

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

  9. SNP 119 #1B5

    Copy your public key to a server

    One command instead of pasting into authorized_keys by hand.

  10. SNP 115 #26B

    chmod numbers explained

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

  11. SNP 113 #531

    Check when an SSL certificate expires from the terminal

    Before the browser warning does it for you.

  12. SNP 109 #942

    stati invalidate cheat sheet

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

  13. SNP 108 #3B6

    Purge the Cloudflare cache from the terminal

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

  14. SNP 104 #64B

    Run a Node app as a systemd service

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

  15. SNP 103 #359

    Scale pixel art video without blur in ffmpeg

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

  16. SNP 100 #2B6

    tmux basics

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

  17. SNP 097 #935

    Switch AWS CLI profiles

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

  18. SNP 096 #163

    Resume a broken download with curl or wget

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

  19. SNP 095 #4B2

    jq basics

    Read, filter and reshape JSON in the terminal.

  20. SNP 086 #3B1

    Sync a folder to S3

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

  21. 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.

  22. SNP 080 #259

    List listening ports on linux

    What is this server actually exposing to the world?

  23. 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.

  24. SNP 071 #426

    Find and replace text in many files with sed

    Rename a function across a project from the terminal.

  25. SNP 070 #15A

    Disable SSH password login on a server

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

  26. SNP 065 #513

    Check if a port is open from the terminal

    Is it the firewall, the service, or me?

  27. SNP 062 #295

    Find the processes eating your memory

    The server is swapping. Who's responsible?

  28. SNP 058 #B12

    Send JSON with curl

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

  29. SNP 051 #941

    Crontab cheat sheet

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

  30. SNP 047 #459

    Copy files with rsync over SSH

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

  31. SNP 046 #B27

    Open a shell in a running container

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

  32. SNP 043 #591

    Create a new user with sudo rights on Ubuntu

    Stop working as root on a fresh server.

  33. SNP 041 #369

    Create a swap file on Ubuntu

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

  34. SNP 037 #529

    Redirect www and http to https in nginx

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

  35. 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.

  36. SNP 033 #953

    Dump and restore a MariaDB database

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

  37. SNP 032 #42B

    Generate a random password in the terminal

    No password generator website needed.

  38. SNP 029 #269

    Follow a log file live

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

  39. SNP 025 #A42

    Clean up Docker disk space

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

  40. SNP 023 #159

    SSH config aliases

    Stop typing [email protected] -p 2222 every single time.

  41. 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.

  42. SNP 019 #395

    Kill the process that is using a port

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

  43. SNP 011 #419

    Add more VSFTPD virtual user accounts

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

  44. SNP 010 #2B1

    Mount samba share on Ubuntu 20.04 server

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

  45. SNP 009 #65B

    Compress and extract TAR files on linux

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

  46. SNP 008 #513

    File sizes on linux

    See files sizes easily in megabyte or gigabyte values.

  47. SNP 007 #139

    Reset MariaDB root password on linux

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

  48. 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.

  49. SNP 005 #962

    List all users and groups on linux

    Simple way to check your user list with your groups.

  50. SNP 004 #523

    Chown basics on linux

    Change the owner of files on a linux machine.

  51. SNP 002 #123

    Ubuntu run command in the background

    Sometimes you just need to run commands in the background.

  52. SNP 001 #26A

    Certbot snippets

    Useful commands for SSL cert generation with Certbot.