Archive for 2009

RexPC: Running EEEbuntu on eeePc 701 as a Carputer in my WRX

My latest big project is installing my eeePC 701 into my Subaru WRX. This is going to be a long project with several stages, and I’ll talk more later on the actual requirements. For now I first want to see if the eeePC 701 is actually powerful enough to make it worth installing into my car. Its low power requirements (22 watts) and tiny size makes it such a perfect fit that i want to make it work.

The eeePc I am planning to build into my wrx

The eeePc I am planning to build into my wrx

The Xandros packaged with the 701 was more of a joke than anything else. Fantastic for the very inexperienced user who will only ever use skype, pidgin and firefox. I need something more powerful and less buggy, so I’m going with EEEbuntu 3.0 base, since this is the most stripped down “full-featured” ready-to-go OS for the 701 I could find.

After downloading, burning and installing (luckily I have an external CDROM) I went through the following steps:

  1. Run Update Manager and install all the updates (it’s based on Ubuntu 9.04)
  2. Install GPSD, gpsdrive, tangogps, python-gps though synaptic
  3. Plug in GPS (gpsd launches automatically), and go for a test drive

I drove around the neighborhood with the GPS pushed into my sunroof (smart huh?) and the eeepc on the passanger seat. I was very impressed with tangogps and logged my trip around campus with it. At first glance everything worked seamlessly with no configuration needed!

A quick test trip logged using tangogps

A quick test trip logged using tangogps

I’ll be looking into touchscreens to install in place of the regular cd/radio/tape head that is currently in there, and keep writing about my progress.

RexPC: Planning my WRX’s built-in computer

What if... WRX + eeePC

What if... WRX + eeePC

I’m planning to build a computer into my 2004 Subaru Impreza WRX. And not just any computer, but hopefully my small eeePC 701 – the original netbook that started the revolution.

So, as with any big project, this one starts with a list of dreams I wish I had, and some research online into what other people are doing. Actually, any big project starts with a glass of Zinfandel (check) and brainstorming for a name. In this case, it was easy. My WRX is called Rex. And it’s getting a computer. So, RexPC. Onwards, then!

I should quickly address those of you thinking “Why is this guy not upgrading his exhaust to a full catback, or getting new rims and high performance tires, or upgrading his intercooler and air intake, or rechipping the engine ECU, or, or, or… why is he installing a *computer*??” (TJ I know what’s going through your mind). Simple, really, the computer is the cheapest mod I can do at this point, since the eeepc is just collecting dust on my shelf at the moment, and it’ll be awesome once it’s in the car.

My list of requirements. The design process (courtesy of CS147 with Scott Klemmer), once a certain type of user has been identified, kicks off with a need-finding phase to explore possible problems to address in your product. Since I’m the user, this should be easy. Here’s the list of things I want Rex to be able to do

RexPC User Requirements (aka Dreams)


  • Play my complete (160gb) music library. And stay sync’d with my desktop.
  • Play other people’s plugged-in iPods
  • Play AM/FM Radio
  • Record video with backup and front camera (obviously, tagged with audio and location)
  • Show backup camera when in reverse


  • Map my trips in detail
  • Provide navigation when I get lost
  • Provide weather and road condition information (incl. current temperature, etc)


  • Provide Engine Diagnostics (OBDII readout)
  • Provide extra gauges (for example, oil temperature and pressure)
  • Provide chassis orientation information (angles, direction)
  • Provide performance information (acceleration, cornering, wheel slip, lap timing, bodyroll, etc.)
  • Control interior and exterior lighting, and windows.

Communication and Countersurveillance

  • HAM Radio abilities including APRS
  • Family Talk radio
  • Police Scanner
  • Show traffic cameras
  • Radar/Laser detector alert logging and tagging with location
  • Bluetooth phone integration


  • Work seamlessly with the car’s ignition system to provide startup and shutdown of electronic components with the rest of the car.

Now I have this initial list of things I want my car to do (some of them probably beyond the scope of this project since it will demand always-on interwebs, and I don’t know if I’m ready to shell out for a monthly 3g contract). So what do we need to do this?

Hardware Requirements

  • eeepc running custom linux
  • external usb-powered harddrive (250gb or more)
  • microphone
  • audio-out to current speaker system
  • GPS
  • accelerometer
  • compass
  • network connectivity (wifi definitely, possible 3G for always-on)
  • OBD II interface to car diagnostics
  • outside temperature sensor
  • ham radio, computer-controlled
  • police scanner (hopefully part of ham radio)
  • integration into current radar detector (I’m not building one of these things…)
  • touchscreen built into car

Current Carputers out in the wild

I’m obviously not the first to want to attempt this project. Several awesome people who are inspiring me to do this is the work. Avatar-X built a dell laptop into his Subaru Legacy that does most of these things and more! His process is nice to read (although not very well documented in terms of replication) and inspired me to look into this. Redian has a much more detailed post on installing a real motherboard into his wrx wagon which is also very informative. has, in general, been a good source of inspiration, information and encouragement, so check them out.

Next up, testing the eeepc’s abilities to handle this kind of workload, and looking at bashing out the list of dreams into a more concrete set of features interacting with each other.

Windows to Mac Screen Sharing

My old black macbook has been collecting dust for no reason whatsoever, so I decided to use it as the dev machine for our HCI class (CS147) since none of my team members had their own mac machines. Surely setting up a windows-to-mac screen sharing session couldn’t be too hard!

Unfortunately Mac’s fantastic screen sharing implementation doesn’t play well with Windows. You can connect to it with a VNC client (I recommend TightVNC) but its incredibly slow.

An easy fix is to use the awesome Vine VNC Server for OS X on your mac, and connect to it with TightVNC.To get that  buttery smooth feel, use TightVNC’s CoRRE encoding as your compression medium. Boom! A usable remote desktop connection from a windows to a mac box.

Resizing your HFS+ partition? Oh boy, Adobe licenses suck!

After deleting a partition on my hackintosh, I’ve needed to resize my Mac partition to use the extra free space. Boy oh boy was I about to get acquainted with a monster. After lots of research online, I find that the only free way to increase the size of an existing HFS+ partition is to trick Bootcamp into creating a partition in whatever free space you have, then telling bootcamp to reclaim that partition into your mac partition. And for some reason my install didn’t have bootcamp on it, which you can’t download since bootcamp is not integrated into the OS.

So I came up with a smart alternative. And boy did that create probems… But I did get something running in the end!

Continue reading ‘Resizing your HFS+ partition? Oh boy, Adobe licenses suck!’ »

Arduino 16 SD and SPI interfacing

Just a quick note – the latest Arduino software does something terribly wrong in its interfacing with SD cards through the SPI interface (dunno if this affects all SPI connections or not, maybe!). I’ve struggled with this for days on end until I downgraded to 0014 and everything started working just fine!

Students arent made the way they used to be

A recent talk at Berkeley about the Engineering mentality, Freedom and Patents blew me out of the water. Here it is, transcribed. The author wished to remain anonymous.

Continue reading ‘Students arent made the way they used to be’ »

Intelligentsia, and what I hope to see in more cafe’s

The wonderful Gleb Denisov and Ashley Brown took me to the newly-opened Intellgentsia Coffee Bar in Venice Beach on my last visit to Los Angeles. As a fan of Blue Bottle and Ritual Coffee, both in San Francisco, my idea of a funky, fun, excellent coffee house involves highly-trained baristas serving me connoisseur-quality coffee-based drinks magically prepared along with a row of other drinks for those who are ordering with me. I will then take this little cup of heaven, find a place to sit or stand, and rave about the quality of the coffee and the hip-ness of the atmosphere. After finishing the delightful drink (possibly over some textbook or code), I leave with a happy caffeine high and none the wiser of where all this magic came from.

Intelligentsia does things a little different. As you walk into their glass enclosure of a shop, a barista offers to help you at their own espresso and coffee station, on one of the four corners of what looks like a big lunch cart that fills most of the store. As you follow him to his espresso machine, you pass by delicate pastries with shocking price tags (absolutely worth it, might I add) to the tune of, in my case, the great RJD2, one of my favorite electronic musicians. The decor and architecture makes you want to hang around this place, and the large assortment of coffee-related merchandise (from $1800 espresso machines to $10 milk frother jugs) pleases any coffee fanatic looking for that missing piece for their home setup.

But then comes the best part of Intelligentsia. Once you and the barista gets comfortable at his espresso machine, he makes you what you want, to order, right in front of you. You get to look at the whole process, and see how your cup is made. This is your espresso, made as you want it, while you’re chatting away with your obviously skilled and very down to earth barista. After sitting down with my espresso and finding an absurd amount of enjoyment from sipping the dark drink, I found myself more attached to this espresso than I usually am at coffee bars. In fact, it felt just a little bit like my own espresso’s I brew at home. Better in quality, yes, but also more personal. This is not your starbucks/peets/insert-other-coffeehouse experience of being handed a drink from behind some mysterious silver machine. No no, you were involved! By golly, you might not have turned any knobs or pushed any buttons, but you where there for every step of the way. And that makes a difference. Because if espresso is art, visiting Intelligentsia is like commissioning the artist. And I loved it.

Domain specific knowledge in Music. Mainstream hip-hop’s problem.

As a follow up to one of my previous opinions of the importance of domain specific knowledge to be productive, I happened across an interesting example worth sharing.

Domain specific knowledge not only helps with productivity, it also makes a big difference in accuracy. That’s where the example comes in.

I’m a big fan of Lupe Fiasco’s music, and his old mixtapes were some of the best works in hip hop since the early 90s. So I was listening to his “Happy Industries”, enjoying his brilliant lyrics and mash-up abilities. So I figured I should check out the full lyrics and post it on facebook. This is what I found on each of the top 5 google results for “Lupe Fiasco Happy Industries Lyrics”:

Once upon a time not long ago
An ID yeah that’s what I had
To take DNA
As a little pro two
With my MCing ways and make em mad
Just having fun not chasing cash
Apologise now for it make ya mad
Had to call g wall tell em warm up the mic
Put the pendant on the wall tell em make some maaagiicc
Shorty it’s nothing lavish
Matter of fact
It’s just an attic
Background noise from the family
Hearing the mic slaying in the outside traffic
Still turned out fantastic
Turn my vocals up just a tad bit
Fresh from the first and fifteen
Quarantine touching you super cool that asset

I’m sorry, but this is utter crap. Some fan with very little knowledge about the music industry must have transcribed this. It makes no sense whatsoever, and unfortunately the state of hip-hop is such that most people will accept that fact that it makes no sense. But Lupe tends to have great lyrics, so on listening to the song again, this is what he’s really saying:

Once upon a time not long ago
An idea yeah that’s what I had
To take demon days
And a little pro tools
With my MCing ways and make a mash.
Just having fun not chasing cash
Apologize now if I make ya mad
Had to call g wall tell em warm up the mic
Put the pendant on the wall tell em make some maaagiicc
Studio is nothing lavish
Matter of fact
It’s just an attic
Background noise from the fan
Hearing the mic slaying in the outside traffic
Still turned out fantastic
Turn my vocals up just a tad bit
Fresh from the first and fifteen
Quarantine touching you super cool thats just ah sick!

Notice what just happened. The lyrics went from some song filled with what we can only consider to be slang we don’t understand and randomly “slaying the mic” to a song about him making “sick” music using just his laptop and his little home studio in his attic, not here to make money but here for the magic. He talks about using Pro Tools, something that people with experience in the music industry knows about, and making mash-ups between tracks. Funny, because the song itself is exactly a mashup of Gorillas’ Demon Days album and his lyrics. It should be obvious that these are the correct lyrics.

If Hip-Hop is so infused with the ideas of making money that a song saying “its not about money” can so quickly become so convoluted… You be the judge.

BruteSoft comes out of stealth!

In between my studies and research (which is drawing to a close, by the way!) I’m also involved in BruteSoft, a startup pushing a dramatically different system for enterprise software distribution. We’ve been working hard at this over the last 6 months (although preliminary talks started almost 2 years ago), and we’re ready to come out and play!

To give you a snippet of the kind of things we do, I’ll pull out some highlights from the product page:

Today, BruteSoft provides enterprises with a radically new approach to managing their computers in an efficient and effective way, saving you money and reducing your carbon footprint.

BruteSoft innovates software solutions based on our patent-pending federated distribution technology (DBx). Our solutions are secure, exponentially scalable and self-healing, eliminating hardware layers and delivering unrivalled speeds in an energy efficient way. DBx decouples client demand from distribution servers, which enables software distribution to an unlimited number of clients without the need for additional infrastructure.

Our products have reached the pinnacle of software distribution efficiency. As a proof point, our products are capable of transferring the equivalent of a DVD of 5GB within 5 minutes to 10,000 desktops on a 1Gbit LAN/WAN.

Go check out the website, and if you’re managing a large amount of computers (or know people who do!) send them out way!

Python is Wrong

I recently did about 3 days of solid hacking in Python, and discovered some limitations and some nice features of the language and its libraries in the process.
I can complain about how limited the lambda is compared to my experiences with Scheme, or how lacking its process management utilities are, but more importantly, there’s something fundamentally wrong with python.

You see, it has this neat easter egg. “import this” prints the following poem, see if you can state the gross error. To make it easier, I’m putting the gross error in BOLD.

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

Oh come ON! Anyone who’s ever done numerical simulation or any kind of computational physics knows that Implicit has the same error as Explicit but is unconditionally stable!

Give me implicit euler integration or give me death.

The 10x programmer’s secret – Domain Specific Knowledge

There’s an interesting discussion going on on Hacker News, about “coding fast” and the mythical “10x programmer”. I know at times I’ve been that 10x coder, and at other times I was the 0.1x guy confused in the back, so I was curious to see what others were thinking.

The discussion centers around learning languages and becoming comfortable with the features, the APIs and your tools, but some comments focused on another area of programmer productivity that can be called “Knowing what to write”. Domain specific knowledge allows you to have huge boosts in productivity since you only code what is really necessary, and you don’t waste time coding peripheral features or get mired down in struggling with where to start and how to move forward.

The discussion is here:

So I have one suggestion for both building domain specific knowledge and avoiding the slump of getting stuck, or writing unnecessary code: Prototype and Iterate! It’s already a fairly well established idea in design and programmer circles, but the advantages of prototyping becomes even more clear if you consider it in the light of learning a domain.

That 10x programming speedup you’re looking for probably lies in coding simple systems, and building on top of them, rather than spending hours writing code that “will come in handy later” or attemping to complete some set of the code before moving on to the next.

My friend Marcello mentioned the amount of projects he’s started – much more than he’s ever finished. I think that this points to going through the process of learning a domain by building prototypes, throwing them away, and letting your ideas organically grow as you build things.

So let’s go be productive!

Repair: Rewiring your Sennheiser HD 280 Pro

2 years ago I, with much excitement, ordered a pair of Sennheiser HD 280 Pro’s. Both Gleb and Matt has a pair, and after listening to theirs… Apple’s little iPod buds just didn’t cut it anymore. I loved my pair so much that their connector ended up being severely bent when i squeezed past a, um, slightly oversized person sitting next to me in economy class on a flight back to South Africa. Anyways, the deed was done and the headphones became pretty much unusable, since only the one channel was getting through the bent pin!

I finally got around to rewiring them, which was more tricky than i expected! So here’s a post for others trying to do the same thing.

On stripping the connector, you discover 4 wires, rather than the expected 3:

First thing’s first, TIN THESE WIRES WITH SOME SOLDER! I had no idea that the copper strands themselves were covered by a thin film of resin, which needs to be burned off with some solder. If you try to connect an alligator clip straight to the bared wire, you get no connection, causing much confusion.

The 4 wire mystery was solved when I peeked into the left earphone. The two drivers are separately wired all the way to the connector. Two wires per channel = 4 wires. The mapping I discovered is as follows:


As follows:

If you’re interested, inside the left headphone there’s a little splitter board:

I bought a nice connector from Radioshack and wired this up. Be really careful when soldering the wires to the connector and don’t use too much heat! The shielding melts quickly and you don’t want your cable all melted together inside. I connected the two grounds from the two drivers together, which worked just fine.

After doing this, I was rewarded with a fantastic set of cans working again!

Real Time Raytracing Success!

Oh man oh man oh man, two bottles of 5 hour energy and a delicous mug of Peet’s Major Dickasons freshly roasted coffee later and I’m doing real time raytracing!

Its nothing super fancy, but as part of the assignments I’ve been working out for the graphics class I’m TAing (CS184 at UC Berkeley) I’ve been putting together a framework for the students to explore raytracing in. And while we’re at it, why not try to make it run in realtime. Turns out that cutting out disk access and loading everything up into RAM, using OpenGL as a final pixel buffer to display images, gives you gobs of performance for free. Now who would have thought that? ;)

So, I’ll clean this stuff up and post some demos. Phong shading has never looked so good as when you can swing the camera around objects!

Monitors monitors monitors! What’s with 16:9 and shiny plastic bevels?

After Microcenter rudely and unceremoniously canceled my in-store pickup order of the Samsung 2343BWX (errors in their inventory database…). Apparently this monitor is pretty hard to get – 23″ and 2048×1152 for $199 is such a sweet deal – that neither Fry’s, Central Computers or any of the online retailer could even get me this monitor (although there were some refurbished models around).

At this point I’m very happy with my dual 20″ Samsungs, both at 1680×1050, but I had some reason to add another two screens to my setup. The 16:10 aspect ratio of that resolution is really great for coding with side-by-side editor windows. They’re just not big enough to prevent me from constantly resizing windows. And whenever I work at home on my dad’s 1920×1200 screen, I have significantly less of these issues. My preferred coding setup is two sets of 80-characters-wide text screens with a project explorer and outline view flanking them. This just fits well with 1920 by 1200 pixels. Which is why I’m out shopping for a good pair.

Fry’s had one of the 2343BWX on the showroom floor so I had the opportunity to see it in bad light running at a shitty resolution. Hmm, the 16:9 did look a little less “coding-friendly” than what I currently had, and the incredibly shiny bevel looks plasticky next to the matte bevels found on monitors aimed at professionals. Since I didn’t want to order a monitor online and find that I didn’t prefer its features. So right now I’m looking at a comparable Samsung 2233 monitor ($199). Also shiny bevel, also 19:6 but a lower resolution of 1920×1080 (compared to 2048×1152) and I find that my worries were unfounded.

The shiny bevel, although nothing to be excited about, becomes unnoticeable against the very bright screens and impressive contrast of the latest Samsung releases. The 16:9 is great for movies, but since a 1080p monitor has less vertical than the 16:10 monitor of equivalent width. After messing with Eclipse on the 1920×1080 resolution, I came to the conclusion that upgrading would only be worth it if I gain a decent amount of pixels both vertically and horizontally. So I’m taking these back and waiting until the larger 23″ 2048×1152 monitors are back in stock.

Of course, the real answer comes in a much simpler package – 30″ of pure viewing bliss like the monitors in the Graphics lab!

Dawn on a Rainy Day – Hackathon 09

There’s something quite magical of watching dawn from your apartment, rain streaking the windows. And its an ideal time to reflect why you’re up at this hour, and what you’ve been doing over the last 48 hours.

In my case, I’ve been hacking at all through Friday and Saturday. The website is blank, since its not a web service (yet) and it was for Hackathon 09, so no time was wasted on nice frivolities like “websites” and “marketing”. All the focus was on our SMS application, that does price lookups for UPC codes texted to it.

The scenario is as follows: You’re standing in Fry’s, looking at some piece of tech gadgetry that you just have to have. But are you going to be angry that you bought it here if there’s a sweet deal online? Or even better, what if Best Buy across the street had it for 20% off and you didnt know? Send off a text message with the UPC product code to our service, and you’ll receive a reply looking something like this:

"WD 250gb My Passport Hard Drive. (4.5/5) $52 at, average price of $69. Locally at Best Buy for $75"

I built this with an impromptu team of three other Berkeley students – Timothy Liu, Dounan Shi and Irving Lin – and decided to do this text message based service similar to (which, BTW, is also a very cool service, but I find that whenever I use it I’m extremely frustrated that I have to make a call and stand there, waiting for the voice prompts to read me info on my product.) It was a really fun experience, and although we didn’t win anything we’re planning to build this out into a serious web service that people can use.

For future hackers, if you’re doing a mobile app, have it ready to demo on the judges’ phones. Let them whip out their cell and use it. We didn’t do this and we realized after showing it to people later that day that the coolness factor is just about zero until someone can do it themselves. And good luck!

Another cool thing I saw at Hackathon was – online electronic music sets from premier DJs. I’m jamming out to it right now! They release DJ sets (those hour-long musical journeys that DJs create by mixing many different tracks) in a track-by-track form in their music player. Finally, you can get both the awesomeness of these DJ sets and the convenience of knowing which song it being played, and jump to the songs you particularly like.

Finally, it was interesting to see a different interpretation of the “Hack day” concept from the Yahoo hack days I’ve been involved in. Yahoo hack days are known for their 90 seconds presentation, and I wish they did that as well. We had 4 minute presentations, and it was a lot harder to follow the main points of people! 90 seconds is an excellent time limit to explain hacks done in 24 hours. Schwag, Pizza and Beer was also notoriously missing… is the recession taking its toll? Hmm, no, because they had Sushi (which disappeared in a matter of minutes) and burritos in the afternoon. Possibly the lack of alcohol explains the productivity! The turnout was amazing – 25 teams in total! – which they managed to do by offering $200 to the student group that turns out the most entries. So they had CSUA, IEEE and UPE all working for them, which was utter genius.

Anyway, the sun is rising and I’m off to go pick up my new Samsung 23″ HD monitor. My aim for desk domination through sheer pixelcount is nearing completion since I’m about to put down the third monitor on my desk. Once I upgrade to 4 by duplicating the current purchase (yea, im waiting for the end-of-the-month paycheck) I’ll finally have that 3840 by 2300 pixels of screen space on my desktop. 30″ monitors be damned!

I got into Stanford, now what?

As the good news keep rolling in, with PhD acceptances suddenly going from scarce to abundant, I’m being slapped in the face by the question I should have been asking while applying – WHICH ONE?!!!?!

Undergrad was a fairly easy decision. Go to the best school you get into. Grad school… A little more complicated. The questions range from “Can I afford the area?” (easy, fellowships!) to “Will I want to marry someone from here?” (interesting… but not very informative still) to “Are there people I want to work with?” (crucial… but true for too many!) to “Do I want to live here?” (which just makes it harder).

I’ve had a fantastic run at Berkeley, and although there’s plenty I don’t agree with and plenty I’ve loved, I came out on top overall. But now that I need to again ask the question of where to go, life gets a lot more complicated really quickly!

On the plus side, it is President’s day, so maybe I’ll spend some money on two new monitors to complete my 4-screen desktop setup. Hmmmmmmmmm how does 3800 by 2400 pixels on your desk sound?

Valve Complete Pack

I made the plunge and shelled out $99.99 for the Complete Valve Pack, which includes a list of games to keep anyone busy for many hours. Too many of my roommates are playing Left 4 Dead, and if you’re going to spend money, this is a sweet deal to get everything! Counter strike, the Half-Life series, and of course Portal are such fun and innovative games (if not quite revolutionary) that this collection gives it all.