Step aside, HAL 9000

Step aside, HAL 9000

The dreams of elementary school kids are always the most fanciful: some want to be rock stars, some want to be doctors, some want to be fighter pilots and some want to be spies. They want new bicycles, Nerf guns and Nintendo. They want to slay dragons or become superheroes.

Back when I was a kid, somewhere between third and fourth grade, I thought the coolest thing to have would be a large, intelligent mainframe, some type of overarching computer knowledge base like you see in sci-fi movies and video games. Yeah, I was a geek then, too.

While obviously the idea faded off sometime as I grew up, the odd, nerdy fantasy found its way into my head roughly a week ago. I wondered what a modern interpretation of it would actually be: now, that knowledge base would be a personal information aggregator, some type of tool that would allow me one-look access to nearly all of the information that mattered in my life, from number of e-mails to financial data. I wanted the ultimate PIM. I wanted more than just an e-secretary: I wanted a true e-servant, able to connect to my apartment and automate the lighting, tell me where my car was, and recognise me by biometric authentication. I wanted what was effectively an artificial intelligence server, a modern-day HAL 9000 for my own personal use.

What would I really need to build such a system? What was it that I wanted? After realising that most of my ideas were most certainly feasible with modern-day technology and next-to-nothing costs (less than $50,) I actually began to design such a system. I named it Sarai, for Semi-Automated Residential Artificial Intelligence, which also doubles as the word for “house” in Persian and “palace” in Turkish according to Wikipedia. Sarai would have to be able to:

  • Be expandable For Sarai to be expandable, I would need to build it in an object-oriented language and make the codebase modular, that way I could add in new information systems or I/O libraries as was necessary to make the server work with current and future platforms.
  • Work with old technology Since Sarai was a limited-budget project, I needed to be able to make it work with really cheap hardware, including computer components I could get for free or close to it.
  • Be remotely accessible Since I wanted Sarai to have a remote interface, it would be best to run a web-based application to control most of Sarai’s functionality.
  • Be very, very stable and secure Sarai, given its Internet connectivity and responsibility as a be-all, end-all life aggregator, needed to be secure and stable. This ruled out any Windows-based solutions and most off-the-shelf software.
  • Be able to control lighting, including dimming I wanted Sarai to be able to control all of my apartment’s lighting. The cheapest solution for automated lighting control is still the X10 protocol; while other, more advanced solutions exist, the shoestring budget for building Sarai would require me to work with the cheapest components.
  • Keep tabs on my house and car Thanks to an application I wrote for O’Reilly Media, I had some experience in building GPS tracking systems for automobiles using Mologogo and hacked Nextel phones. The home stuff didn’t need to be that advanced, so using any old webcam would do the trick; I’d just need simple motion detection or the like.
  • Maintain data from all over my life Sarai would need connectivity with my stock portfolio, with research systems, with my PIM software on my smartphone, hyalineskies statistics, and message boards that I post on. Thanks to many Web 2.0 services and their software APIs, this type of connectivity has become infinitely easier in recent years, but there are still places where Sarai would have to use a rather-fragile screen scraper.
  • Show the data in a kiosk mode on a display Sarai also needed a kiosk mode, some way to dedicate a monitor to the display of the data it aggregates. This rules out a lot of really cheap hardware, as I’d have to run some type of GUI and a web browser
  • Look good While this sounds like it’d be the easiest thing to do, it could be tricky: the device needs to be able to support and display anti-aliased TrueType fonts to the user, as well as JavaScript and Flash. This rules out a lot of very minimal web browsers available for UNIX platforms, such as Dillo.

Sarai’s end vision was what Danny O’Brien referred to as “secret software” at the O’Reilly Emerging Technology Conference back in 2004 (Cory Doctorow’s notes on the seminar give an awesome summary of what O’Brien said,) and it is this type of software that ultimately improves the productivity of the person using it. Sarai became more than a simple idea: it became a living example of the ultimate life hack.

Building Sarai: The hardware

I knew that to make Sarai development both quick and easy, I’d have to use a LAMP server solution on a UNIX/Linux box. Thankfully, a single-user server didn’t require that much power or RAM, so I knew a Pentium III box with sufficient memory and a big hard drive would work well enough for the project.

I originally searched eBay for a few computers, but shipping on a full-size computer made it effectively impractical to purchase one from afar. Craigslist turned up nothing but really overpriced Pentium II-class hardware. Eventually, I salvaged an aging IBM Aptiva 2164 from my mother, who had long since moved onto better hardware; I found the Aptiva’s case literally rusting away in the garage, having been placed out there and condemned to die in the elements. I was allowed to take it, but only under the condition that I returned the 25.0GB hard disk. Had I not picked up the machine, it would have headed to the trash heap.

I came back to my apartment with my “new” server: with a 500MHz Pentium III and only 128MB RAM, this once cutting-edge machine was laughably obsolete compared to modern-day technology. After cleaning off the spider webs (including dead spider carcasses) and what I think were mold spores on the top of the black case, a bit of Windex and some Q-tips cleaned the machine up to a state that made it look brand new. Thanks to IBM’s relatively-timeless case design, the black machine sits simply on my desk, meeting the “look good” requirement.

The internal hardware, however, was still a bit of a mess: using an 80-gigabyte Western Digital Caviar I salvaged from a broken external hard disk enclosure and a 15″ Sony Trinitron CRT, I started up the machine. The floppy drive was entirely dead, causing BIOS errors until I disabled it, and the machine had a distinct lack of an Ethernet card. That said, the box contained a Linksys 802.11b PCI card with an aging, huge antenna coming out of the back; there was no guarantee that the wireless would work, either.

With the computer successfully running through BIOS checks otherwise, I decided it was time to start finding software.

Building Sarai: The base software

The machine’s old hardware already confined me to Linux/UNIX systems; no new variant of Windows would meet the security requirement or even work anywhere close to quickly on the PC otherwise. After looking at possibly using OpenBSD for its security, I eventually settled upon Ubuntu’s alternate version, which was made for systems with less than 192MB RAM. (In retrospect, I would’ve used Xubuntu, an even smaller Ubuntu fork, had I paid attention to it when downloading Ubuntu.) I had heard a lot of good things about Ubuntu, and after installing the system in expert mode, I was able to boot into the standard GNOME Desktop Environment with a fully working motherboard (including USB) and got the old Linksys card working using Orinoco drivers after a bit of modprobe.d/blacklist hacking.

With the base installation of Ubuntu down, I began using aptitude to pare away at the packages that I didn’t need, such as The GIMP or OpenOffice.org. I wanted to leave GNOME around in case I wanted a desktop GUI later; instead of deleting gdm and other GNOME-based X tools, I simply disabled them. Thanks to the AutoHide extension for Firefox and a simple .xinitrc file, booting into the X server requires minimal resources, loading Firefox directly in full-screen mode without requiring any window manager. At this point, I had satisfied the kiosk mode constraints to a point that was sufficient. To further increase the aesthetics, I installed the Microsoft Web Safe Fonts using apt-get.

On the backend, I installed a LAMP stack, the type of server I was most used to using. I also included the OpenSSH server for remote login and vsftpd to complete my web server-esque functionality. To make it remotely accessible from my Dynamic IP aDSL, I gave it a domain at the absolutely indispensable DynDNS.org, and then set up a few Python and shell scripts to automatically update DynDNS if the IP address changed. I then set the Web ports of Apache and FTP services to something other than their defaults for more security, installed SSL and was done configuring the LAMP stack.

At this point, I had met most of the basic requirements necessary without writing any serious code of my own; to handle the X10 home lighting control, I found a command-line utility called BottleRocket, which allows X10 control via a tiny serial port hardware device available on eBay for under $5. Since X10 has been around forever and since been obsolesced by more complex systems such as INSTEON, I can replace most light fixtures with modules costing less than $5 on eBay. Using Bottlerocket and the PHP exec command, I could build a library to automate all parts of lighting in my apartment. Surveillance proved easy using tons of existing webcam APIs.

What’s next

While the Sarai vision has certainly found its way closer to geeky reality, a lot more needs to be done before it’s actually useful; the actual application to aggregate things still has to be written. I’ve found ways to handle most of the incoming and outgoing data; it is now simply a matter of coding the proper solutions. Maybe the ideas of elementary schoolers aren’t so crazy after all.

Article Abstract

Posted 8 February 2007. Approx. 1,714 words.

An old fantasy from elementary school leads me on a quest to build the ultimate in “secret software:” a working HAL 9000-style computer with the ability to aggregate all of my life’s data into one spot while turning my apartment into a fully-automated, remotely-accessible abode. The cost constraint? Under $50. 200 hours of development time. The expected value: thousands of hours of time.

Comments

Comments RSS Feed for “this post”

I’ll be excited to see this when it’s all done.

It’s bad enough you’re not using OpenBSD – Apache, SSL, PHP, vsftpd – asking to get hacked?

SSL and PHP have dreadful security track records with several buffer overflows that allow remote admin in their default install, regardless of OS.

If you want some real security on this, make a VPN via simple SSH tunnels; change the sshd port, and (optionally) find a way to dynamically adjust your firewall as your client IP changes to only allow SSH connectivity from your current IP.

Require a DSA-key to authenticate the SSH tunnel from your system & instead of a password just use a biometric thumb scanner (pretty cheap these days).

An EFS also isn’t a bad idea, so if someone steals the box the data’s still encrypted. This would be relatively secure, at least for a PIM. The current design specs? Likely to get autorooted within 5 yrs.

Michael:

As of right now, the box is still inaccessible from outside of my Intranet, so security won’t be an issue until I actually have it publicly accessible. Your VPN idea is a really great one that I hadn’t thought about to begin with, though, so I’m definitely going to use it.

Also, I think it’s rather shortsighted to think that I’ll let the box sit around with its current security specifications for the next five years; I’ll certainly be updating as I learn more about the process of secure system administration.

Wow … i dont even know how i found this page but all of a sudden i am addicted to this site now and want to keep checking back for updates, and i also want my own Sarai now lol, but i dont see the girlfriend even letting me think of trying to set this up.

Still i love the idea and will be watching its progress constantly :)

Need any help? This is something I am very interest in as well…

Duncan & Cody:

It seems that this is generating a tiny bit of buzz. If more people show interest, I’d be more than happy to open this up as an open-source / public aggregator project with Trac / SVN / etc., but as for now I’m keeping the number of cooks in the kitchen relatively small so, selfishly, I can get what I want out of it first.

If there’s a lot of interest in the final product, I see no reason why this can’t go CC and be used by a ton of people.

I understand what you mean, i don’t blame you in making it work exactly how you want it to, thats what i would do. I think i might have to start looking into how to make my own HAL 9000 :P

If i do fail (which i prob. will) i will just wait for your release :D

Of course aggregating all in one place creates a single point of failure, one power surge and you’ve had it.
So not only security, but also availability, should be considered.
Never mind that someone stealing the data off this machine can completely impersonate you.
I’m not sure aggregation is the best idea,
federation allows you to spread your risk.

Anonymous Coward:

I really hate anonymous comments and was off to delete this, but your point was valid. Come back and actually post with your name and what not and I’ll replace the comment.

That said, I definitely understand where you’re coming from, and I’m working a lot on redundancy. I’m going to build a RAID within the machine to backup data and run the machine into a UPS (which also allows the machine to tell me whether or not I’ve lost power before shutting down gracefully.)

Like Michael said, I’m encrypting the filesystems as well to make sure that data can’t be ripped off of the drive; meanwhile, the machine won’t hold much valuable data on its own (the valuable data will be behind most of the bank services systems, APIs to things like Backpack, etc.,) so at best all someone has by stealing this machine are passwords which I can change on every site within a matter of seconds. The data actually cached on Sarai is minimal at best.

Back :-)

You will still need a backup in case you corrupt the file system, since a RAID will not protect you from that (nor from a power surge).

An encrypted file system will not protect you from anyone while it’s mounted, so the security problem remains.
I wouldn’t even bother with an encrypted filesystem if the system is stationary, unless there’s a risk of it getting stolen.

If you say that the system acts as an aggregation of passwords with which it collects data for visualization,
you still have the problem that you need to notice that the machine is compromised. And you will have to be able to access all the sites attached to this machine before their passwords are changed.

I’d try to modularize the system, so the compromise of one module doesn’t bring down the whole system.

And your system should warn you of a breach and allow you to recover completely within 30min from a remote location.

Maybee FreeBSD Jails could help with compartmentalization.

I am still following this project with great interest. How is it coming along?

Write Your Own Comment

To preserve legitimate discussion, please use your real name and email address.
Your email address will not be published. Derogatory comments will be deleted.

External Discussion

Displaying the only trackback.

| Wireless energy / water…
social do you need to be? Lots of levels. Your private dashboard. Some sparklines on your homepage. A weekly email telling you how you compare to the…