Wednesday, January 21, 2009

Obama's Address

My favorite part of Obamam's speech is:

And because we have tasted the bitter swill of civil war and segregation and emerged from that dark chapter stronger and more united, we cannot help but believe that the old hatreds shall someday pass; that the lines of tribe shall soon dissolve; that as the world grows smaller, our common humanity shall reveal itself; and that America must play its role in ushering in a new era of peace.ref

Or, perhaps it's
And to those nations like ours that enjoy relative plenty, we say we can no longer afford indifference to the suffering outside our borders, nor can we consume the world's resources without regard to effect. For the world has changed, and we must change with it. ref

Actually,
For as much as government can do and must do, it is ultimately the faith and determination of the American people upon which this nation relies.

is pretty good.


I'm inspired by this man. His speech, his demeanor, and his savvy. I have great hope for the future. And, honestly, I feel like I needo to up my level of responsibility. To self, to country, and to humanity.

Monday, January 12, 2009

Sound Troubles

I recently fixed the sound on my friend's new HP Pavillion dv4-1225dx. Once again, research on google and ubuntu forums (and openSUSE 's forums) was my only salvation. Apparently, many new sound cards have absolutely no standardized codecs. The basic steps were:
  1. Install Ubuntu Intrepid (my friend had already done this)
  2. Update alsa-libs to most recent stable version. This was higher than the
  3. Edit /etc/modprobe.d/alsa-base to include the specific codec type.
  4. Make certain the volume was ALL the way up.

Alsa libs update was accomplished via soundcheck's script posted here on ubuntu forums. This compiled the newest alsa-libs, 1.0.18 in my case.

Further down in the post Temujin reposted model-specific information for the codec returned by the following command:
cat /proc/asound/card0/codec#* | grep Codec

In my case it returned:
Codec: IDT 92HD71B7X
Codec: LSI ID 1040

Neither matched Temujin's list, but googling for 92HD71B7X led me to oldcpu's post on forums.opensuse.org. oldcpu pointed out that this was similar to STAC92HD71B* from Temujin's post. I added the line:
options snd-hda-intel model=dell-m4-1

to the file
/etc/modprobe.d/alsa-base

The model doesn't make sense (this is an HP computer) but the sound worked after reboot. Huzzah!

Wednesday, January 7, 2009

One small step for a home network...

One giant leap for an aspiring nerd.

I've taken my next steps towards a more efficient online presence. Wake on lan (WOL), a friend's donated ancient laptop computer (what up Ann!), and generous use of teh google have inspired me to get greener. I want to use my home network for as much functionality as possible. I'm going to school for CS, and want to run my own server for practice and a consistent but customizable programming environment. I spend a lot of time at home consuming media (Digital TV, podcasts, streaming radio and on-demand video) while working and studying.

My needs for this project are:
  • A server to provide consistent remote computing (emacs, gcc, sh), legal torrent serving, file sharing, backup, and local virtualization. (Hopefully, remote virtualization when I figure it out).
  • Programmable Digital TV Recording (I love you Jim Leherer), and
  • to spend some time screwing around with my home network.
My desire at the end of set-up is to have:
  • a low-power-consumption home network,
  • NPR playing as I wake-up,
  • One of those Shuttle KPC dealies with a low power dual core and a 22" flat panel, and of course,
  • world peace.

The assets I started with were:
  • an AMD Athlon XP rig w/ 1GB, 250GB, running Ubuntu 8.04.1 server, VirtualBox,
  • an Intel Core 2 Duo (C2D) notebook w/ 2GB, 160GB, running Fedora 10,
  • a PII notebook w/ 128MB, 5GB, running Ubuntu 8.04.1 server,
  • a Hauppage Win-TV HVR-950 USB stick,
  • a D-Link wi-fi router,
  • a limited knowledge of linux,
  • the internets, and
  • a lack of absolute trust in the internets.

My old plan has been to:
  • leave the Athlon XP rig running 24-7 so I can access my files from anywhere, download and serve torrents anytime and do programming for school,
  • leave the C2D notebook running when I'll be away to record TV, and overnight to start NPR in the morning, and
  • pay an extra $8-$15 per month to WE Energies.

Here's the overview of my new plan:
  • Set-up the PII notebook with a 64-watt power supply (equivalent to an average light bulb) as a torrent client and ssh server.
  • Use wake-on-lan on Athlon XP rig to boot only when needed to compute or get files.
  • Use wake-on-lan from suspend on C2D notebook to power on only when recording.
Set-up the Always-on server:
To install the ubuntu 8.04.1 server (torrent) on the PII notebook I had hoped to use PXE booting over the local network (alternate setup), but the motherboard didn't support it. I burned a CD, installed the base system plus OpenSSH, updated it, and installed rtorrent. I found out from K.Mandla what a great torrent client rtorrent is. You can set it up to automate torrent starts by monitoring a directory for newly saved torrents. I've been using rtorrent on the Athlon XP rig and scp-ing my files to the correct directory from any ssh client I'm on. But, the best part is that rtorrent runs great on the the PII notebook!

Set-up Wake On Lan on the Athlon XP server:
I followed the directions on this post from Chris Tucker (No, not that Chris Tucker) to ubuntu forums. It sets up my LAN card to listen for the magic sequence when the server is shutdown with a simple sudo halt. Now I can wake it up with the command wakeonlan (sudo apt-get install wakeonlan). I've got it aliased to
alias wakeBubu='wakeonlan ab:cd:ef:01:23:45'

where the last string is the mac id from the Athlon XP's LAN card.

Step 1) Get the mac id from the Athlon XP server:
ifconfig | grep HW

It consists of 6 pairs of hexadecimal numbers like "ab:cd:ef:01:23:45".
Transcribe this for later use.

Step 2) Create a script to enable wake on lan:
su -
cd /etc/init.d
pico wakeonlanconfig

Enter the folowing and save:
#!/bin/bash
ethtool -s eth0 wol g
exit
Step 3) Change the permissions of the script:
chmod a+x /etc/init.d/wakeonlanconfig

And update the configuration to run on change of init
update-rc.d -f wakeonlanconfig defaults

Which gives you back something like what the ubuntu forums poster had:
 Adding system startup for /etc/init.d/wakeonlanconfig ...
/etc/rc0.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc1.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc6.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc2.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc3.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc4.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
/etc/rc5.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig

Run the script to make sure it went ok:
sudo /etc/init.d/wakeonlanconfig

which should return nothing.

Step 4) Now, on the PII laptop I install wakeonlan
sudo apt-get install wakeonlan


Step 5) Presuming I've set-up my Athlon XP server's BIOS correctly, I
execute this command on it:
sudo halt

Wait a minute for shutdown.

Step 6) Now, from the PII laptop I execute:
wakeonlan ab:cd:ef:01:23:45

and the Athlon server powers on!

If this fails, try
wakeonlan -p 7 ab:cd:ef:01:23:45

or some such nonsense as per your LAN card documentation (-p indicating the switch for port selection, 7 being the 7th port).

Now I've got a computer I can edit text (programs) on, share torrents with, and launch big brother from. I retain the security and functionality by implementing ssh logins for each computer. I can write scripts for the PII laptop asking each other computer to wake. If I schedule jobs correctly with cron, sleep, or built-in timers like Kaffeine, I can power on each rig for the period needed, run the job, and then execute a shutdown the next time I can grab a terminal. Or, once again, shut-down with a simple sleep-delayed halt.