Home

How to generate a MongoDB ObjectId from a date in Bash

A little known fact about MongoDB object IDs is that they encode the documents creation date. This means that you don’t have to create an index on a dedicated date field, because the _id field is automatically indexed. Let’s generate an ObjectId with nothing else than a command line, sprinkled with some black magic: # 1. get the date 3 months a...

Read more

Casually removing root files

You’re walking at $HOME, minding your own business. $ whoami > user $ pwd > /home/user But something is bothering your feet. It’s like if a little rock has fallen into your shoe. You take it off, to see what’s going on. $ ls -lah ./left-shoe ---------- 1 root root 4 May 30 13:20 little-rock That’s odd. It’s there, but it doesn’t see...

Read more

Portable build environments with Docker

Chances are, when you want to compile something from source, you will need to install an exotic dependency or two on your box beforehand. Do this enough times, and your screams won’t be able to penetrate the software bloat you built around yourself. Docker’s great isolation and flexibilty proved to be a great asset for building custom build env...

Read more

How to create custom Unity shortcuts

Application shortcuts can be added to Unity by creating special .desktop files in /usr/share/applications/. These shortcut definitions appear in the Dash from where they can be dragged to the Unity launcher. Creating a simple shortcut These files follow a simple syntax: they consist of groups and key-value pairs. Groups are used to define addi...

Read more

Fixing IOMMU issues on Ubuntu 14.04 Trusty

Installation of Ubuntu 14.04 (or any other distro really) on a configuration with an AMD 970 + SB950 chipset is not as straightforward as you may think. In my particular case, the motherboard is a Gigabyte GA-970A-DS3. I will describe some workarounds I’ve found, while trying to make the penguins happy. Tieing the shoolaces The first issue ar...

Read more