Skip to main content

Posts

Showing posts from 2023

Why is the cloud so expensive?

  The cloud is something most businesses have started to embrace, often with initial goals of simplifying operations or reducing costs. After all, the great promise of the cloud is to only pay for what you use, and being able to scale resources up and down as needed. No longer do you need to plan months in advance with hardware purchases to support future growth, now you can press a button and scale your loads as needed. So why is it that so many people have started to ask why their cloud bills have become so high? Here we'll see some of the reasons behind it and what you can do about it. While most cloud platforms like AWS and Azure can provide very cheap services, part of the issue is that they offer so many services, doing so many useful things. This can be both good and bad, because while you have access to so much capabilities, you must also keep track of the cost. As an example of how a simple workload can drive costs up in unexpected ways, let's take a look at a simple u

Monitoring ships using AIS and a Raspberry Pi

  Do you live near an active water way? Have you ever wondered what kind of ships are off in the distance? You could find out using a standard called AIS, or Automatic Identification System. It's a worldwide radio system used by larger ships to broadcast their name, position, speed and more. These messages can be decoded using simple Python code and is a cool weekend project if you have some extra CPU resources. To do this project, you will need a Software Defined Radio or SDR. The easiest way to get this is to buy a cheap RTL-SDR device on Amazon and plug it into a Raspberry Pi. Once you have those two pieces of hardware, simply connect the SDR into one of the USB ports and place the included antenna near a window with a good view of the harbor. The first step to actual capture these packets is to download a package called RTL_AIS. You can follow these steps: apt-get install rtl-sdr apt-get install librtlsdr-dev git clone https://github.com/dgiardini/rtl-ais cd rtl-ais make Once y

Character encoding issues in MySQL

Modern databases are ubiquitous, they're used everywhere by applications and scripts, many of which you may have to interact with if you're working in the IT world. Creating a new database and table, then storing data that you can then retrieve later on, seems like a fairly straightforward process. But databases have a lot of settings, and there's a reason corporations hire well trained DBAs to maintain these databases. There are pitfalls you may need to watch for, one of the more common ones being character encoding issues. If you use MySQL or MariaDB as a database, and if you ever ran into the following error, then this may be the post you've been waiting for: Incorrect string value: '\xF0\x9F\x98\xF0' for column 'title' at row 1 What this basically says is that the data you're trying to store in the database doesn't fit with the encoding available. The data may be some type of binary, or maybe just text in another language that requires more l