Blog Index

Running Virtual Machines on Linux

Virtual machines are useful for running other operating systems within your computer and for testing and sandboxing system-level software. This post is about running VMs locally on Linux: how to get a usable disk image and how to connect to it over SSH. It's not as trivial as it sounds.

The VM ecosystem has evolved over the last decades. QEMU/KVM is still the easiest way to get started on Linux, but many of the ecosystem's projects are designed for running cloud services rather than for desktop or casual server use. This post aims to provide simple instructions for running VMs without installing large software stacks. It covers running VMs with and without cloud-init and libvirt.

Continue reading full article

Website Updates (2024)

I did a bunch of more updates to this website, including adding a dark mode. Most of the other changes are either invisible or barely noticeable. That's OK. My several visitors will appreciate them. Or at least I'll appreciate them.

Continue reading full article

Command Not Found

On Debian/Ubuntu, command-not-found tells you what package to install when you try to run a program you don't have. I find this helpful, but it takes a long time to maintain its index for lookups. This post tells the meandering story of how I first optimized command-not-found, then replaced it with a script that doesn't use an index at all.

Continue reading full article

Website Updates (2020)

The code for this website has been running without any major updates since 2009. Back then, I wrote it as a Python 2 program using FastCGI, served originally by lighttpd and more recently by Caddy.

Continue reading full article

LogCabin 1.1

| raft logcabin

Announcing the release of LogCabin 1.1! This is the second stable release of the LogCabin coordination service, which includes a C++ implementation of the Raft consensus algorithm.

Continue reading full article

LogCabin 1.0

| raft logcabin

LogCabin 1.0 is out! This is the first stable release of the LogCabin coordination service, which includes a C++ implementation of the Raft consensus algorithm. If you're new to these, I recently spoke about Raft and a little about LogCabin at the Sourcegraph Hacker Meetup in San Francisco; watch the video for a visual walk-through of how Raft works.

Continue reading full article

LogCabin.appendEntry(6, "Preparing for 1.0")

| raft logcabin

This is the sixth in a series of blog posts detailing the ongoing development of LogCabin. This entry describes progress towards the upcoming 1.0.0 release of LogCabin, a useful new command-line client to access LogCabin, and several other improvements.

Continue reading full article

LevelDB with Transactions on Node.js

This post surveys the libraries available in Node.js for LevelDB, shows that support for transactions is missing, and lays out a path to get there. In short, we need the Node bindings for LevelDB to expose snapshots, then we can build transactions with snapshot isolation on top without much trouble.

Continue reading full article

LogCabin.appendEntry(5, "Cluster Clock, etc")

| raft logcabin

This is the fifth in a series of blog posts detailing the ongoing development of LogCabin. This entry describes a new cluster-wide monotonic clock used for client session expiry, a new tool to dump out the contents of a LogCabin server's log and snapshot, a couple of performance improvements, and several changes around how server IDs and addresses are assigned and used.

Continue reading full article

LogCabin.appendEntry(4, "SegmentedLog")

| raft logcabin

This is the fourth in a series of blog posts detailing the ongoing development of LogCabin. This entry describes LogCabin's new storage module and several other recent improvements.

Continue reading full article

Stanford.edu Email Account Deleted

| low-tech

Now that I've graduated, Stanford has deleted my university email account, ongaro@stanford.edu. If you tried to send to that address and received an autoreply, please resend your email to the same username at cs.stanford.edu instead, which should remain valid for life. (Yes, I had a very similar post for my Rice email account a few years ago.)

LogCabin.appendEntry(3, "Server Stats")

| raft logcabin

This is the third in a series of blog posts detailing the ongoing development of LogCabin. This entry describes a new tool to extract information from LogCabin servers and a tricky bug that occurred when unregistering handlers from the event loop.

Continue reading full article

LogCabin.appendEntry(2, "Timeouts")

| raft logcabin

This is the second in a series of blog posts detailing the ongoing development of LogCabin. This entry describes the battle of adding timeouts to the client library API. Timeouts are useful for implementing leases in client applications. For example, a client might want to assert its lease but give up after few seconds, and in case of a timeout, it might need to crash or stop other processes from doing things that may no longer be safe.

Continue reading full article

LogCabin.appendEntry(1, "Hello, world!")

| raft logcabin

This is the first in a series of blog posts detailing the ongoing development of LogCabin. This first entry catches up on the developments from when I started working with Scale Computing in November, so it's longer than most of the future updates will be.

The theme of this entry is getting started in a new environment. Up until now, I'd done nearly all of the development of LogCabin on my laptop and on the RAMCloud cluster. Running it somewhere new uncovered a bunch of implicit assumptions baked-in about the environment, so it exposed a new set of issues and bugs. This is fairly inevitable when it comes to low-level systems code, and there's a lot of value in working through it. LogCabin is significantly easier to run now than it was before, and it should be easier for the rest of you to install on your systems, too.

Continue reading full article

Grad School

| raft logcabin

Ousterhout placing academic hood on Ongaro

Well, I spent the last five years getting my Ph.D. in Stanford's Computer Science department. I won't do that justice here, but I'll fill in the story briefly so that subsequent posts make sense. I was part of Professor John Ousterhout's group, which is primarily focused on RAMCloud, a large-scale in-memory distributed storage system.

Continue reading full article

Tips for Running PowerPoint in CrossOver Office

I use Linux exclusively but run Microsoft PowerPoint for some presentations. I won't go into the details of why here, but I wanted to record and share a few tips I use for getting it to run well. Your mileage may vary, obviously.

Continue reading full article

Manual Window Placement in i3 (Part 2)

This is the second part of a series on making the i3 window manager work the way I want. I left off last time with the goal of changing the way windows are placed as they are created, and I had a couple of pointers from the i3 hacking howto for where to start looking. This post covers how I've set up my test environment.

Continue reading full article

Manual Window Placement in i3 (Part 1)

I've been using tiling window managers for the past couple of years. I started with awesome, then Notion (a fork of Ion; Ion is no longer maintained), and now I'm in the process of moving to i3. For those of you that aren't familiar with it, the screenshots all look the same. They all behave differently, though, and I guess you just have to find one that fits your mental model.

When you open a new window in most tiling window managers, your existing windows get rearranged or resized to make room for it. This is kind of one main idea, actually, and it works reasonably well when opening your second or third window. Beyond two or three, depending on the screen size and applications, it starts to suck.

Continue reading full article

Is It Worth the Time?

| low-tech

Today's XKCD starts to answer: how much time should I spend making a routine task faster?

XKCD 1205: Is It Worth the Time?

Continue reading full article

Bullets in Inkscape

Inkscape is a good open-source drawing program for vector graphics. I'm currently using it to make a research poster, but unfortunately, Inkscape doesn't do bullets. This post discusses your options if you want to use bullets in your Inkscape drawing and introduces a simple Inkscape extension that makes this much easier.

Continue reading full article

Color GDB Prompt

To add color to your GDB prompt, place the following in your ~/.gdbinit file:

set prompt \033[0;33m(gdb)\033[0m\040

This makes it easier to find your place visually.

Leveraging Web Technologies for Local Programs

Client-side web programming (HTML, JavaScript, CSS) has improved greatly in recent years. Meanwhile, node.js has become a reasonable platform for server-side JavaScript that interacts with the outside world. This environment already makes sense for building local applications. The node-webkit project takes this one step forward: it integrates the node.js libraries into a Webkit environment.

Continue reading full article

SQLite Database in Git

I store nearly all files of even moderate importance in Git (including this blog post). These are usually plain-text files, but sometimes it's necessary to put binary files under version control. Unfortunately, those are typically difficult to diff and merge, but I recently discovered some features of Git that make this less painful. This blog post focuses on SQLite database files, but at least some of it applies to other binary file types.

Continue reading full article

rlwrap: readline Wrapper Program

Dealing with a basic command-line prompt in a loop can be painful, so many programs, such as shells, interactive programming languages and debuggers, provide a more featureful prompt. For example, pressing the up and down arrows in a good prompt will flip through previously entered input lines. Programs will often make use of the GNU readline library for this functionality.

If you need to use a program that only has a basic prompt, you may be able to wrap it with the program rlwrap to get some more advanced features. From the man page:

rlwrap runs the specified command, intercepting user input in order to provide readline's line editing, persistent history and completion.

[...]

There are many options to add (programmable) completion, handle multi-line input, colour and re-write prompts. If you don't need them (and you probably don't), you can skip the rest of this manpage.

For example, I recently used rlwrap with jdb, the Java debugger, and Ikarus, a Scheme compiler.

The Cost of Exceptions in C++

Most people seem to have an opinion as to whether exceptions in C++ are slow or fast, but very few people have put any useful numbers out there. Here's a lower bound.

Continue reading full article

Book Log

| low-tech

In addition to my movie log, I've now started a book log going back to last summer.

Continue reading full article

Rice.edu Email Account Deleted

| low-tech

Rice has deleted my undergraduate email account, diego.ongaro@rice.edu, since I am no longer a student there. If you tried to send to that address and received a bounce notification, please resend your email to the same username at alumni.rice.edu instead.

Twin Peaks iPhone Panorama

I went up to Twin Peaks in San Francisco with Jay a few weeks ago. It was a nice view but kind of a worst-case scenario for a photo: my iPhone camera (VGA), poor lighting as the sun was setting, and stong winds.

That day I took a bunch of overlapping shots with my phone. Then I used the GIMP's automatic white balance correction on each of them. Next I stitched them together with Hugin, and finally I edited the stitched image with the GIMP. The following mediocre image is the result (click for the full 1534x652 image):

panorama

Continue reading full article

Xfce Stopwatch Plugin

| xfce

I needed an excuse to try Mike's Vala bindings for Xfce, so I created a new little plugin for the panel, the xfce4-stopwatch-plugin.

In the original release announcement on July 28th, I wrote:

This is the first release of the stopwatch panel plugin, which you can use to time yourself on different tasks. It's stable and usable, but quite minimal still.

The functionality is best summarized with this image from the web site:

screenshots

Continue reading full article

Lighttpd Fails to Bind to Localhost

lighttpd logo

I installed the web server lighttpd on my laptop to test some configuration settings. As I didn't want to expose the server on the network, I uncommented server.bind = "localhost" from /etc/lighttpd/lighttpd.conf.

Then, restarting lighttpd failed with the following error:

(network.c.201)getaddrinfo failed:  Name or service not known ' localhost '

Continue reading full article

Chef Roger's Knife List

| low-tech

chef's knife

Last semester at Rice, I took the class Cooking with Chef Roger. The man is passionate about his knives, and he gave us a list of brands he recommends. From one of the few scraps of notes that survived, here is Chef Roger Elkhouri's list of quality brands for chef's knives (French knives).

Continue reading full article

Cgit Hacking

cgit logo

Last week I hacked a couple new features into cgit, a web interface for Git, since it's the one I [previously used] on ongardie.net. I added https:// URLs for the Atom feed and also syntax highlighting when viewing files.

Continue reading full article

Tabs in Vim

Vim logo

Version 7 of Vim introduced tabs to the editor, and these are a few of my tab-related tips.

Continue reading full article

Overlooked Python Built-Ins

Python logo

So, I just realized that I re-implemented two built-in Python functions on a small project I'm working on for ETSZONE. I just didn't know that these existed, so I'm writing about them here in case you've overlooked them too.

Continue reading full article

Extract Unique Lines From a File

How to get rid of duplicate lines from a file or pipe.

Continue reading full article

Off-Brand Q-tips

| low-tech

To start off this blog, I'm writing about things you stick in your ear. I suspect I'll end up writing about techier subjects soon enough. Nevertheless, it's probably worthwhile to attempt to set a precedent of, at least occasionally, writing about something low-tech.

Continue reading full article