a lighter crunchbang of a netbook

23 July 2013

I pulled the msi u100 netbook out of the sock drawer for a reinstall. The battery is pretty weak so let's see if we can squeeze a little more juice out of it.

Let's go!

read more

auto connect usb modem with udev rules

July 2013

I found this pretty handy since I use a broadband usb modem. A udev rule to automatically connect when the device is connected.

First use lsusb to get the vendor and product id's:

$: lsusb
Bus 002 Device 026: ID 0af0:7401 Option

We are after 0af0:7401. Next create the rule as /etc/udev/rules.d/85-connect-to-internet.rules:

# place in /etc/udev/rules.d/ and copy the connect script to /usr/local/bin/
ACTION=="add", SUBSYSTEM=="net", ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7401", RUN+="/usr/local/bin/connect3G"

And ensure the relevant connect script lives in /usr/local/bin/. Remove any notify-send's from it and include a few seconds delay to allow the device to settle.

Notes

The original rule SUBSYSTEM suggested the "usb" value, this did not work at first, and by watching udevadm monitor I noticed the device got detected as (net). That works.

$: udevadm monitor
UDEV  [10535.591445] add      /devices/virtual/net/ppp0 (net)

dunst notifications for tiling wm's

Jun 2013

Trying out a new notifications daemon that is tiling friendly, I am delighted to have found dunst.

Nice first impressions:

things to note:

Installation

The repos had an outdated version, so naturally we build from the dunst source repo:

# dependencies as per the INSTALL file. Read it!
sudo apt-get install dbus libxinerama-dev libxft-dev libxss-dev libxdg-basedir-dev libglib2.0-dev libcairo2-dev libpango1.0-dev libdbus-1-dev libnotify-dev

Clone or grab the source and:

make
sudo make PREFIX=/usr install
mkdir ~/.config/dunst
cp /usr/share/dunst/dunstrc ~/.config/dunst/

No need for our current notify daemon, in my case:

# adjust your command to suit
sudo apt-get remove xfce4-notifyd

To pause notifications during screen locks so they do not flicker through:

$: sudo vi /usr/bin/cb-lock
notify-send "DUNST_COMMAND_PAUSE" # pause notifications
i3lock --nofork
# or xscreensaver-command -lock
notify-send "DUNST_COMMAND_RESUME" # resume notifications

No need to place it in autostart either [src]:

Because dunst provides a *.service file, that tells dbus that dunst provides the org.freedesktop.Notifications interface and therefore dbus starts dunst. It's the same way how notify-osd and would others get started by dbus when there's no notification-daemon running.

action shots

low, normal and critical notifications with the default config:

default dunst colors

customized config with colors and position:

customized colors and location

click to zoomify

CLI backup tool

Jun 2013

This is a little program that provides a command line UI for configuring and running backup profiles. We leverage familiar tools like tar, gpg and rsync.

For a full description of all the features see the GitHub page.

editing a backup profile

Restyling the site with CSS

May 2013

I delved into css again, the result is this beautifully minimalistic gray style. I took this opportunity to reorganize the links to past entries into their own page, and restyled the main navigation buttons.

I feel the seperation of site pages into years is too disjointed. This brought up an interesting question: If placing all posts in one directory, how many files would start making the scandir() call too resource intensive?

So far BananaSite is working just fine. I just wish rsync would actually work on my host.

Want to read more? Try the "Past entries" button up above.

Bananas - A markdown site engine

April 2013

This is Reinvent The Wheel month, and BananaSite is it: A simple markdown rendering web log engine. Today saw permalink support, and archiving past posts into years. A new style inspired by the i3 window manager, the borders, not the tiling part.

Tux