Apple Contact & Calendar Server - dockerised
Programming · UNIXI've been using Radicale as a contacts / calendar server (CardDAV / DalDAV) for some time now, and it worked flawlessly across macOS and Windows Phone for contacts and calendars. However, I recently got an iPhone and synchronising calendars from Radicale just crashed the iPhone calendar app. It worked fine some of the time, but most times it just crashed, which is not great. Therefore, I went on the search for a better self-hosted calendaring server.
Simulating bad network conditions on Linux
UNIXSometimes, your network is just too good. Today I ran into this issue as I was testing an application running off a VM in the local network. Latency and bandwidth were excellent, as you'd expect, but nowhere near the conditions you'd encounter over the internet. Testing in these conditions is unrealistic and can lead to underestimating issues your users will experience with your app once it's deployed. So let's change that and add artificial latency, bandwidth limitations, and even drop a few packets, using tc.
A gentle introduction to GNU screen
UNIX linux · screenYou probably heard of GNU screen. It's handy, ubiquitous, and dead simple. Here's how to use it! Open a terminal and type: screen You're welcomed by an introduction message, press enter, and… You're in a shell. Uh? Screen is simple screen is a terminal manager, so it's logical that the first thing you see when you start it is a terminal. This terminal is as vanilla as the terminal we started from.
Set up a mail server on Amazon EC2
UNIXThis post will explain how to set up a Postfix mail server on an EC2 instance. First, a word of warning: Amazon IPs generally aren't highly considered, spam-wise. Meaning that even if you take all the precautionary steps, your emails might end up in spam folders. If email is business-critical for you, you might want to consider other options: host your mail server somewhere else? Use something like SendGrid? This said, let's dive in!
A bit of Terminal-fu
OS X · UNIX bash · OS X · TerminalYesterday, my little brother was typing something on a linux bash and suddenly went back to the beginning of the line with a simple Ctrl-a. It blew my mind. I don't know why, but it never occurred to me to look for shortcuts in Terminal (and bash in general), other than Ctrl-c for badly behaving processes. I just cursed myself and frantically typed on the left arrow key each time I typed cd instead of cp.
Get database size in phpMyAdmin
UNIX minitip · phpmyadmin · sqlIt looks like phpMyAdmin doesn't include a way to see how much space takes the MySQL database. I found that a bit weird, but hey, if phpMyAdmin doesn't do it, let's cut to the chase and go SQL! The most straightforward way to get your database size from phpMyAdmin is the following SQL query: SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.
SSH without a password: using public keys
UNIXIf you're often logging remotely into UNIX-like machines using SSH, you may grow tired of having to type and retype your password each and every time. And even more so if you're running rsync, or any other service, over SSH. To make our life easier, we can establish a secured SSH connection between computers using public/private keys generated with OpenSSH. In this example, I'll say I want to connect to my server from my laptop.