Building a Secure DigtialOcean Droplet (Ubuntu)

Keep the bad guys out of your server

There are bad guys out to get you. Well, maybe they’re not targeting you specifically. Actually, they’re targeting every device with a public IP.

When you first spin up a droplet in DigitalOcean, the default configuration is to log in as root. Furthermore, there is no firewall configured. This default configuration leaves you vulnerable to bots that will scan and attempt to break into your server. With the below video, and the rest of this blog post, I’ll show you some basic steps you can take to secure your server.

Since this guide will be using DigitalOcean, you’ll need to sign up for an account with them. Ask your friends for a referral code and you’ll get some nice credit, or click this link to use my referral. Note: I get a small credit when you use my referral code.

[Read More]

Prometheus Exporter for CyberPower UPS

How to use strace for profit and winning

I’ve used a CyberPower UPS for quite a while to keep my important gear at home running in case of power disruptions. It’s been a great little unit, and hasn’t failed me yet.

Being consumer level equipment, it doesn’t support any of the useful protocols like SNMP for metrics gathering. Instead, you can connect it via USB to a computer and use their CLI utility to get some basic statistics.

I wanted this data in Prometheus so I can make some Grafana dashboards. To accomplish it, I wrote an exporter in Python. You can find the code here:

Read below for more about how I wrote this.

[Read More]

Finding the Closest AWS Region

A script to ping EC2 endpoints

Ever wonder which AWS region is right for you? There’s a lot to consider. You need to think about everything from:

  • Costs of services in the region
  • Availability of services in the region
  • Latency between the region and your customers

The first two bullets are easy to evaluate. Some services are not in every region, so you should make sure the services you need are in a region before you spin up resources. Some regions are more expensive, for example, us-west-1 is more expensive than any other region in the US.

If you find yourself having to choose between multiple regions because of cost and service parity, I wrote a script that should help with that.

[Read More]
aws  script