linux

Bash Notificaiton

Stephen
I haven’t updated the blog in ages and I think it’s about time that I wrote a post. I’m forever running commands that take forever to complete, I forget about them and only release they have complete once I cycle through all the windows in my tmux session. To overcome this, I wrote a super simple function that sends a desktop notification once the command completes. It also returns the exit code of the command rather than the exit code of notify-send.

Removing Cruft From A Debian Box

Stephen
If you remove a package from a debian package and for get to add the -purge argument the package will leave its configurations files on your system. In order to view all the packages that have done this you can simply run. sudo dpkg -l | egrep "^rc"` If you wish remove those configurations files you can simple run sudo aptitude purge ~c

Zotac zBox HD-ID11

Stephen
After trying to get hdmi to work for the last 30 minutes, you can do the following Change it to the deafult card you can update /usr/share/alsa/alsa.conf and change these lines: defaults.ctl.card 0 defaults.pcm.card 0 defaults.pcm.device 0 to this: defaults.ctl.card NVidia defaults.pcm.card Nvidia defaults.pcm.device 7 Once the machine reboot check that the configs are correct in gnome mixer and it should just work.

Patches for envy 14 and Gentoo

Stephen
Here is a patch set that will get the envy14 working correct with gentoo and linux-2.6.34-gentoo-r6. They are mostly patches that i have found of the net, with some of mine sprinkled in, id credit the original authors but i have lost the links. Please comment on this posts if you know where they came from and ill give credit to the original authors. linux-patches-envy14-inux-2.6.34-gentoo-r6.tar.gz

iwlagn Unsupported (too old) EEPROM

Stephen
After purchasing a new wireless card of ebay. I found out that it was a preproduction knock off. You can see [Intels view on this ][1]. In order to get it working on linux you need to hack the driver. This is a hack and i mean a hack, it took me 2 seconds but now my wireless card is working. iwl-eeprom.c.patch --- linux-2.6.34-gentoo-r1-orig/drivers/net/wireless/iwlwifi/iwl-eeprom.c 2010-05-16 23:17:36.000000000 +0200 +++ linux-2.6.34-gentoo-r1/drivers/net/wireless/iwlwifi/iwl-eeprom.c 2010-09-02 19:04:12.

Find your ip with Bash

Stephen
I only wanted to run a script if the machine had a specific network access so i constructed this below. How to find the machines ip address ifconfig eth0 | grep "inet addr" | awk -F: '{ print $2 }' | awk '{ print $1 }' Then find out if its on a network we care about ifconfig eth0 | grep "inet addr" | awk -F: '{ print $2 }' | awk '{ print $1 }' | grep -qE '172\.

Offlineimap + Mutt = Less Pain

Stephen
I receive a lot of email as im a system administrator in order to handle this i prefer to use Mutt. One problem, Mutt sucks when using imap connections. In order to over come this you can use a nice little util called offlineimap that with sync a imap server to a local folder in mail dir format. So the flow of mail into my computer is now Imap Server -> Offlineimap -> Mutt -> Offlineimap -> Imap Server

Bash and substring removal

Stephen
Deletes shortest match of $substring from back of $string. ${string%”$substring”} Example find /var/files -name "*.mp3" | while read string; do mv$ $string ${string%"mp3"}wav done Will strip mp3 of the end of the string and add wav

Sun java plugin firefox and lucid

Stephen
After upgrading i noticed the sun plugin no longer works in firefox after so poking i got it working using this hack sudo rm /etc/alternatives/mozilla-javaplugin.so sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so /etc/alternatives/mozilla-javaplugin.so sudo rm /usr/lib/mozilla/plugins/libjavaplugin.so sudo ln -s /etc/alternatives/mozilla-javaplugin.so /usr/lib/mozilla/plugins/libjavaplugin.so