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.