IT

Producteev API

Stephen
My first shot at a ruby gem and api client any feedback would help. Producteev Api

Ruby Exchange lookup script for Mutt

Stephen
As i use mutt at work i had no way to lookup email address for other people. Well now i have with some nasty hacky ruby. I may clean it up etc when i have time but for now it works. Simply add this to your mutt config set query_command = "ruby -W0 {location of below script} '%s'" The -W0 is needed as there is a bug in the curb gem that i am using.

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\.

Reading Stdin Bash style

Stephen
Have you ever had the need to read standard input in a bash script, for example cat /var/log/message | mycoolbashscript.sh Well i did when wrapping msmtp for use with mutt see the example bellow #!/bin/bash all=`cat "/dev/stdin"` if `/sbin/ifconfig eth0 | /bin/grep "inet addr" | /usr/bin/awk -F: '{ print $2 }'' | /usr/bin/awk '{ print $1 }'' | /bin/grep -qE '172\.31|32\.[0-9]{1,3}\.[0-9]{1,3}'`; then echo "$all" | tsocks msmtp -a account $* else echo "$all" | msmtp -a account $* fi I then setup mutt to use this as the sendmail binary set sendmail="~/utils/sendmail.

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