udiskie

June 03, 2010 at 08:55 PM | categories: archlinux, tools | View Comments

With the deprecation of HAL proceeding at full speed it's time to find a new solution for automounting disks on my Linux box. I've been happily using halevt, which does a lot more than disk mounting, but won't be of much use once HAL really goes away. udisks is the replacement that the major desktops are moving to, so I decided to write a simple automounting daemon for those of us not using a major desktop: udiskie. It's a simple udisks client that just takes care of mounting removable media right now. I run it by adding udiskie & to ~/.xinitrc. When I'm done using a removable disk, udiskie-umount will take care of the unmount. I probably can't stress enough how simplistic and undocumented this approach is, but it works for me.

And, of course, for the Archlinux users, it's already packaged in the AUR: udiskie

Read and Post Comments

pm-utils and Locked Screens

April 06, 2010 at 05:54 AM | categories: tips, archlinux | View Comments

pm-utils seems to be the clear winner to userspace suspend and hibernate setup. It's a great back, but, for those of us who don't run a desktop environment with a power manager, there's one thing missing: screen locking. I'd like the screen to be locked when my computer resumes from either suspend or hibernate, and I don't want to run gnome-power-manager to get that functionality. So, 00lock-screen to the rescue. Just drop that file in /etc/pm/sleep.d and, as long as you have xscreensaver, gnome-screensaver, i3lock, or xlock setup, the screen will lock as your computer suspends or hibernates.

For the Archlinux users, it's already packaged in the AUR: pm-utils-screen-lock

Read and Post Comments

OpenWRT on the D-Link DIR-615

March 10, 2010 at 06:41 AM | categories: tips | View Comments

Last night, I finally got around to installing the OpenWRT 10.03 Beta on my D-Link DIR-615. The short version: it works and works well. There were only two surprises I ran into.

The first surprise is that the wireless drivers are not included in the install image. Running opkg update; opkg install kmod-ath9k takes care of that. The drivers are left out by design at least on this router and the WRT160NL. Bonus points to OpenWRT for allowing me to file a bug without creating an account on their bug tracker.

The second surprise is that the dynamic dns client doesn't know about DNS-O-Matic. I installed the ddns-scripts package and used the following config to get it working:

config 'service' 'myddns'
	option 'ip_source' 'network'
	option 'ip_network' 'wan'
	option 'check_unit' 'minutes'
	option 'enabled' '1'
	option 'domain' 'all.dnsomatic.com'
	option 'username' 'username'
	option 'password' 'password'
	option 'update_url' 'http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]'
	option 'check_interval' '5'
	option 'force_interval' '480'
	option 'force_unit' 'hours'
Read and Post Comments

gdb and pthread

February 19, 2010 at 09:33 PM | categories: tips | View Comments

Error message translation time. Here's an error gdb gave me today:

[Thread debugging using libthread_db enabled]             
Cannot find new threads: generic error

Translation: Programs that use pthread functions should really be linked with the -lpthread option.

Read and Post Comments

Scripting wireshark with lua

December 09, 2009 at 06:44 AM | categories: tips | View Comments

While attempting to wrap some wireshark processing with a bash script, I discovered that I didn't need to write complex bash code at all, because wireshark has a built-in scripting language. Even better, it's a common scripting language: lua. It looks like Debian and its derivatives ship wireshark with lua support, but for everything else, you'll have to rebuild the package to enable it. There's a great page of examples and the api is really simple. And for those cases where you don't want to use the wireshark GUI, lua scripts work just fine with tshark.

If lua is overkill for the task at hand, tshark also offers decent control over what shows up in the output. If you want to see all HTTP requests and their request URI and method, without any other information about the packet, this tshark command will do the trick:

tshark -T fields -e http.request.method -e http.request.uri -R 'http'
Read and Post Comments

Next Page ยป