Featured Image

More Networking Tricks

I consider the residential gateway overloaded. Your ISP is in the business of selling you the cheapest possible computer component to be a gateway device. Current devices also include a WiFi radio to double as home access point. By setting up a Raspberry Pi as your DHCP server and DNS forwarder, you can remove that… Read more »

Featured Image

Is DNS What Makes My Internet Slow?

Recently, we saw what happened with the botnet attack on Dyn, but instead, let’s talk about a fine day on a happy Beatrix Potter-like Internet, shall we? We start on your local network: your DSL modem (or cable box) is your residential gateway. There’s a little hedgehog inside, helping the hamster in your computer fetch… Read more »

Featured Image

Write Your Own CPU Meter in Bash

Here’s a fun little project that is a pretty good combination of array use and pattern manipulation. #!/bin/bash function get_mhz() { while read line; do if [[ $line =~ cpu\ MHz ]]; then local hunks=(${line}) local ahz=(${hunks[3]}) local bars=$(( (${ahz%%.*} * (${COLUMNS} - 12) )/3500)) printf “%s:%${bars}s\n” $ahz ‘=’ | tr ‘ ‘ ‘=’ fi… Read more »

Slow SSD 3: Beyond Memory Testing

Part 1 | Part 2 Welcome, ensign, to our debrief. It sounds like you had troubling times…using…computers. Starfleet reports that citizens apparently have already encountered a form of your file system corruption problem. They report…unexplained crashes, file system corruption but no corresponding SMART data or bad blocks as a cause. I finally got to a… Read more »

Slow SSD #2: Protection for your Partitions

Part 3 | Part 1 Slow SSD, part 2: Protecting my Partitions The beautiful spring weather was denied me by my flaky computer. I would be working away, notice that I needed a new package, and then get an error: read only file system failure message when trying it. Once, I even rebooted into an… Read more »

Slow SSD #1: Recover your Boot and Root

Part 2 | Part 3 File-system integrity! Boring words, right? You’ve got work to finish. Your system froze in the middle of doing updates. When was my last backup? About as boring as a heart attack when your system won’t boot because your / (root) partition is corrupt. All of those thoughts raced through my… Read more »

Featured Image

Tar vs Rsync

Files getting lost or corrupted? A most heinous challenge, dude! So when strange things are afoot at the Linux-workstation, we totally hit our backups. We need to get started…but what commands should we use? We can use:   1. tar to make daily backups of all files, 2. or combine find and tar to back… Read more »

Featured Image

Backing Up Only Recent Files

  Gnarly Backup School Series Getting backups done is important. Sometimes what you have to backup and what you want to backup make quite the contrast. Consider I never want to back up my .mozilla/firefox//cache directory. Let’s cover how to avoid that. Because if you don’t, things get really bunk, little dude. Before you freak… Read more »

Featured Image

Making a Non-Spamming Alert using Diff

Being on pager duty is a downer. And it’s a big mistake that ruins the on-call or first-responder position when you allocate no-no time to actually invest in a useful reporting platform. Like many before me, I used to create exactly that evil: write a bash script, and throw it in cron. Example of the… Read more »

Parsing a Git Patch with Bash

I probably could have done this in perl and it would have been much faster…but I could say that about a lot of things. My problem is that Perl is not my command-line. Perl can be a REPL, but bash always is a REPL. Ever look at a patch file? If you’re a programmer that… Read more »