Tag: command line

Printing to unsupported Brother printer from Chromebook

I was trying to get a printer set up on a Chromebook and after looking through its list for the right model, it wasn’t there. It suggested I give it a PPD file. After some searching, I learned that you can find some compressed PPD files if you download the right Postscript Windows driver from

Trying to find the memory high water mark for a given process

I wanted to find out the most memory a process used while running. ps_mem.py is great for showing the total size (resident + shared) for processes but it’s only an instantaneous snapshot. After some searching, I found out that a tool I’d known about forever already has (mostly) the feature I wanted: /usr/bin/time.

Poor Man’s Continuous Integration

I created the following script which saves a few seconds of switching to a terminal and typing grunt on each change to my source files. [crayon-64cebbee43bd1167108615/] I can just leave this running in a terminal window and glance at the output to make sure there were no errors.

Defend against fake google bots

I can think of some reasons why folks might use the Googlebot user agent on their non-Google bots, but I can’t think of any good, upstanding reasons to do it. Here’s how one might find some fine folks who would do such a thing. As of right now (May 2018), all valid Google Bot source

Monitor load in the terminal

Just a small one that tends to get my attention when I have a terminal open into a remote machine and would like to notice right away when the load rises. Of course one could just use the echo -e "\a" if you have visual bell enabled or if you want to annoy people around

Prolong the life of the SD card in your Raspberry Pi

The web is littered with stories of people who love their Raspberry Pis but are disappointed to learn that the Pi often eats the SD card. I’ve recovered a card once, but otherwise had a few that have been destroyed and were not recoverable. I’ll lay out how I use This One Weird Trick(tm), ahem,

kworker using cpu on an otherwise idle system

I have an old thin client that I upgraded to a home server by adding some additional RAM and storage. I noticed after a recent kernel upgrade that the system seemed sluggish at times, despite doing nothing in particular at the time. top showed that a kworker process was using CPU, not all of it,

Finding how much time Apache requests take

When a request is logged in Apache’s common or combined format, it doesn’t actually show you how much time each request took to complete. To make reading logs a bit more confusing, each request is logged only once it’s completed. So a long-running request may have an earlier start time but appear later in the

Default route via VPN while keeping LAN & services available

OpenVPN is working great and all, but I was having trouble getting my other LAN hosts to connect to the OpenVPN client system (a Raspberry Pi) while also keeping the services I normally run on it available from the internet. On the remote server, I was using redirect-gateway def1, which works but makes some assumptions

Tunnelblick disconnect fails to remove route

Tunnelblick is an awesome OpenVPN client, which I have been using a lot lately on my Mac. I had a problem where it would connect the first time just fine, but then would never reconnect; it would seem to hang while trying to handshake with the server. I could get it to work again if

scary rando stuff

You don’t see stuff like this everyday (I hope). [crayon-64cebbee453b4314226538/] [crayon-64cebbee453bd600798271/]

LFD stops logging to kern.log

It took a while before I figured out why LFD wasn’t logging any issues to kern.log on my Debian-based systems. I realized at some point that it worked when I first installed CSF, but then logged nothing after the first day.

Rename and Iconv are like Chocolate and Peanut Butter

The features of iconv are probably built into Perl rename (aka prename), but when I tried the example from the man page, it kept generating an error message. I presume this is due to a missing Perl module. Here’s the error: [crayon-64cebbee45812620457195/] So I suppose if we don’t care much about speed then we can