SF Cable Car Route Llamas, Alpacas and Mutants Fall Colors Mardi Himal Trail Golden Gate Zabriskie Point Prayer Flags Sunset Chinchero at Sunset Annapurna South in the Early Morning Fish Market Cementerio de Trenes de Uyuni Night Cats Sunset From Moro Rock Very rare deserted street Half Dome at Sunset Machhapuchhre Sunset from Marshall Beach, SF Grafitti The Danube at Night Annapurna South Under the Stars Mardi Himal Trail Rolling Fog Prepping to FIght Boudhanath Stupa Sheepherders and Annapurna South Cumhuriyet Anıtı Phewa Boats Alamo Square Bluebird Skies Stars Over Annapurna South White Mountains Sunset Fog Rolling In Half Dome at Sunset Vocano Scarred Mountains The Golden Gate at Night Old Man in Siding Twilight Fog Market Flags Bodie Eastern Sierras Under Shadow Snow and Shadows Temple Statue Marin Headlands Sand Dunes Hong Kong from the Peak Bay Area Sunrise Yosemite Fall Leaves Monument Valley Green River Canyons at Sunrise The Blue Mosque Buildings and a Bridge Cropped Crosswalk Headfirst Pisac Hillside The Buttermilks Rooster Fights at Forest Camp Resting Zabriskie Point Photographers Annapurna South

GCalendar Reminders

January 17, 2010 —

Google recently added the ability to create a birthday calendar. However, Google didn't give one the ability to send reminders for the events on that calendar. This is the same thing that Apple has done for years with their Address Book and iCal integration. And I hate missing someone's birthday when I don't happen to look at my calendar that day.

I saw this as an opportunity for improvement. I also saw this an opportunity to learn about Google App Engine. So I wrote a python application that lets you schedule email reminders for the Contacts Birthday Calendar. In addition, you can select a specific hour in a specific time-zone to send the reminders at as well. The application use's the Google App Engine user authentication and the Google Data AuthSub permission request API to get upcoming events for display and email reminders.

This gave me some good experience with Google App Engine's scheduled tasks and Task Queues, as well as a chance to hone up on my Python. Without further ado, I present GCalendar Reminders. Feel free to use it to send yourself emails using the security of Google App Engine.

Benchmarking Redis and PRedis

January 15, 2010 —

At work, I recently was tasked with looking into some NoSQL solutions for upcoming projects. For various reasons, I focused on the open source Redis project. Redis looks to be adding new features quickly and seemed to be a great potential solution.

I then started looking into PHP clients as our current environment is mostly PHP. We require that the client support consistent hashing, and, from a quick search, a couple turned up. PRedis seemed to offer the most potential, and after some quick tests, also seemed to offer the greatest performance. So I set up a more elaborate benchmark of the the client and server package.

My test setup involved using 5 servers with between 2 and 5 enabled at a time on the clients (ie. I disabled up to 3 of the servers in the client configurations). For performance, I configured the servers to never write to disk, though periodically syncing to disk should not cause too much of a performance loss. In fact performance was most greatly affected by forcing an fsync after every write. I then had 9 other client boxes running the same code base, with all 9 enabled for each test.

Each client would start a master PHP process that forked 20, 30 or 40 child processes to simulate greater and greater load. Each forked PHP process then did 10,000 SETs on random keys with 4 byte payloads (early tests showed that payload size didn't drastically affect the results). I was using the PHP 4.2.6 branch of the PRedis client, and had optimized it a bit so that it did fewer counts of the consistent hash array. I made the optimizations based on some results after profiling the code. I then had the master PHP process on each box repeat ...

read more

GMail IMAP Backup With mbsync on Ubuntu

April 30, 2009 —

Well, it sure has been a while since my last post on here. So I thought I'd kick it off with a discussion of how I went about getting my email backed up.

First, a description of my situation. I run all my email through GMail. I enjoy the interface and the fact that it is a cloud service; I can access my email seamlessly on my phone, my home computer, my work computer, some other computer, etc. However, I don't want to lose all that information. Google is great, but who is to say that something terrible won't happen and some (or all) of my mail is lost? So I wanted to setup some sort of backup. And then once I got that setup, make it automated.

At home, I run an Ubuntu box, that I just upgraded to 9.04, Jaunty Jackalope. This machine primarily serves as a media box, hosting video that streams to my Tivo off the 1.5TB RAID 5 array. I also use it as a network mounted TimeMachine box as well. Since I have extra storage on it, I figured I'd get something to sync my mail over IMAP periodically, and then I have a nice little backup.

After some searching, I came across two sites that had instructions using the utility mbsync (formerly isync). I found that following the instructions worked pretty well, though I had to customize the patch provided to get it to work with the version provided by Ubuntu. And then I thought I'd detail my steps here for others to see.

  1. First, enable IMAP in your GMail account.
  2. Install the dependencies for mbsync:

    sudo apt-get install libc6 libdb4.8 libdb-dev libdb4.8-dev libssl0.9.8 libssl-dev
    
  3. Get the source for mbsync on Ubuntu ...

read more

Cache Miss

August 09, 2008 —

I posted on the 5th about how the travel page now shows all my travels. Well, I also mentioned that the page loads really slow. I'm happy to say that I greatly improved the processing bottleneck that existed. I implemented caching which has sped things up considerably. Previously, the travel page took ~7 seconds. The average time from start to finish of script execution on the page was 7.223 seconds, which is crazy long. I even saw execution times over 10 seconds! After turning on caching, I'm now seeing times from .572 to .7 seconds. This is a 10x improvement, and I know I can do even better, especially since this was a quick first pass at improving the page rendering time. Hopefully visitors to the travel pages will no longer notice that it is my side being slow, rather it'll be the javascript and google maps servers that are slowing down the page load.

The Color Oracle

June 16, 2008 —

So I'm actually color blind. Most people who know me also know this, and I always get the same questions over and over: "What color does this look like?" Or, "What color is this?". These aren't the easiest questions to answer all the time, because what I see looks normal to me. Red looks like red, blue looks like blue. The hard part comes in when I have to distinguish a color by its shade. For example, if someone put up something that was carmine, I would say that it was red and not know that it wasn't actually red, but a darker red (for those wondering, I had to look up what pigments of red were on wikipedia). However, if you were to put two swatches next to each other, one of which was red and one of which was carmine, I'm pretty sure that I could tell them apart, especially if there was a sharp line between the two.

The other interesting part is that I can't match colors. So I've always had trouble with picking out clothes, hence my distaste for shopping (for non-electronics items). But that is a different story.

A former co-worker decided to find out more information about color blindness and wanted to see what it looked like for me. My co-worker happened to come across this amazing cross-platform application called the Color Oracle. After running the application on your computer, you can change the entire screen to resemble what a color blind person is seeing. The application simulates three types of color blindness, deuteranopia, protanopia and tritanopia. Wikipedia has some good information on each of them. So back to the Color Oracle. After installing it, if I run it and check out what the three types look ...

read more