Skip to content

Tips

Handy tips always at your fingertips

A collection of 123 tips that come in real handy when you need them. Originally posted as tweets on my Twitter account, and now gathered here so you can browse them easily.

Restrict SSH Key to Specific Commands

💡 You can restrict/force an SSH key to one command and prevent granting full access to a server.

👉🏼 Prepend the key in `authorized_keys` file with `command=""` (e.g.: `command="pm2 restart" ssh-rsa AAAAB3N...`).

Read tip

Simple Editor for Cron Schedule Expressions

💡 Tripping over the crontab syntax?

☝🏼 Not anymore with the help of https://crontab.guru/. This handy tool gives you human readable definition of any cron schedule.

Read tip

What Does This Bash Command Do?

💡 Don't know what a bash command does?

🤔 "What are all those flags for?"

☝🏼 Paste it at https://explainshell.com/ and find out!

Frontpage of explainshell.com breaking down an example command and explaining what each flag does. Read tip

Bash Scripting Cheatsheet

💡 Do you often find yourself looking up syntax when you have to write a bash script?

This comprehensive cheatsheet for bash language has most things you'd need. 🌟

https://devhints.io/bash

Read tip

Secure Your VPS: Setup Firewall

💡 Using a firewall to block incoming traffic on non-public ports is an essential part to securing a VPS:

➡️ ufw default deny incoming
➡️ ufw allow ssh
➡️ ufw allow http
➡️ ufw allow https
➡️ ufw enable

Setting up a firewall with ufw in Ubuntu by blocking all incoming traffic except SSH, HTTP & HTTPS. Read tip

Secure Your VPS: Enable Automatic Updates

💡 With the `unattended-upgrades` package you can enable automatic #security updates for your #VPS.

➡️ sudo dpkg-reconfigure --priority=low unattended-upgrades

Read tip

Find DigitalOcean Region With Lowest Ping

🔥 Get a sorted list of ping times between your location and all @digitalocean regions.

Average ping times of Digital Ocean regions sorted by fastest first. Read tip

Explore Layers in a Docker Image

If you're debugging #Docker images and Dockerfiles, you can't miss this tool by @alexgoodman87. 🌟

You can browse images layer by layer and see which files are added at what size cost. 💡

Despite the VIM-like appearance 🙅🏻‍♀️, it's easy to use. 👌🏼

https://github.com/wagoodman/dive

Read tip