I’ve been working with tar files a lot lately and I haven’t been able to find a good example of what a tar file looks like, byte-by-byte. The specification is the best reference I’ve found for how tar files are structured, but it isn’t exactly friendly. Here’s an interactive breakdown of what tar files lookContinue reading “Innards of Tar”
Category Archives: Linux
The Basics of Signal Handling
Signals are one of the most basic ways programs can receive messages from the outside world. I’ve found limited tutorial-type documentation on them, so this post covers how to set them up and some debugging techniques. The easiest way to get a feel for signal handling is to play with a simple C program, likeContinue reading “The Basics of Signal Handling”
––thursday #6: using git over ssh
Got a secret project on machine A and too cheap to get a Github private repo? Clone it directly on machine B with: $ git clone ssh://user@A/absolute/path/to/repo/ Replace “user” with your username on A, “A” with the actual hostname of A, and “/absolute/path/to/repo/” with the absolute path to the git repository.
––thursday #5: diagnosing high readahead
Having readahead set too high can slow your database to a crawl. This post discusses why that is and how you can diagnose it. The #1 sign that readahead is too high is that MongoDB isn’t using as much RAM as it should be. If you’re running Mongo Monitoring Service (MMS), take a look atContinue reading “––thursday #5: diagnosing high readahead”
––thursday #4: blockdev
Disk IO is slow. You just won’t believe how vastly, hugely, mind-bogglingly slow it is. I mean, you may think your network is slow, but that’s just peanuts to disk IO. The image below helps visualize how slow (post continues below). (Originally found on Hacker News and inspired by Gustavo Duarte’s blog.) The kernel knowsContinue reading “––thursday #4: blockdev”
––thursday #2: diff ‘n patch
I’m trying something new: every Thursday I’ll do a short post on how to do something with the command line. I always seem to either create or apply patches in the wrong direction. It’s like stalagmites vs. stalactites, which I struggled with until I heard the nemonic: “Stalagmites might hang from the ceiling… but theyContinue reading “––thursday #2: diff ‘n patch”
––thursday #1: screen
I’m trying something new: every Thursday I’ll go over how to do something with the command line. Let me know what you think. If you are using a modern-ish browser, you probably use tabs to keep multiple things open at once: your email, your calendar, whatever you’re actually doing, etc. You can do the sameContinue reading “––thursday #1: screen”
Playing with Virtual Memory
When you run a process, it needs some memory to store things: its heap, its stack, and any libraries it’s using. Linux provides and cleans up memory for your process like an extremely conscientious butler. You can (and generally should) just let Linux do its thing, but it’s a good idea to understand the basicsContinue reading “Playing with Virtual Memory”
Installing Linux on a MacBook Air
It’s not a clean victory, but I got Linux onto my MacBook Air. When I first got my Air, I launched the Ubuntu install disk and followed the instructions on the Ubuntu wiki. Unfortunately, these instructions are apparently for the MacBook Air 1,1, and I had a MacBook Air 2,1. The Linux kernel froze inContinue reading “Installing Linux on a MacBook Air”