Subject: Re: Great things about NetBSD
To: Stefan 'Kaishakunin' Schumacher <stefan@net-tex.de>
From: Eric <kellybelly@gwi.net>
List: netbsd-users
Date: 04/27/2007 13:49:45
On Fri, 27 Apr 2007 10:41:13 +0200
Stefan 'Kaishakunin' Schumacher <stefan@net-tex.de> wrote:

> Also sprach Eric (kellybelly@gwi.net)
> =20
> > I used NetBSD as a desktop on a new Dell PC; in my home gym I have NetB=
SD running on an old desktop that I use to keep a workout journal; I've ins=
talled NetBSD to a 512 MB USB stick that I carry around with me, enabling m=
e to run NetBSD on almost any machine with USB capabilities; and I've used =
NetBSD to set up a simple home electrical power monitoring system (i.e. the=
 power's on) using a $5 garage sale computer (Packard Bell MultiMedia C115,=
 120 Mhz CPU, 48 MB RAM, 248 MB hard drive) that automatically notifies me =
via emails if I lose power or power gets restored at my house when I'm not =
home.  I've installed NetBSD on refurbished computers that I've redistribut=
ed to local refugees, and have installed it on computers owned by non-compu=
ter savvy friends, with nothing but positive results.=20
>=20
> How did you realize that power monitoring computer? Is it just a read
> only running system that sends an email when restarted?
>=20
> --=20
> PGP FPR: CF74 D5F2 4871 3E5C FFFE  0130 11F4 C41E B3FB AE33
> http://www.net-tex.de                                =20
> http://www.cryptomancer.de
> --=20
> Jeder wird als Faust geboren, um alles zu erfassen, alles zu erproben, al=
les=20
> auszudr=FCcken. Da=DF Faust Gelehrter wurde, daf=FCr sorgten die Fehler s=
einer=20
> Vorg=E4nger und seiner Zeitgenossen.=20
> Boris Pasternak, Doktor Schiwago
>=20

First, I set up /etc/myname and set dhclient=3DYES in /etc/rc.conf.

Then I set up a username and configured /etc/ttys and /etc/gettytab to logi=
n automatically as that user, as noted in http://wiki.netbsd.se/index.php/H=
ow_to_automatically_login_to_console.

Then I wrote a simple script called automailer that allowed me to automatic=
ally send mail to myself (in this case I used my blackberry email address)

#! /bin/sh

echo "The power is back on" | mail -s "The power is back on" insertnamehere=
@your.email.com

I make the script executable (chmod u+x automailer).

Then I set up ~/.login so that it would automatically launch my automailer =
program once the user was automatically logged in:

~/automailer

The computer has an always-on on/off button (there is probably a more techn=
ical term for that), so that once NetBSD shuts down, rather than turning th=
e power button off, I just unplug it.  This way, NetBSD will automatically =
boot once the computer is plugged back in (or turned back on). =20

I keep the box in my closet and typically only set it up if we are expectin=
g real bad weather. =20

I use cron on the same computer to send me continuous emails every 1/2 hour=
, using a similar automailer program.  This way I can determine if the powe=
r company had only temporarily restored power (i.e. if I don't get my 1/2 h=
our email I know the system is back down.)





--=20
Eric <kellybelly@gwi.net>