How to know if Ubuntu needs rebooted

How to know if Ubuntu needs rebooted

I like to keep my servers up to date with the latest security patches, but I hate rebooting them unless I have to. So after doing apt-get update and apt-get upgrade, how do you know if your server should be rebooted? The solution is the /var/run/reboot-required file. If the file is there, a reboot is required. If it isn’t, then you don’t need to reboot. Pretty simple. You can do some...

Read More

Why does CTRL+S freeze your PuTTY screen?

Why does CTRL+S freeze your PuTTY screen?

tl;dr – If you hit CTRL+S in PuTTY, your screen will freeze. Anything you type will still be sent to the server. Press CTRL+Q to unfreeze your screen. Imagine you are an old laser printer. You have something like 128 KB of memory. You print a max of 8 pages per minute. Someone decides to print the man page for gcc. You are doing the best you can, cranking out pages and pages of obscure...

Read More

Debugging bash scripts

Debugging bash scripts

I use a lot of bash scripts to automate my server tasks. They are quick and easy to write, and work across multiple distributions with little to no modification. Debugging bash scripts is easy. If your bash script is named awesome_script, then you would do something like this: bash -x awesome_script In addition to running the script, it will output every command the script runs along with the...

Read More

Cloud servers, VPS servers, Ubuntu, and nginx

Cloud servers, VPS servers, Ubuntu, and nginx

I’ve always used bare metal servers running Apache HTTP on CentOS. I’ve always run nearly my entire business off of a single server. Every couple years I’ll order a new one, move everything over, and call it a day. But the world is changing. Bare metal prices are going up while cloud and VPS server prices are going down. Ubuntu has surpassed CentOS for market share. nginx is...

Read More

Use QR codes to save paper backups of your private keys

Use QR codes to save paper backups of your private keys

I love QR codes. They make it incredibly easy to get chunks of text from paper to computer (or phone or whatever). One of the ways I like to use them is to store offline, paper backups of my server private keys. A private key can be thousands of case-sensitive characters long. Nobody wants to type that in by hand. By creating a QR code, I can print it off and store it in my safe in case I need...

Read More

Enabling mouse support in Vim

Enabling mouse support in Vim

If you’ve ever logged into a server using an ssh client (like PuTTY), then you’ve probably used Vim. This infinitely customizable text editor typically runs within a keyboard-only shell, and thus only lets you use the keyboard (unless you are running something like gVim). You use the arrow keys to move the cursor around and a slew of keyboard shortcuts to insert, move, delete, or...

Read More