Nomads and Racers on Two-Lane Blacktop

&& [ Movies ] && 0 comments

Two-Lane Blacktop

I remember sliding into the passenger side of my good friend Michael Smelser’s 1973 Chevy Nova in Albany, Oregon. The first thing I noticed was there wasn’t much car - at least not much in the way of cupholders or GPS units. Instead I was sitting on a lightly padded bucket seat surrounded by a bare metal frame and unsafe looking glass. To my left was a shift nob, an extremely minimal steering column and what I hoped to be a competent driver.

The Nova roared to life and I suddenly found myself in a world of deafening, explosive sound and a vibration so violent I thought my organs were going to shift places.

The smell of exhaust all of a sudden became overpowering and immediately I understood that I loved the car.

Two-Lane Blacktop is a film that hails from the time of the Nova - the long past days when gas was $0.10 a gallon and cars were made of actual metal. Days before three letter acronyms like EPA and MPG entered the lexicon of the automotive industry or of their star spangled consumers.

But what I mourn the loss of the most is the pre-interstate American landscape. When we traded in our highways for freeways we gained speed and efficiency, but we lost any meaningful interaction with our surroundings while we travel.

Two-Lane Blacktop is good simply as a time capsule of when long distance car travel in America meant driving through towns instead of over them. Many of the locations shot during the film are in towns that nowadays are nothing more than the end of some forgotten freeway exit, dying or gone completely.

The film has more to offer than muscle cars with it’s unusual narrative and interesting cast. The nomadic “Driver”, “Mechanic” and “Other Driver” were all musicians in their time (including Dennis Wilson from the Beach Boys) and “The Girl” is played by the beautiful Laurie Bird, who tragically passed away just a few years later at the age of 25.

The plot starts out simply as a race across the country between two vehicles (Brock Yates, organizer of the Cannonball, cited the film as an inspiration for the race) but quickly morphs into something completely different, with the race itself becoming nothing more than an afterthought by the end. The movie is extremely heavy with metaphor and contains minimal dialogue and a nearly non-existent soundtrack.

Not for everyone, but personally I give this film a 5/5.

Cryptonomicon

&& [ books ] && 0 comments

When I first pulled Neal Stephenson’s Cryptonomicon out of the Amazon box, I was a little intimidated. The book is heavy - physically. I was a little skeptical about the idea of finishing a 1100 page novel, but I’m glad I decided to go for it. This book is well worth the time.

Speaking of time, I could go on a lengthy review but there are better written ones out there, so I won’t waste your’s. I would like to note some neat stuff that I either learned from Cryptonomicon or subjects that I became interested in as a direct result of reading it.

Van Eck phreaking actually exists

Van Eck phreaking is the process of gathering information on the contents of a screen by detecting it’s electromagnetic emissions. It doesn’t sound easy, but there have been several proof of concepts - one of which was performed in a vehicle parked across the street from a house containing an LCD monitor. Beware of creepy vans.

WWII era submarines were pretty cool

I suppose my mental image of submarines was always that of the cold war stealthy black nuclear cucumbers that rarely surfaced. Far from the truth. The first submarines actually looked more like boats and spent most of their time on the surface - diving when necessary in order to evade enemies or attack them. 1,155 German U-Boats were put into combat and 725 were sunk equaling a death rate of 82% - the highest death rate of any armed forces in modern war. Yet they were also extremely effective, at least initially. Over the course of the war, German U-Boats sunk over 2,900 allied ships.

Remember the Pacific theater?

History class and pop culture about World War II seems very Euro-centric. My knowledge of what went down in the Asia-Pacific was pretty pathetic. Douglas MacArthur was a total badass, as were many Filipinos. The Japanese did atrocious things during the war and in many ways they were worse than the Nazis. I finally understand the argument for using The Bomb against Japan. With the way the Japanese fought relentlessly to the death in every way (surrender really wasn’t an option) a mainland invasion of Japan really would have been horrendous. Whether it would have been worse than the appalling use of nuclear weapons is still unclear to me.

Codebreakers won the war

If you haven’t read about Bletchy Park and the Enigma machine you owe it to yourself. I became familiar with both during my previous read but I enjoyed some of the fanfare that Stephenson concocted for Cryptonomicon regarding the amazing contribution of the cryptanalysts at Bletchy Park to the Allies’ eventual victory.

All in all a great read about Nerds in World War II and their nerdy offspring in the 90s. I would recommend this book to anyone who is interested in math, cryptography and history.

Goodbye Wordpress

&& [ code ] && 0 comments

For the past 6 years this blog has been running off the same Wordpress install on a 1&1 shared hosting account without interruption. It was a good run, and speaks to how well Wordpress upgrades work.

But a Wordpress install is just so uncool. I decided to hop on the Jeykll train. This blog is now 100% static, which is pretty refreshing after years of dealing a massive PHP application. It doesn’t even require a database and it allows me to tweak to my heart’s content. Wordpress always seemed like a bit of a black box. Sure, the code was there, but it was daunting to even think about touching it.

Certain things become more complicated with Jekyll, since by default pretty much everything is done manaully. The most trivial being just creatig a post. Manually you will have to create the file, name it correctly, and then upload images, and link to them. Not a great workflow if you just want to write a quick post. So I created a rakefile that takes care of some of these tasks for me. The real timesaver is creating a folder in _images/ for each post, and then syncing them with s3 with the s3sync task:

{{< highlight ruby >}}

desc ‘create new post. args: title, category’

rake new title=”New post title goes here” category=”category”

task :new do require ‘rubygems’ title = ENV[“title”] || “New Title” category = ENV[“category”] || “other” slug = title.gsub(’ ‘,’-‘).downcase

TARGET_DIR = “_posts”

filename = “#{Time.new.strftime(‘%Y-%m-%d’)}-#{slug}.markdown” image_dir =”_images/#{Time.new.strftime(‘%Y-%m’)}-#{slug}” path = File.join(TARGET_DIR, filename) post = <<-HTML


layout: post title: TITLE date: DATE categories: CATEGORY


HTML post.gsub!(‘TITLE’, title).gsub!(‘DATE’, Time.new.to_s).gsub!(‘CATEGORY’, category) File.open(path, ‘w’) do |file| file.puts post end puts “new post generated in #{path}” system “mkdir #{image_dir}” system “geany #{path}” end

task :s3sync do system “s3cmd sync _images/ s3://pedaldp/images/ -P” end

{{< / highlight >}}

This post was written in a text editor. It will be published to my vps with a git push deploy master. Cool.

Sort Table of Contents Style Strings In Java

&& [ code ] && 0 comments

This is for when you have String likes “1.1”, “1.2”…”1.10” such that you want “1.10” > “1.1”. Just another example of terrible code programmers have to write when people insist on presenting data in illogical ways.

{{< highlight java >}} private static class TocComparator implements Comparator<String>{ public int compare(String s1, String s2){ Integer s1front = Integer.parseInt(s1.substring(0, s1.indexOf(‘.’))); Integer s2front = Integer.parseInt(s2.substring(0, s2.indexOf(‘.’))); if(s1front.equals(s2front)){ Integer f1ass = Integer.parseInt(s1.substring(s1.indexOf(‘.’)+1)); Integer f2ass = Integer.parseInt(s2.substring(s2.indexOf(‘.’)+1)); return f1ass.compareTo(f2ass); } else{ return s1front.compareTo(s2front); } } } {{< / highlight >}} This class is a comparator which can be used with Collections.sort()

Playing Around With Codepen

&& [ code ] && 0 comments

See the Pen Dripping WD-42 by Austin Riba (@WD-42) on CodePen

 

Bikes Planes and Automobiles - Riding the Chilcotins

&& [ cycling ] && 1 comments

header

The B.C. province of Canada should really be short for Best Cycling.

Recently I had the opportunity to get out of Whistler and go for a 3 day trip into the Chilcotins. The journey involved driving north on the Sea To Sky, hooking a left in Pemberton and hurtling over a mountain pass on a notorious forest service road. Just as you think the land can’t become any more sparse of society, the Tyax Wilderness Resort pops into view from around a bend in a scene eerily reminiscent of the one in the opening credits of The Shining.

Camp at the Tyax resort was comfortable with plenty of company during the weekend. The sites are located next to the lake, with water and electric hookups. The lodge is right next door with a full bar and restaurant. They even sell day passes for the spa for $20 if you’d like to camp in luxury.

The first day’s ride was an enormous XC route which took us from the lake and wound us all the way up to Camel Pass. The route is easy doubletrack most of the way, until you turn off the main road on to singletrack and begin to gain altitude rapidly. By now you are above the tree line, and breathing becomes noticeably more difficult. The trail is perfect singletrack, barely wide enough in places to fit a tire. After an amazing and somewhat steep decent directly after summiting Camel Pass, you climb again. Then you begin to doubt you are not lost when you descend again. And then climb again. And then descend again. All in all this route had over 5500 ft of elevation gain with plenty of hike a bikes and tough terrain. Not for the feign of heart or beginners to the sport.

After passing out at 8pm, it was time to wake up again and get on the Floatplane! This was the day we had all been waiting for. We were booked for one of the last flights, and our anticipation grew with every takeoff and landing of the plane before us. Once we all weighed in and stuffed ourselves and our gear in the plane, it was off to Warner Lake. Pretty amazing experience, being shuttled by aircraft. But the the real cream filling was the ride. Again, perfect singletrack all the way down. You pass many pristine lakes, wilderness camps, and grizzly tracks. All in all ~5000 feet of descending with ~3000 feet of climbing thrown in to keep you earning it. Nothing too technical, but plenty of extremely high speed singletrack that seems endless. It’s hard to stop on this ride with the weight of your own dusty grin seeming to pull you down the trail - fast.

Of course our van broke down and we had to get  a tow out of Tyax, but that just added to the adventure. All in all, amazing trip. Would repeat!

{% flickr_set 72157635929089523 %}

Shaftoe - A Simple Web Service for Encrypting Messages Using PGP

&& [ code, featured ] && 0 comments

Wouldn’t it be awesome if we starting seeing websites like this?

signup

I usually hear people say they don’t use PGP because nobody else does. A fair complaint - PGP isn’t exactly easy to set up and without the proper motivation it’s hard to convince the people you communicate with to use it too.

But PGP isn’t so hard to set up that our machines can’t use it to send us messages. If someone wants their email send to them encrypted, it really should be as easy to tell the app in question to use their public key either by providing it or looking it up via PKI.

Shaftoe is a proof of concept of how that can be done. It’s a simple webservice, 2 methods only: one for storing keys, and the other for encrypting text using those keys. The bare minimum needed for encrypting email with PGP. You can find instructions on how to download and run it yourself on Github.

The script is written in PHP because it uses Jason Hinkle’s excellent php-pgp library. This was the only decent and working OpenPGP implementation I could find that doesn’t require a compiled binary and all it does is encrypt. In fact it works very well.

Below is an example using the service. It asks you for an idetifier and your public key in ASCII format, then returns a random encrypted quote.

The service could just as easily be used by an application to encrypt email before sending it.

View outside of Iframe

Details and installation instructions can be found on Github

The Code Book Companion

&& [ code, featured ] && 0 comments

I’ve been on a cryptology kick recently, which is really no surprise. With all the recent news about domestic surveillance and services providing private communication being forcefully shut down, I have to admit my sympathy for the foil hats has increased considerably.

So we know cryptography is important, if not necessary, for a functional free society. But it’s also really ‘effin cool.  The world of cryptography is an even mix of mathematics, information science, and civil disobedience. What’s not to love?

Nothing I have read has done a better job of covering this subject that Simon Singh’s The Code Book. Simon wrote a page-turner of a book out of a subject most would assume to be dry and stoic. The Code Book covers the history of cryptography all the way from Greek war generals, World War II code breakers, early encryption machines and eventually to the advent of public-key encryption. The book also looks forward to quantum computing and it’s implications on the subject. Although published in 1999, the book remains extremely relevant. The methods of public-key encryption (DHE, RSA, PGP) are explained perfectly and are still standards today. The only time the book shows it’s age is the lack of a mention of Elliptic Curve Cryptography which was proposed in 1985 but is just now gaining popularity as an alternative approach to public-key cryptography.

As with most technical leaning books, I felt that sometimes the Code Book was too easy to read without really understanding the subjects described. Indeed, Simon does such a good job of portraying the human aspect of cryptography that often I just wanted to know what would happen next to whichever mathematician/social dissident/treasure hunter was currently the subject. So I decided to slow myself down.

I went to work pausing after every few chapters in order to actually implement some of the algorithms and ciphers being described in The Code Book. The result is this small website where I placed them for anyone who is interested. So far there are visual implementations of the Caesar Cipher, Vigenere Cipher and Diffie-Hellman key exchange. There is also a tool to perform frequency analysis on two texts and compare the results.

Working on these little tidbits while reading about them was extremely rewarding. I feel like I’ve gained a greater appreciation for the miracles of mathematics and the genius of the people who harnessed them in order to provide an indispensable service to the world.

I’ve finished the book now, but I plan on writing more implementations. Possibly RSA? A version of Diffie-Hellman using elliptic curve cryptography? We’ll see.

www.toxiccode.com/codebook

The code for the page is available on Github.

Oven Training

&& [ Cycling ] && 0 comments

103degrees

Graphing the Tour De France

&& [ Cycling, Code ] && 0 comments

Two things are going on right now:

  1. The Tour De France.

  2. I need to learn a new charting library.

I started looking around and Highcharts seemed like a nice JS solution with a complete API. It does require a license for commercial use, though.

At the same time, I found a bunch of cool historical data on the Tour De France. I set up a MySQL database, made a few PHP pages, and here we have the results.

The most interesting metric is the average speed of the winner over the years. It is amazing to see the acceleration, though there appears to be an plateau or possible even a decline in the last few years. Doping possibly?

What ages are winning the tour?

And the obligatory wins by country:

Now, back to watching the races.