Let’s say we want to store some data on multiple drives, so that we can recover from drive failures.
One obvious (and valid!) first attempt is to just store everything
multiple times – usually called “mirroring”. The most common form of
mirroring is to store things twice: if one drive fails, the data is
still in the
other.1
Reed-Solomon
coding
gives us much more flexibility, allowing us to store our data over
n=k+t drives, so that anyt drives can fail while still not
losing
data.2
I find that the need to create responsive table layouts pops up
far more often than most developers would expect. The gut reaction
might to be implement some sort of custom grid-system or pull in a
pre-built library. Don’t do this - just use tables and some simple
CSS.
Google has literally hundreds of APIs, including ones for Gmail,
Drive, Maps, Translation, Analytics and more. All of these share the
same concepts like authorization, pagination or media
uploads/downloads. In this article we will explore all of these
concepts and also get our hands dirty with some of the
above-mentioned APIs to learn about all the cool things you can do
with any and all of Google's APIs.
I was recently browsing through an old archive of holiday photos
(from
dired
of course). I wanted to know where the photo was taken, which got me
interested in extracting Exif
metadata.
Luckily the exiftool command line utility
does the heavy lifting when it comes to extracting metadata. Since I
want it quickly accessible from Emacs (in either dired or current
buffer), a tiny elisp snippet would give me just that (via
dwim-shell-command).
Since I only run Windows occasionally (mainly for MS-Office or
MATLAB) and all of my machines either run NetBSD, Slackware or
Tribblix, it makes sense for me to opt for NFS as a distributed file
system protocol to share files from my server over the local
network.
Today we're back with a new problem walkthrough, this time from Day
16 of last year's Advent of
Code. In some sense, the parsing section for this problem is very
easy - there's not much data to read from the file. In another
sense, it's actually rather hard! This problem is about parsing a
binary format, similar in some sense to how network packets
work. It's a good exercise in handling a few different kinds of
recursive cases.
After a remote diamond mine collapses in far northern Canada, a
'big-rig' ice road driver must lead an impossible rescue mission
over a frozen lake to save the trapped miners.
In the evening we watched The Ice
Road.
I liked the movie and give it a 7 out of 10.
If you're tired of reaching for your smartphone authenticator or key
fob to type in a TOTP, or Time-Based One-Time Password, then why not
use Emacs to generate them for you instead? Combine it with auth
sources and GPG, and you can securely encrypt the master keys at the
same time.
In CSS, we’ve been encoding colors with rgb() or hex (mostly for
historical reasons). However, the new CSS Color
4 specification adds many
better ways of declaring colors in CSS. Of these, oklch() is the
most interesting one—this article explains why.
When I first started going to Postgres conferences and listening to
talks by Postgres core developers I suddenly found myself at
sea. What were these strange words and phrases they were using?
It turns out that a lot of them are taken from the Postgres code
base, which in turn naturally uses them because they are part of
Codd's relational
model,
the theoretical information architecture that underpins all
relational databases.
Tyler Rake, a fearless black market mercenary, embarks on the most
deadly extraction of his career when he's enlisted to rescue the
kidnapped son of an imprisoned international crime lord.
In the evening Alice, Esme, and I watched
Extraction. For the first
halve I liked the movie a lot but it soon became very
repetetive. Still, I give it a 7 out of 10.
If you use the same computer in different contexts, let’s say for
work and for your private life, you may wish to install two
different operating systems to protect your private life data from
mistakes or hacks from your work. For instance a cryptolocker you
got from a compromised work email won’t lock out your family photos.
But then you have two different operating systems to manage, and you
may consider that it’s not worth the effort and simply use the same
operating system for your private life and for work, at the cost of
the security you desired.
I offer you a third alternative, a single NixOS managing two
securely separated contexts. You choose your context at boot time,
and you can configure both context from either of them.
Pushing calculation down to a faster implementation is just one way
to speed up software. Another way to get faster results is to remove
code that is redundant, repetitive, superfluous, needless, or
otherwise does unnecessary work. The fastest software, after all, is
software that doesn’t run at all.
In short, sometimes all you need is some good old-fashioned speed
optimization.
The OpenBSD packet filter (PF) was
introduced a little more than 20 years ago as part of OpenBSD
3.0. In a series of two posts, I
invite you to take a short tour of PF features and tools that I have
enjoyed using.
Six individuals from all around the globe, each the very best at
what they do, have been chosen not only for their skill, but for a
unique desire to delete their pasts to change the future.
In the evening I watched 6
Underground. I liked the
movie, especially the parkour parts. I give it a 7 out of 10.
“You might not need Kubernetes; you’re not Google” – I hear that
quite often. And while it is true that the full power of Kubernetes
is not needed for smaller-scale web projects, it can come in quite
handy.
In this article, I will showcase the benefits of using Kubernetes
for smaller projects, and we will set up a Managed Cluster on the
Digital Ocean platform.
There is a common view out there that the QUIC transport protocol
(RFC 9000) is just another refinement to the original TCP transport
protocol
[1]
[2]. I
find it hard to agree with this sentiment, and for me QUIC
represents a significant shift in the set of transport capabilities
available to applications in terms of communication privacy, session
control integrity and flexibility. QUIC embodies a different
communications model that makes intrinsically useful to many more
forms of application behaviours. Oh, yes. It’s also faster than TCP!
In my opinion It’s likely that over time QUIC will replace TCP in
the public Internet. So, for me QUIC is a lot more than just a few
tweaks to TCP. Here we will describe both TCP and QUIC and look at
the changes that QUIC has bought to the transport table.
SSH is yet another
example
of an ancient technology that is still in wide use today. It may
very well be that learning a couple of SSH tricks is more profitable
in the long run than mastering a dozen Cloud Native tools destined
to become deprecated next quarter.
One of my favorite parts of this technology is SSH Tunnels. With
nothing but standard tools and often using just a single command,
you can achieve the following:
Access internal VPC endpoints through a public-facing EC2 instance.
Open a port from the localhost of a development VM in the host's browser.
Expose any local server from a home/private network to the outside world.
Haskell is one of my favorite programming languages, and one of the
reasons I like it so much is how nicely it supports modeling
string-like data with newtypes when doing web programming. Much of
web development involves dealing with strings (idk why exactly but I
imagine mostly because JavaScript and the fact that most web
communication protocols use strings as primitives), but not all
strings are created equal! Strings can be emails, or addresses, or
routing numbers, or can be a range of possible enums, and just using
type String to capture all of the variance is a poor data model:
it doesn’t have the granularity needed to distinguish between
different use cases.
This is where using newtypes
can help. Using newtypes (and their associated smart
constructors) to model
string-like data is a nice approach for adding granularity to
strings to help differentiate string-like types from each
other. Furthermore, the enhanced data modeling provided by newtypes
can be extended (via aeson) all the way to JSON parsing, which makes
it possible to write a JSON API client in Haskell that provides a
type-safe parsing experience with ergonomic errors and a high degree
of confidence with respect to data validation. It’s even easy to
write tests! To explain more about what I mean, let’s dive into an
example of some data modeling I’m doing for an upcoming project that
takes advantage of newtypes smart constructors, and custom JSON
parsing with aeson.
When I first heard the faster CPython
initiative, I was
intrigued to find out, how does it translate to small application
performance across various versions since a lot of critical
components are already in C like Postgresql driver. The faster
CPython presentation clear states, the performance boost is only
guaranteed for pure python code and not C-extensions.
In this post, I’ll share my benchmark results on a couple of hand
picked snippets. There is a PyPI package data, do some
transformation or do some network operations or file operations. How
does that perform against different Python versions.
Testing code is the first step to making it secure. One of the best
ways to do this is to use unit tests, ensuring that each of the
smaller functions within an app behave as they should — especially
when the app receives edge-case or invalid inputs, or inputs that
are potentially harmful.
Estimation is a loaded topic in software development. It is where
many anti-patterns in a company come together. Developers often
suffer from the mechanics that come to play with estimation.
I work with Golang every day as a developer on the OpenZiti
project. In learning Go, I've hit various
stumbling blocks, settled on some best practices and hopefully
gotten better at writing Go code. This series exists to share some
of the 'Aha!' moments I've had overcoming obstacles and finding
solutions that sparked joy.
GNU Emacs / N Λ N O is a set of configuration files for GNU
Emacs such as to provide a nice and consistent look and feel as
shown below. It is based on design principles I described in the
article "On the design of text
Editors" that is available on
arXiv. The light theme is based on Material
colors and the dark theme is based on Nord
colors.
Extensions are executable code bundles, in one app that perform
functions in a second, host app. Host apps declare extension
points that control the kinds of functionality its extensions can
implement. Extensions allow iOS and Mac apps to include code that
runs inside system apps. For example,
Messages
provides extension points so apps can create iMessage
Apps. Messages
automatically finds extension bundles that target its extension
points and makes them available in its app drawer. A Mac app can
also declare its own extension points so that other apps can extend
the Mac app’s functionality.