Weekends

| Comments

Recently, I’ve been slacking with off-hours hobby development. Instead, I’ve been focusing on family and developing other life skills.

With faces like these, how could you choose to sit in front of a computer and write software. It’s an excuse, but a damn good one. For reference, that’s Sarah (the little one), Liz (the smiling one), and Dylan (the furry one).

We recently took a trip to Saint Martin and had some delicious crabcakes. I decided to try my hand at making them once we got home.

The same rationale applies to these buckwheat crepes.

I finally started reading the Serious Eats blog. It might have been a mistake, as I’d prefer to do this all day. These are Ricotta Gnocchi

Today, I decided to try the Turchetta. It turned out wonderfully and helped Sarah feel better after spending the weekend sick.

So it may not be as interesting as building distributed systems, but this is an amazing way to spend a weekend.

The Shell, the Whole Shell, and Nothing but the Shell

| Comments

A recent turn of events left me debugging an environment with a shell and little to nothing else. There were some log files in memory on a server that had somehow gotten into a state where it appeared to have no binaries. Essentially, the network continued to work, but the only access we had to the server was via and already open login shell on the serial console. Lucky for us it happened to be bash

How well do you know your shell builtins? Knowing what was built in in this situation was the difference between losing the state of the machine by rebooting into a live environment and being able to investigate without destroying that state.

If you find yourself in a similar situation, here are some helpful hints.

Objectifying C: The Container_of Macro

| Comments

C itself is a fairly straightforward language. There are no objects or templates, and FactoryFactories are probably considered forbidden in most shops. However, there are plently of ways to write object oriented code in C. Obviously, the language itself has its corner cases and we need to avoid trying to implement anything that relies on undefined behavior.

Nothing I’ll cover here is new or particularly interesting for veterans of the craft, but I felt it was a worthwhile exercise to write and benchmark.

I decided I’d like to implement a taggable counter. That is, essentially

1
2
3
4
struct taggable_counter {
    char * tag;
    uint64_t counter;
}

I need it to be both performant, since it’s a counter, and safe-ish, because I’d rather have safe strings at one point in the code than spread all throughout. I’d also like to be able to extend the library to support multiple tags in the future without changing the client code extensively.

While this example may seem a bit contrived, it should be obvious that the basic concept of an object with public and private fields is quite nice to have.

Distributed Storage on the Premises

| Comments

The holy grail of storage is a system that is cheap, reliable, and resilient. Over the past decade, we’ve gone from large enterprise SANs based storage systems to much more reasonable storage systems built on the normal principles of distributed systems.

Essentially, we take a consistency model and mix it with a block storage system. Take a consensus algorithm, mix it with reliable local storage. Add a fairly reliable network and you’ve managed to build a delectable storage system.

If you’d like a fairly simple introduction to practical distributed systems, I’d suggest reading Distributed systems for fun and profit.

It’s likely that you can find an open source distributed storage system to meet your needs, whether they be private or cloud based and whether you need to store documents, rows, or blocks. I imposed a slightly unrealistic set of criteria on myself and ended up with a solution that meets my needs.

Focus

| Comments

I intend this to be both introductory for you, and introspective for me.

How do you manage to get things done? My guess is that you have some measure of focus. Perhaps they don’t get done. Maybe you get distracted.

I always get distracted

Distraction comes from all sides. In my case, the most common distraction is the desire to learn something. Most responses to this problem are along the lines of That’s great! You should be learning all the time! However, there’s a limit.

I think I’ve always wanted to do too many things. For instance, I’ve been trying to…