Notes

Resolving unread mail count with different mail clients

While looking for a new MUA, I've had to come up with different ways for displaying an unread mail count on my desktop. Naturally, `notmuch` is the easiest, as long as you've finalized your policy as to _what_ consitutes new mail. It's easy to flip the "work offline" switch in...

(Mis)using s6 to run complementary desktop applications

You will notice that some of these applications (eg `mpd`) should only ever be ran once, while others are tied to the `X` session. For that, I use two supervision trees, one of which is executed in `~/.xinitrc` so that `$DISPLAY` is set. All I needed to get things running...

Using urxvt with zsh as a program launcher

There's a number of window manager independant program launchers out there, but if you need to run arbitrary commands or want shell completion you might find yourself falling back to spawning a terminal every time. It's easy to create a `dmenu` replacement by adding this to your `~/.zshrc`: Entering this...

Why vimperator hint mode doesn't weed out duplicate links

Vimperator has a commonly used "hint" mode where you may enter either a generated combination of characters or link's text to interact with that element. As you type characters in, vimperator filters out matching links for you. For example, if there's two links with the text "About" in them, typing...

Converting zsh buffer contents to a function

I sometimes find myself trying out different varations of a command until I manage get it to work the way I intended to. This involves a lot of jumping back and forth between words in my previous buffer. With a really simple function you can decrease the amount of jumping...

Logging into a ZTE H168N with the help of expect

Jalal Sela already took the time to break into a sibling of this router on his Speaking of this device, in it you will find `/var/tmp/db_backup_cfg.xml` and `/data/cfg/db_user_cfg.xml` which have the same contents, except the latter is compressed in some funny way. Here's how do decompress it...

Extracting all known addresses from notmuch for use with mutt

Edit: You should use `notmuch-addrlookup-c` instead as it has good support for `mutt` and executes much faster. Retrieving all known addresses from notmuch's index turned out to be more difficult than I had initially assumed. I needed to search not only recipients, but senders as well, due to mailing lists...

Confusing perl with nested while matches

Nesting while loops that match against the same string will throw perl into an infinite loop. Produces the following: That's right. Same pointer. You can work around this by using a copy of the string instead (or more likely, since you ran into this: `substr`)...

Using mailto URIs with mutt postponed email

mailto:// URLs are sometimes convenient to use, but they don't fit in too well with using a single mutt instance and having an aversion to windows popping up. One way to use them with mutt is to take advantage of the postponed feature. If your `postponed` variable points to a...

Getting lynx to print URLs of HTML messages on the side

Reading HTML e-mail in the terminal can be a bit of a pain. `lynx` does a fine job at dumping them, but actually opening the URLs from it is cumbersome as they are placed at the very end of the message. Luckily, there's nothing a little bit of perl can't...

Getting Viber for Linux to play nice with apulse

Viber for Linux seems to work fine with apulse, except for taking the liberty of changing my system's volume to 100% shortly after starting. After no luck with trying to figure out if it was leveraging apulse itself to do this, I started believing it was calling alsa despite being...

Monitoring memory usage for weechat script leaks

I was recently dealing with a memory leak within a script in `weechat`. I needed a quick and dirty way of figuring out which script was causing the trouble. Of course it makes no sense to use `awk` for this, but what the heck. This script unloads all weechat scripts...

Removing binary data from (mpd) logfiles

I like to keep `mpd` logs around for statistics purposes. Unfortunately I have had mpd write binary to the logfile for one reason or another. Fear not, easy to fix. This was also a good time to remove all the client calls to bring the filesize down from 1GiB...