geekery
Helpful Scripts
Occasionally I come across a tool or script which scratches a long term itch. A couple of those irritating issues included mp4, specifically m4a files to ogg. And attempting to undervolt my AMD Turion X2 RM-72 processor.
The first task of file conversion is handled neatly by a script called dir2ogg, which as the site says dir2ogg is a GPL’ed python script which converts mp3, m4a, wma, and wav files into ogg-vorbis format. Before you audiophiles get in a rage, yes I know it’s moving from one lossy format to another, it had to happen. While I had some trouble converting entire directories it was easy enough to convert batches of files using a wildcard.
dir2ogg *.m4a
The second script came from rousting around the Ubuntu forums while searching for possible causes of my heat issues. TurionPowerControl not so simply lets you set a number of values for undervolting your AMD Turion processor. I don’t claim to understand how it all works, but some time with the included README pdf helped sort out the values needed. Once I had those values put it together in a script, made it executable, and copied it to /usr/bin/turionuv
modprobe msrmodprobe cpuidTurionPowerControl -pallc 0 37 0 13 -pallc 1 54 1 15 -pallc 2 61 2 17 -nbvid 54 -rampuptime 3 -rampdowntime 3 -pallc 6 41 1 20 -pallc 7 41 1 20 -altvidslamtime 5modprobe msrmodprobe cpuidTurionPowerControl -pallc 0 37 0 13 -pallc 1 54 1 15 -pallc 2 61 2 17 -nbvid 54 -rampuptime 3 -rampdowntime 3 -pallc 6 41 1 20 -pallc 7 41 1 20 -altvidslamtime 5
This helped lower my cpu temp marginally but every degree counts, using it along side CPUFreq have helped a lot, even with my power hogging usb wifi adapter.
Fun with Ralink drivers
Jul 16 20:32:08 v3lm4 kernel: [13394.099593] wlan0: deauthenticating from 00:12:xx:xx:xx:xx by local choice (reason=3)
The line above has been the bane of my existence for a little over a month when I picked up a Ralink USB wireless adapter. Under the rt2800 driver my connection would drop at random intervals. No matter which network I tried, regardless of network manager sometimes it was up for an hour, other times only 8-15mins. Many Google searches yielded varying solutions no of which worked until I found out about this bug.
The solution? Well it would seem that in kernel 2.6.32 and 2.6.34 power management for the adapter causes the above issue, this can be solved but turning it off. Replace wlan0 with your adapter.
iwconfig wlan0 power off
Hopefully this will be resolved in later updates, or Ralink will make the Rt3070 driver a bit more Linux friendly. The above solution worked immediately for me with no need for reboot.
** Update, it would appear this situation is not as resolved as I had hoped. This problem reappeared some hours later with no change in configuration I’m currently working on other possible fixes.
*** Update to the update: I switched from sidux back to Crunchbang (statler) and all my wireless problems went away.
Bauhaus Linux
I began with Linux in 2000 whittling down Slackware to fit on a 500mb harddrive, even now I still have a love for breathing new life into nearly obsolete hardware. So after 10 years it should come as no surprise that I enjoy seeing others keep machines out of the landfill. One such champion of reuse is K.Mandla’s blog of Linux experiences, the curiously named Motho ke motho ka botho. He frequently shares awesome information on getting the best out of machines from the early Pentium era.
Now to be honest, my current machine is an Acer Aspire 6530 with a 2.1ghz AMD Turion X2 Dual-Core Mobile RM-72, so I don’t actually NEED to spare the power. However about one year ago a power surge damaged random things like the internal mini-pci slots, ever since then I have been concerned about heat produced by the processor and ATI Mobility Radeon HD 3650. System performance has never suffered but I was occasionally plagued by shutdowns due to overheating.
In attempting to isolate the causes and improve system performance as I whole I switched back to Openbox and hand choose the applications I use daily based on need and simplicity. While I have pretty much conquered my heat issues I still remained dedicated to, dare I say, minimalism.
So while kmandla prefers screen and other console focused, yet always awesome apps I take a hybrid approach via Openbox. I boot to console, and utilize the capabilities of ~/.config/openbox/autostart and the ~/.xinitrc file.
xinitrc
#!/bin/sh## ~/.xinitrc## Executed by startx (run your window manager from here)(sleep 2s && setxkbmap us) &numlockx on &(sleep 1s && parcellite) &nitrogen –restore &thunar –daemon &xscreensaver -nosplash &(sleep 2s && conky -c .conkybrc) &(sleep 2s && conky) &(sleep 2s && volwheel) &# exec ion# exec jwm# exec wmaker# exec startkde# exec icewm# exec blackbox# exec gnome-session# exec startfluxbox# exec startxfce4# exec xfce4-session# exec xmonadexec openbox-session# exec awesome
Openbox autostart
# Run the system-wide support stuff
#. $GLOBALAUTOSTART
# Programs to launch at startup
# =============================
#vxprop -root -remove _NET_NUMBER_OF_DESKTOPS -remove _NET_DESKTOP_NAMES -remove _NET_CURRENT_DESKTOP
# Start session manager
lxsession &
# Force openoffice.org to use GTK theme
# enable this if you install openoffice
export OOO_FORCE_DESKTOP=gnome
# Start volume control system tray applet
# (sleep 4s && gnome-volume-control-applet) &
# Launch panel
tint2 &
#claws-mail
claws-mail &
#power manager
xfce4-power-manager &
#eye candy
(sleep 5s && xcompmgr -cCfF -t-5 -l-5 -r4.2 -o.55 -D6) &
I start with Terminator set almost full screen split into sections and two tabs. Tab one is usually used for MOC, alsamixer and alsaequal. Tab two is typically split horizontally with a root and user session for mucking about. My current distro of choice is still the Debian Sid based Sidux, which does well in catering to cranky power users like myself who can’t leave their machines well enough alone.
Little bits of Linux
A few things which have filled my geeky world this week.
Rockbox. Simply Rocks.
A fellow Crunchbang user informed me of this firmware replacement for a number of digital media players including the Apple iPod series. I was recently gifted a 1st generation iPod Mini, which even with the default firmware worked great under Crunchbang Linux, using gtkPod for managing it. I quickly became frustrated with the missing ability to drag and drop music onto the player, rather than using the devices iTunes like database as the way Apple intended. I downloaded the Rockbox installer, plugged up the iPod via USB and ran the file. Five mins later and had a very detailed, very customizable and extent able interface on this neat little player. I can now drag and drop any media file supported by the hardware, including Mp3, Ogg and my beloved FLAC formats directly in a file browser or via command line like any other usb storage device. The unit has a failing battery which will need to be replaced soon and under the orginal Apple firmware it was only usable for about 30 mins. After switching to the open source Rockbox firmware I get about 2.5 hours of play, although I plan on replacing the battery eventually.
In my never ending search for a streamlined system of organization I take a lot of notes, up until recently anything that wasn’t a todo list item was kept as reference in a neat note taking application called Gnote. Being a fan of minimalism I like having access to my information in plain text, so I was dismayed to learn Gnote does not keep its files in plain text. After asking around on the Crunchbang forums I was informed of Zim, a great personal wiki which stores it’s notes in plain text, dated files and folder based notebooks.
This weeks quick tip.
Search and Replace text in all files in a folder and its subfolders
I don’t remember where I found this but it saved me a lot of work recently so I’m passing it along.
#To replace all occurances of a string:
find /your/home/dir -name “*.txt” | xargs perl -pi -e ‘s/stringtoreplace/replacementstring/g’
#To replace the first occurance:
find /your/home/dir -name “*.txt” | xargs perl -pi -e ‘s/stringtoreplace/replacementstring/’
Any finally I’ve become quiet a fan of the Linux Outlaws podcast, Fab and Dan are both very funny and provide a crap load of great Linux information. Their show is a real resource and a worthy addition to your podcast feed list.
Updates for cbinfo, new cbdotfiles and some Linux porn
A very quick post all about personalizing Linux
My little perl based screenshot tool info tool, cbinfo has been updated.
Iḿ added a repository of my customized .dotfiles, or Linux environmental configuration files, for Bash, Conky, Mutt, Openbox and Terminator mostly to make it easy for me to customize a fresh install but a good config file is a great place to start those new to Linux. Like cbinfo, these are geared toward Crunchbang/Ubuntu Linux users but maybe used in other environments.
And now, screenshots.
Calcurse & Todo.Txt for GTD
Calcurse is a text-based calendar and scheduling application, it uses flat, human readable files for holding data about your calendar, appointments, and todo list. The app can import and export ical files though now automatically.
Todo.txt is a simple and extensible shell script for managing your todo.txt file. With a couple changes to todo.txt’s config file you can set it to write the ~/.calcurse/todo file giving you the ability, after adding a bash alias, to issue a command like this functionality is lacking in the current Calcurse.
Edit:
~/todo.cfg
# === EDIT FILE LOCATIONS BELOW ===
# Your todo.txt directory
export TODO_DIR=”/home/yourusername/.calcurse” <– change the TODO_DIR to your .calcurse directory and username
#export TODO_DIR=”C:/Documents and Settings/gina/My Documents”# Your todo/done/report.txt locations
export TODO_FILE=”$TODO_DIR/todo” <– remove file extension
export DONE_FILE=”$TODO_DIR/done.txt”
export REPORT_FILE=”$TODO_DIR/report.txt”
export TMP_FILE=”$TODO_DIR/todo.tmp”
Add items to your todo list in Calcurse
t add buy groceries
or
Quicky mark and item done and archvie it, making it invisible to the todo list but still kept as a list of completed actions.
t do 2
2 refers to the line number in the todo file.
When adding or editing todo items in Calcurse you can assign priorities [1] being the most important [9] being the least. You can do this on the command line with todotxt-cli by adding [1] or simular priority number to the task and include your designations for +projects and @contexts.
t add [3] finish howto
Starting Calcuruse or running
t archive
reorders and backups your list. Your items marked done via todotxt-cli will still show up in
t listall
but will not show up on your Calcurse todo list as current items.
For me, with the inclusion of Mutt provides a complete solution for productivity, including human readable text files and the ability, if you run conky, to have your appointments and todo list on your desktop. See this link for screenshots of my todo list.
if you use either of these apps or just like the ideas of a cli approach to getting things done please share your ideas on ways to integrate the two further. I’m currently working on a howto for the setup.
I wrote the author of Calcurse posing three questions I had before writing my howto.
Questions:
1. Is there a way to have calcurse append to the todo file rather than overwrite it?
2. Is there a way to add/delete an item to the calcurse todo list via command line?
3. Is there a way to have calcurse reload it’s config files, without saving to them first?
He sent me a response shortly:
Regarding your questions, unfortunately I must answer no to all of the 3 questions…
So it looks like the current functionality is the extent of the functionality for now, making any further HowTo tough until one of the three things comes about. He did mention that a couple of command line flags would be a good thing, and possibly implemented in the next release. Unfortunately he is unable to give any sort of idea of when that might be due to his schedule.
Music on Console: MoC for *nix – Updated
#! introduced me to MoC and I’ve always liked console music players but never found one that I was totally happy with. After some tinkering I’ve got MoC setup with my Acer’s multimedia keys, showing it’s playlist in Conky and scrobbling to Last.Fm.
While it may lack some of the “features” of Banshee or Exaile for example, it’s elegant super functional and handles my music the way I like.
Setting up MoCp to submit to Last.Fm.
Install lastfmsubmitd via apt-get:
sudo apt-get install lastfmsubmitid
You can also get it here: http://www.red-bean.com/decklin/lastfmsubmitd/
Add the followign to ~/.moc/config:
OnSongChange = “/usr/lib/lastfmsubmitd/lastfmsubmit –artist %a –title %t –length %d –album %b”
Add lastfm your login info to/etc/lastfmsubmitd.conf
sudo nano /etc/lastfmsubmitid.conf
That’s it!
Showing output of MoC in Conky:
Add the following to your .conkyrc
${alignc}${color1}${execpi 1 mocp -Q %state}${color}
${color1}Song: ${color2}${alignr}${execpi 1 mocp -Q %song}${color}
${color1}Artist: ${color2}${alignr}${execpi 1 mocp -Q %artist}${color}
${color1}Album: ${color2}${alignr}${execpi 1 mocp -Q %album}${color}
${color1}Time: ${color2}${alignr}${execpi 1 mocp -Q %tl} / ${execpi 1 mocp -Q %tt}${color}
Below is my original line, I’ve recently switched to using the line above as it allows for more customization.
${color1}${execpi 1 mocp -i | head | egrep -v ‘SongTitle|File:|TotalSec|CurrentSec|CurrentTime’}
You can read the mocp man page to find alternate values to show.
Conky does have it’s own variables for MOCP however I found on Ubuntu/Crunchbang the output is unreliable at times, and flickers on screen.
What geek doesn’t love Velma
My latest desktop and wallpaper. You can download the Velma wallpaper at 1366×768 resolution .
I found a neat script while checking out screenshots today called info.pl. I’m no ascii artist but I updated the script to show Crunchbang’s theme info including the Openbox theme, GTK and icon theme names. It will then take a screenshot for you after 5 seconds. This little Perl script is great for screenshot addicts like myself. You can download it here
The GTD workflow Pt. II
I have previously touched on my affinity for David Allen’s Getting Things Done productivity books and the GTD system as a whole. While I latched onto the concepts fairly quickly, the same concepts have been discussed at great length over the past few years online, one frustration shared by many a GTD disciple is committing yourself to a work-flow that actually works for you. I’ve tried hacked up solutions involving Evolution, Thunderbird/Lightning combo, GTD-GMail, various personal wikis/notebooks such as GTD TiddlyWiki, and MonkeyGTD, all awesome in their own rights but not quite right for me at least for GTD.
Most recently I have been spending a lot of time with Todo.Txt and WXRemind, since like a couple of other solutions all of list management is done by editing text files either directly via a text editor or on command line and the user is left with their data in the most portable, mod-able, easy to access format. However after a couple of days, much like the solutions mentioned above I grew tired of the limitations of the script or program and lacked the interest to really get down and learn what amounts to a dedicated scripting language simply to interact with my to-do list and other similar files. Another issue is that personal information management software such as Outlook, Evolution, and even Thunderbird/Lightning are pretty heavy on the resources and too dependent upon an internet connection causing much of the work that goes into setting up these systems to be for naught. It should be stated that what works for one person, doesn’t always work out for others, which is why I cannot criticize any of the scripts or applications I mentioned above.
So after reviewing what I actually need, a set of to-do lists for projects and contexts to preform them, a closely linked calendar with reminder system and access to both of these elements regardless of access to the internet.
After a couple of days tinkering with all of the above as well as Org-Mode for Emacs (way too involved btw) I have settled on a system utilizing the following components:
Google Calendar/Mozilla Lightning Extension
Allows for sharing with the girlfriend, multi-pc access as it’s web based and it’s rss feed and api allow for tight intetgration into the rest of my system. The private iCal feed brings the data into the Lightning calendar extension for Thunderbird.
Thunderbird/GMail via Google Apps for Domains
When I’m actually doing my weekly review or adding my weekly work schedule I need access to email and a calendar, having them both in one app which syncs the data for offline access is absolutely key to my personal system.
Conky
Conky is one of those simple apps that keeps gaining more functionality everyday. I show the next 5 days schedule just be low my todo list right on my desktop so that it’s literally in my face, making my agenda and next actions hard to ignore. This is all possible thanks to Kaivalagi’s (freakin awesome) Python Scripts. I use them to query my Google Calendar, cat my todo.txt, system stats, and display whats playing in Exaile.
ToDo.txt
This little command line app allows me to jot down my thoughts and tasks about as quickly as I can think them. It also allows me to edit my list or lists from command line or using any text editor.
At the end of this process I’ve learned alot about some really great Open Source applications but most importantly I’ve analyzed what tools fit my lifestyle, work and thought process best. The Getting Things Done system of productivity and organization is one which only has as much value as you allow it too and is directly affected by your choice of implementation and the ease of which you can access your information. If your system is too complicated you will only find your self more frustrated and less likely to keep it up.
Adventures in Skype
Most Linux users are familiar with Skype and just as familiar that Skype shows little to no love for it’s paid subscribers who happen to be Linux users. Our current version of the popular VOIP software has been stuck at 2.0.72 for a couple of years now. Nonetheless many of use use the service regularly and pay our dues like the rest of the users.
Recently I’ve been wanting to get more out of my Skype account, which meant getting a dedicated Skype hardware phone. There are a number of options from a $12 usb phone, a non-starter for Linux users as it’s not supported, or the pc-less Internet phones which fetch prices above $100. Being the miserly geek I am I started searching for other solutions and came across a two part solution to my problem.
Part 1:
A USB Telbox Phone Adapter, a small silver box powered by usb that interacts between Skype and any old telephone. I tested this with a self powered cordless phone . Less than $20 on Amazon.com
Part 2:
kB2Kskype software which requires usbb2k-api-mod2.8 (both available from the kb2skype site), and kdelibs4c2a (available via apt-get) once installed everything just worked.
I plugged in the phone to the phone port on the Telbox and instantly Skype popped up and I was able to call by double clicking a contact on my Skype list. You can also use speed-dial codes but I have yet to check them out. I also have yet to test call quality, which for some has been an issue if the Telbox isn’t used with a powered usb hub.
##Update -
The sound quality was much better than expected in terms of clarity however whenever you press the pound key during a call, the telbox or skype intiates the dial tone sound, but does not drop the call. Overall I’m very satisfied.
I’m very impressed with such a simple, cost effective solution to a practical problem.
This solution has been tested only with Ubuntu based Cruchbang Linux on an Acer Aspire 6530.
#! Crunchbang Linux – A Short Review
So while I’ve been mucking about with Linux since 1999, I’ve never written a proper review of a distribution. I’ve enjoyed the likes of Slackware, Mandrake, Knoppix, Debian, Ubuntu, Mint and now my most recent favorite, Crunchbang. As part of the Debian/Ubuntu family, this lean and nimble operating system focuses on the Openbox window manager and a number of scripts, customizations and nifty Linux tools to create a responsive minimalist desktop many power users will appreciate.
Back in February when I got my Acer Aspire 6530 I installed Linux Mint and was happy to strip it down to Openbox and Gnome-Panel with Mint Menu after I grew tired of resource hungry Compiz effects. While many consider Compiz/Emerald to be great advances in usability, I just find them to be distracting. While my machines 512mb ATI Radeon Mobility HD 3650 could handle the effects I couldn’t justify using up nearly a gig of ram just for the desktop.
On a whim, while looking for a lightweight distro to install on a friends desktop, I decided to give the Crunchbang live cd a go. I was greeted by a simple text menu, and hit enter on my keyboard. A couple of short minutes later I arrived at a smart, dark if not spartan Openbox desktop with a pre-configured Conky, and tint2 panel.
I chose the Install option from the right click menu and a few short minutes later the system was installed using the familiar Ubiquity installer common to many Ubuntu based distributions.
The Openbox menu is organized into neat categories with sections for the usual Internet and Office apps as well as a number of neat terminal based apps such as newsbeuter and htop. Also installed were Skype and the codecs necessary for playing mp3′s, flash and most video, again saving me the trouble of downloading these, much as is provided in Linux Mint.
Much of the trouble of finding, installing and creating links/menu entries for many of the supportive appications which are so useful in Openbox, is avoided leaving the user with time to do important things like getting to work or finding that perfect wallpaper. Since it uses most, if not all, of the same software repositories as Ubuntu finding a favorite application is as easy as apt-get.
As far as resource usage, at boot the system uses about 300 megs of memory and barely causes a tick on the usage of the dual cpus. While running Firefox, Thunderbird, Exaile and even xcompmgr for compositing I’m only using about 702 megs of memory a far cry from the 1.6 gigs required under Gnome w/ Compiz.
Overall I find Crunchbang to be an great balance between lean resource usage and a complete customizable, comfortable Linux desktop experience. The maintainer, known as Corenominal on the distro’s user forum, has taken a lot of time thinking about this balance and it shows in a tightly integrated well considered environment.
My Influential Books/Poems/Short Stories/Essays
List fifteen books/poems/short stories/essays you’ve read that have stuck with you. Don’t take too long to think about it. Tag 10 friends, including me, please.
Books/Poems/Short Stories/Essays
1. No Country for Old Men by Cormac McCarthy
2. Voodoo by Henning Christoph – Hans Oberlander
3. Generation Ecstasy by Simon Renolds
4. The World’s Religions by Huston Smith
5. A People’s History of the United States: 1492 – Present (1980) by Howard Zinn
6. On The Road by Jack Kerouac
7. Les Miserables by Victor Hugo
8. Roots by Alex Haley
9. The Holy Quran
10. The Taqwacores by Michael Muhammed Knight
11. Running Linux by O’Reilly Media
12. Interview with the Vampire by Anne Rice
13. Violin by Anne Rice
14. Love In Black And White by Gail & Mark Mathabane
15. Getting Things Done by David Allen
Freedom Valley
Freedom Valley was a fully supported non-competitive bike ride featuring trail & shared roads paths over varied distances. Check out my video of the start of the ride or view images from the day in the image browser below.
My choosen GTD Trusted System
I have been looking for a “trusted system” for my own personal implementation of David Allen’s Getting Things Done productivity system.The system itself has been a fan of many a geek and has been discussed many, many times over the past few years. Lifehacker has been a huge resource for those of us in the cult of GTD. Recently while playing with todo.txt I did some research on Lifehacker and found a new application called Tracks, a web based basecamp/project pier style GTD app which runs on Windows, Linux and Mac OS. While the dependency list is pretty long installing it on my Ubuntu notebook was as easy as using the cross platform installer by BitNami. Those of use used the concept of Projects, Context, and Next Actions will feel at home pretty quickly. If this is all alien to you check ou the Wikipedia entry on GTD. Since Tracks offers RSS feeds it was easy to incorporate my Next Actions list into Conky, my desktop system monitor/tool/best friend. Now when I update Tracks my next actions automatically show on my desktop, giving me one more reminder to get something done.
Since I frequently find myself outside of the house w/ no net connection other web based solutions were not an option. However a local install of many of these apps is possible, the BitNami script made the whole thing trivial.
One draw back is that you have to remember to start the service on reboot otherwise you will find Conky spitting out RSS parse errors, as your page isn’t currently being served via Apache.
Linux Screenshot Goodness
I regularly post my Linux desktop screenshots in an attempt to show others just how versitile and user friendly Linux has become. I recently switched back to Ubuntu and as usual I’m running Gnome. The background is a picture I took over the Spring Garden St. bridge of the Schuylkill River heading south toward Center City Philadelphia while riding a SEPTA bus. The system monitor is my adaptation of Conky/Conky-Colors
Geeking Out
Got the itch to show my geek side today and give the new Ubuntu 9.04 (Jaunty) a spin on my Acer Aspire 6530. A quick rundown on the specs of my notebook.
AMD Turion X2 2.2ghz 64-bit
4 gigs DDR2 ram
320gb drive + 120 gig backup drive
ATI Mobility Radeon HD 3650 dedicated graphics
Initially the live cd, present on all Ubuntu versions, worked beautifully so I went ahead with the full install after backing up my data to my usb storage drive. The install took about 20 mins in total before I was booted to a usable desktop. The open source drivers for my ATI Mobility Radeon 3650 worked well enough, however no OpenGL or 3d acceleration was present. This was a bit of bummer at first as my last distro, Linux Mint 6 set this up out of the box. However after a few mins with Google I found that the new, although proprietary, ATI Catalyst 9.5 drivers installed with no issue and after a quick reboot and setting the Effects preferences everything was golden.
After using Linux Mint for a few months, it was interesting being in a “less polished” version of Ubuntu. For those that don’t know Linux Mint is simply a fork of Ubuntu with a heavy amount of slick polish and a ton of “restricted” codecs pre-installed. Because of these additions Linux Mint is technically illegal to use in any country which recognizes software patents (such as the mp3 codec), since Mint is developed in Ireland, those laws don’t apply. As most know the United States does recognize software patents on an almost ridiculous level. Due to this issue, after a fresh install of Ubuntu it’s up to the user to choose to use those “forbidden” codecs by installing the “ubuntu-restricted-extras” package.
So after installing, and setting up my favorite software such as Gwibber, Inkscape, and CheckGMail everything is as I like it. Previously I used Ubuntu for about 3 years and have always enjoyed this mature, easy to use distro and regularly recommend it to anyone looking to make a soft entry into the Linux world.
All in all I spent maybe 1.5 hours doing backup, install and tweaking to my liking.
So far I’ve found Jaunty to surprisingly fast on both boot up and shut down as well as very snappy during regular use. Ubuntu has always been one of my favorite distros and it still retains it’s title.















