Archive for March, 2009
Peanut Butter Jelly Time!
Monday, March 30th, 2009Gabriella of Sun and Shadow
Thursday, March 26th, 2009Continuous Integration Testing, CruiseControl.rb, Github, Apache, and You!
Friday, March 20th, 2009“Ain’t no test like an elwoodicious test ’cause an elwoodicious test don’t pass!”
So one one of my co-workers thought it would be an awesome idea if we were continually reminded of our shortcomings regarding tests so he passed along a link to the CruiseControl.rb project. Getting up an running is a fairly simple affair, particularly if you are just running it locally, but we wanted to drop this on our QA server and have the dashboard served up via Apache. Not too difficult, just a couple more steps.
Grabbing the code is the easy part, git clone git://github.com/thoughtworks/cruisecontrol.rb.git.
Add your project, ./cruise add Project-Name -s git -b branch-name-here -r git@github.com:username/project-name.git
Set up the configuration for your projects by editing ~/.cruise/site_config.rb. The file is largely self-explanatory but it would be helpful to set Configuration.dashboard_url and Configuration.default_polling_interval which are nested in the middle of the file.
Set up the defaults for each project, like getting emails and polling times, in ~/.cruise/projects/project-name/cruise_config.rb.
Now the fun part, we use Apache with passenger so the tact we took was to install mongrel and configure Apache’s balancer to look for it on a specified port as well as password protect the app with basic authentication:
Edit your site file and add a virtual host…
<VirtualHost *:80>
ServerName cruise.mydomain.com
ServerAlias cruise.mydomain.com
Include /etc/apache2/sites-available/app.cruise
</VirtualHost>
Then create the app.cruise file with the following content…
ServerSignature Off
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
DocumentRoot /where/you/put/cruisecontrol.rb/public
<Directory “/where/you/put/cruisecontrol.rb/public”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthName “Secure Area”
AuthType Basic
AuthUserFile /where/you/put/.htpasswd
require valid-user
</Directory>
RewriteEngine On
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Lastly create a proxy.conf file in /etc/apache2/conf.d/…
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:8000
AuthType Basic
AuthName “Supa Sekrit”
AuthUserFile /where/you/put/.htpasswd
Require valid-user
</Proxy>
One all that is done you can cd into the CruiseControl.rb directory and issue, ruby ./cruise start -p 8000 –daemon, and you should be ready to watch your tests fail like me.
30 Days with the Roku Netflix Player
Tuesday, March 17th, 2009
With the recent inclusion of the Amazon Video on Demand service, and the talk about more services being available this year, this slim black box has gotten a little more indispensable and pulls the curtain back to reveal what life will be like after the cable and satellite companies pass fully into obsolescence.
The Netflix Player (now being re-branded as Digital Video Player to highlight its flexibility) is priced very competitively at $99 USD when compared to the other devices like Vudu and Blockbuster’s OnDemand which really kill their value proposition by charging per rental, the all-you-can-eat model of Netflix encourages you to explore and watch things that you might not normally or to re-watch shows like we do with our daughter–Word World at $1.99, 3 times daily, 7 days a week can add up quickly. Now, Amazon VOD is positioned in a similar way as Vudu and Blockbuster so we really haven’t dipped our toes into their waters just because the idea of “buying” movies that are “stored” on their servers leaves us a little uneasy because that purchase is more like a “lifetime” lease for their service goes away your purchase goes with it. Subscriptions just “feel” like more bang for my buck, I suppose.
Arguments aside for rental or subscription, the Netflix Player is fantastic. It is stupid-simple to set up from hooking it up to your TV, updating the firmware, and authorizing it with Netflix and Amazon. In our case, we hooked it up to a 10 year old 19″ TV in our bedroom and it looks and performs great with no lag in playback and a clear crisp picture.
The Netflix experience is much better than we had anticipated with the movies in our queue browsed in a coverflow-like implementation and while that might sound clunky we can easily flip through the some 250 items in our queue with little to no problem. What we would like to see, though, is the ability to make shelves for those titles so that we can quickly scan by genre, keyword, or even alphabetically. Once you find a movie selecting it brings you to a synopsis and the ability to play it either from where you left off or at the beginning and if it is a TV show you can select which episode to watch. On our DSL connection (6 Mbps/768 Kbps) buffering the movie takes a little under a minute but after that there are no hiccups and the picture does not have the same type of blocky pixelation that we often find on our Mac Mini using Silverlight.
What has us excited though are the mysterious 10 new services to make an appearance by years end. Management and I have been speculating about what services are next to come and while YouTube is likely we would love to see Hulu make an appearance. The recent kerfuffle with Boxee could be an argument for or against, one can never tell when it comes to entertainment executives and their whims but Hulu on the Roku would be a coup for Internet delivered entertainment. The more services available to the Roku the better as it might spur more companies to open up to more platforms and let their gardens grow over the walls.
Pros
- Small set-top box
- Comfortable remote
- Easy set-up
- Responsive navigation
- Hiccup free viewing
Cons***
- No search
- No finding movies outside of queue
- No sorting by genre or title
Bottom-Line: $99 + $9/month at Netflix is money well spent.
*** This are more cons regarding the implementation of the Netflix service as we really have not felt compelled to explore Amazon’s due to the cost of à la carte viewing.
Save your database (and your bacon) with Elastic Block Store and mysqlcheck
Monday, March 16th, 2009Here’s the situation: early this afternoon I get a panicked IM from a client that they dropped a table on the production db but that they have a CVS copy that they want to load. Sounds easy, right? Should have been but the CSV file had some oddities where lines were terminated by \n but those also existed in some of the fields. Now, I am by no means a MySQL guru and while there might be a solution to issue a LOAD DATA INFILE statement that accounts for it the process of working around that would keep the site down longer than necessary.
When we setup the database on EC2 we made a conscious decision to move the database into an Elastic Block Store (EBS) so that we could take regular snapshots of the volume as well as enjoy the durability that they offer. The approach that we took to recovering the table was to re-purpose one of the QA instances as a recovery point, create an EBS volume from the latest snapshot, point MySQL at it, dump the table with –complete-insert, source it in, call it a day.
Things were working swimmingly up until the point where I needed to dump the table, ERROR 1033 (HY000): Incorrect information in file, was the last thing I wanted to read. The table is InnoDB and it is possible that it was corrupted when I started the server back up with some missing variables in the my.cnf file–lesson here is remember to breathe, work quickly but methodically, and double check your work. So here I sat with a seemingly good copy of the database but a mangled table.
Just a handful of keystrokes saved my ass: mysqlcheck mydb mytable.
If we had been doing just whole database dumps with mysqldump this process would have been frustrated by trying to chop up a 12GB file into the section that we needed (yes, it makes more sense to dump each table seperately but remember, I’m no guru). In the end, having a volume that we could mount and access withing minutes was the biggest reason we were able to get the production site back online as fast as we did and for future reference I’ll check my config files more closely before I turn on services.
***Note: this really only applies if your database runs in EC2
I Love Kutiman
Wednesday, March 11th, 2009I often get excited about new things everyday exclaiming their life changing properties but Kutiman is something different. DJ Shadow’s album Entroducing… shattered all my ill-conceived notions of art and music and clear my mind for the notion of cutting and pasting sound collages, Kutiman takes that to the next logical step by mining YouTube videos for melodies and rhythms and then stitching them together to form hilarious Funk breakdowns, grinding Drum and Bass anthems, or haunting ballads.
My favorite track (video?) by far is I’m New as the vocalists are sublime…
Someday is a close second as Sarah Amstutz has a wonderful voice.



Comments
James, Dale
james, Mike
james, Mike, james [...]
james, Mike
james, Mike
james, Kyle Daigle