337 miles of 1337ness

Posted in Uncategorized on May 29th, 2009 by djurek – 1 Comment

Earlier this week I hit 337 miles of bike commuting. Cuz that’s just how I roll.

Commute stats - 337 miles

Commute stats - 337 miles

Milage is conservatively estimated estimated based on some cracked out computer’s idea of how I bike to work. Actual distance is a little higher.

Gas milage is also very conservative given the stop-and-go nature of city driving.

I do, however, get about 50 miles to the power bar on my bike. 337 that.

Protect Yourself from Swine Flu

Posted in Personal on May 1st, 2009 by djurek – Be the first to comment

Swine flu is running rampant in the hearts and minds of people across the world. To aid in calming the pandemic paranoia, I have assembled a simple guide that may save your life. Remember, more lives than your own may depend on your actions. 

Each step is important and must be performed in the listed order. Do not skip any steps. 

Swine Flu Preparations

Step 1: Get Supplies

For this to work, you will need:

  • A particle mask that is not rated to protect you from anything but indirect exposure to spray paint
  • A marker capable of writing on the particle mask

 

Step 1: Supplies

Step 1: Supplies

Step 2: Preparations 

This step requires several actions and is the most complicated step: 

  1. Turn the mask inside out (typically less writing on the inside)
  2. Draw a pig snout over the place where your nose goes 
  3. Write “OINK” on the mask so people know what’s going on

 

Step 2: Prepare

Step 2: Prepare

Step 3: Protect

Now that your mask is ready to go, put it on your face. Be sure to cover your nose and mouth to maximize the amount of air moving through the mask. 

Warning: Don’t wear the mask for long periods of time; you’re inhaling fumes from the marker. Only wear the mask in short stents when it’s likely to get the biggest reaction from the folks around you. 

 

Step 3: Protect

Step 3: Protect

Congratulations! You’re now protected from the hysteria that is Swine Flu. 

 

Parting thoughts 

Really? Are people really that concerned? If you are, then turn off the AC and hang up the plastic. Folks disseminating the news are interested in protecting their jobs in the wake of all this transparent accountability. In the world of work we call this “covering your ass.” Sometimes you just need a little more time and information. 

Is Twitter to blame? Not for the mass hysteria. If you don’t recognize an Internet meme when you see it, please learn more

More stuff on Twitter 

Interestingly enough, we are witnessing a very effective method of broadly disclosing information to the public. Twitter represents the emotional pulse of the millions of users who grasp its purpose. This  is certainly worth study.

The Internet is, once again, changing the way we interact with our world. The question is no longer what are the implications of increasingly connected systems, rather what are the implications of increasingly connected people?

Happy Birthday

Posted in Personal on April 23rd, 2009 by djurek – Be the first to comment

For those of you who don’t know, I’m 23 today. One step closer to being older than I was one step ago. Age doesn’t concern me in my youth, though it is disturbing how quickly these 20’s are moving. 

Yesterday was Earth day and tomorrow is my friend’s birthday. I can’t think of a better time to be born. 

If you have too much time on your hands, check out what other wonderful and not so wonderful things happened today. I’ll summarize the main points below: 

Births

1564 – William Shakespeare, English writer and actor (d. 1616)

1923 – Dolph Briscoe, Governor of Texas

1958 – Hilmar Örn Hilmarsson, Icelandic music composer

1987 – Emily Fox, American cupstacking champion (how she got in Wikipedia amazes even me, I need my own page)

Deaths

303 – Saint George, Roman soldier and Christian martyr

1124 – King Alexander I of Scotland (b. 1078)

1616 – William Shakespeare, English writer and actor (b. 1564) (date according to the Julian calendar, hence 10 days later than death of Cervantes or Garcilaso, by the Gregorian calendar)

2007 – Boris Yeltsin, first President of the Russian Federation (b. 1931) (sad to see you go, Boris)

Holidays

Canada Book Day

UNESCO International Day of the Book in honor of the death of both William Shakespeare and Miguel de Cervantes on April 23, 1616.

 

Closing thoughts

If Boris Yeltsin and Shakespere kicking buckets isn’t enough reason to celebrate then just remember that you can make it into Wikipedia if you stack cups. 

Incidentally, Warren Zanes of the Del Fuegos doesn’t have his own Wikipedia page either (though his wife, April March, does have a page). Zanes, you and I are one of a kind: famous without the fame.

Seattle’s Springtime

Posted in Uncategorized on April 15th, 2009 by djurek – Be the first to comment

Beauty always promises, but never gives anything.  -Simone Weil

Sometime around when the rest of the world is blooming, the weather here takes an interesting turn. A merciful display of care as the heavens open up, pause the rain, and pour forth a morsel of sunlight. It may just be a drop, but it’s enough to send citizens bustling into the sidewalks and streets. Best to apply sunscreen for skin will certainly combust in the face of so many photons. Now venture forth and join all the Seattle polite* folks out there; this reprieve will not last.

They typical Seattle skyline looks like something out of a game environment with the sky switched off:

 seattle-sky-simulation

Depth of field gives way to an endless, uniform grey. Don’t bother looking for the horizon, you won’t find it.

But on this beautiful tax day, as others were celebrating a Boston tea party, I found the texture and blue in the sky promising and invigorating. 

Maybe it was the caffeine from all the tea I drank at work, maybe it was something else. Something more primal. I raced home in a frenzy, music cranked to the max, tolerance for slow drivers to the min.

Like a drug addict clambering for a fix, I <events involving tight shorts removed> and was out on the street in short order. My blood cooled from boiling as my legs pushed the pedals.

Flying best describes it. Good, zero-carbon-footprint, old-fashioned, <tight shorts reference removed> fun.

Crossing the I-90 bridge was a little ironic when I waved at and passed cars traveling on the highway. On the other side was a beautiful view of Mt. Rainier:

The camera in my phone is admittedly not very good. But you can see something undeniably beautiful: a blue sky over Seattle.

It won’t be long before we’re stuck under Edgar Allen Poe’s oppressively low hanging clouds. This kind of weather won’t come around again until July 5th.

For one moment, on this day day, I snatched a few rays from the sky and called them my own. And beauty delivered on its promise.

* Seattle Polite is a behavior observed frequently in the northwest. It is characterized by an overt and impractical attempt to display niceness. Typically requiring little or no effort on the displayer (see this blog entry for example and analysis).

How to: Pass a Cyclist While Driving a Car

Posted in Personal on April 8th, 2009 by djurek – 1 Comment

There are many reasons to complain about driving in the Seattle area. This is one such particularly compelling story.

For those of you who aren’t aware, many drivers in the Seattle area demonstrate an uncanny proficiency in inattentive, dangerous, drunk, and distracted (not the same as inattentive) driving. These make for a rather hazardous environment for cars, bicycles, and pedestrians alike. (Annecdotally: nearly every time I drive at night, I observe at least one car with its headlights turned completely off.)

I was riding home from work today (4/8/2009) along the well regulated streets of Bellevue. The ride was smooth by comparsion to other rides with a surprising amount of legal compliance on the part of car drivers. Two blocks away from home, I found myself impressed with the drivers around me. Nobody unnecessarily endangered my life. Until…

Brrrr WOOSH!Millisecond reflexes saved my life as an individual driving a grey Infiniti (license plate 953-RCV, male driver in his twenties, brown and bleached yellow hair) shot past. Another inch and his rear view mirror would’ve struck my elbow. The adrenaline took hold. Obviously, our kindly driver was not in full understanding of his actions.

I stomped on my pedals to catch up. The driver parked at the next intersection. Most folks don’t know what they’re doing when they do something stupid, I reasoned to myself, perhaps I should explain myself to the driver. By now, I reached the driver who was parked at the red light. Cautiously, I sidled along side the driver’s window which was cracked slightly.

“Pardon me, sir, do you realize how dangerous that was?” I said, keeping my cool. “What?” came the reply. “Do you realize how dangerous and illegal that was?” my voice elevated slightly. “Then you shouldn’t be on the road,” the kindly driver stated nonchalantly. The light turned green, he sped off.

Stunned, shocked, fascinated. I was these things. How does a driver demonstrate such willful ignorance?

RCW 46.61.110 states (interesting part in bold):

The following rules shall govern the overtaking and passing of vehicles proceeding in the same direction, subject to those limitations, exceptions and special rules hereinafter stated:

     (1) The driver of a vehicle overtaking other traffic proceeding in the same direction shall pass to the left thereof at a safe distance and shall not again drive to the right side of the roadway until safely clear of the overtaken traffic.

     (2) The driver of a vehicle approaching a pedestrian or bicycle that is on the roadway or on the right-hand shoulder or bicycle lane of the roadway shall pass to the left at a safe distance to clearly avoid coming into contact with the pedestrian or bicyclist, and shall not again drive to the right side of the roadway until safely clear of the overtaken pedestrian or bicyclist.

     (3) Except when overtaking and passing on the right is permitted, overtaken traffic shall give way to the right in favor of an overtaking vehicle on audible signal and shall not increase speed until completely passed by the overtaking vehicle.

Even lawyers would have trouble finding a way to construe almost killing me as a “safe distance.”

Lesson Learned

If you ever find yourself in a car needing to pass a cyclist, please observe a couple simple rules:

  • Unless it’s unsafe, impossible, etc. give the cyclist 3 feet of room while passing.
  • Don’t almost hit the cyclist.

We all want to get where we’re going. We want to get there on time. Most of us want to get there alive.

To the driver of the Infiniti: you are truly a precious snowflake. Don’t be a dumbass snowflake. BTW, my carbon footprint pwns yours. Kthxbai!

SSL in C# using SslStream

Posted in Business on March 27th, 2009 by djurek – Be the first to comment

SSL is cryptic. This tutorial will get your C# program communicating in SSL using SslStream.

Note: Please leave a comment if the code is unreadable. WordPress seems to have entirely busted preformatted text. Even if you use HTML mode.

SSL encrypts communication between two nodes (a client and server). Without going into too much detail, SSL requires that the client authenticate the server against a list of trusted providers before communicating (think VeriSign, etc.). The server can authenticate the client, but that is typically not necessary in most communication scenarios.

To learn way too much about SSL theory, see SSL in Wikipedia. Fortunately with .net, you don’t need a complete understanding to implement SSL.

Shout outs

I would like to thank the folks who finally showed me the light:

I’m basically pulling together the things that they wrote into one easy place.

Getting started

You will need to download Microsoft Visual C# Express to code this. Depending on your install directory, you can find makecert.exe in C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin.

C# coding for SSL is simple but it requires some preparation. Since SSL is based on trust of certificates issued by root authorities, you will need to:

  1. Create your own root authority
  2. Create a certificate using that authority
  3. Set your client machine to trust certificates signed by the root authority you created

Making a certificate

Remember that you need to buy a certificate from a trusted root authority before your apps will work in the mainstream. This tutorial will get you working in a test environment.

Start the MMC to manage local certificates:

  1. Start > Run > type "mmc.exe" > hit enter
  2. File menu > Add/Remove Snap-in > click the Add button > Select "Certificates" > Press "Add"
  3. Select "Computer Account" > Click Next > Select "Local Computer" > Click Finish
  4. Click Close button > Click OK

Now things should look like this:

Certificates window in MMC

Fire up a command line to create certificates:

  1. Start > Run > "cmd" >hit enter
  2. cd "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin" > hit enter
  3. Replace the parameters between %’s with your own names. Make sure %root_authority_name% matches in both instances.
  4. C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin>makecert -pe -n "CN=%root_authority_name%" -ss my -sr LocalMachine -a sha1 -sky signature -r %output_filename%.cer
  5. C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin>makecert -pe -n "CN=%certificate_name%" -ss my -sr LocalMachine -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -in "%root_authority_name%" -is MY -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 %certificate_output_file%.cer
  6. If each of the commands reports "Success" at the end, congratulations! You now have a root authority and a signed certificate. Check in the C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin folder to find the two new .cer files you just created.

Meanwhile, you should see the following changes in your console under the Personal folder (you may need to refresh):

Certificates created and added to the store

You will also notice the presence of a couple .cer files in the C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin folder. One for your root authority and the other for the certificate you generated.

In this case, the "Daniel Root Authority" certificate is the root authority that issued the certificate. The "mdumps" certificate is the certificate I issued to my test server machine. For this test, my server will use the mdumps.cer file as its SSL certificate. The client machine I am using must trust the root authority to trust the certificate.

To make the client trust the root authority, copy the root authority certificate into the "Trusted Root Certification Authority" folder on the client:

Copy the root authority certificate to the trusted issuer location. This must be done on all clients that will be communicating with the server.

You will need to copy the root certificate into the trusted location of every client that will be running your server.

Writing some code

Now the coding begins.

For simplicity, you may download my sample project with the code to get this working. You will need to copy your server certificate file (.cer) into the running directory of the executable. Also, change the hostname and certificate strings to match your configuration.

Use the following namespaces for creating sockets, encrypting communications, and storing certificates:

using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

The server

When a server instantiates an SslStream object, it must link that stream to the certificate for authentication and encryption. A simple example:

// Load the server certificate
X509Certificate serverCert = new X509Certificate(certificateFilename);

// Start listening for a connection
Console.WriteLine("Server: waiting for client connection.");
listener.Start();
clientConnection = listener.AcceptTcpClient();

// Once a client connects, associate it with an SslStream
Console.WriteLine("Server: Client has connected.");
secureStream = new SslStream(clientConnection.GetStream());

// Set the server certificate
secureStream.AuthenticateAsServer(serverCert);

Please note that other methods of accessing the certificate exist outside of the filename method. In this case, the file method is the easiest.

The AuthenticateAsServer method will throw an Exception if it encounters an error.

The client

The client authenticates the server, in this case against the server’s hostname. Notice how the client does not load a certificate, instead it compares the server’s certificate with its list of trusted root authorities (that you set up in the MMC earlier):

// Connect
Console.WriteLine("Client: Connecting to server ");
client.Connect(serverHostname, serverPortNum);

// Authenticate the server
Console.WriteLine("Client: Authenticating server");
secureStream = new SslStream(client.GetStream());
secureStream.AuthenticateAsClient(serverHostname);

// Server has authenticated
Console.WriteLine("Client: Server authenticated!");

The AuthenticateAsServer method will throw an Exception if it encounters an error. It is possible to perform custom handling of the authentication on the client side, but that is beyond the scope of this article.

Sending and receiving messages

I wrote a couple simple methods that allow you to send a string of nearly any size. Note that the method first sends an integer (known size) describing the size of the message it will send:

static void SendMessage(SslStream stream, string message)
{
    byte[] messageLengthBytes = BitConverter.GetBytes(message.Length);

    // Send the size of the object
    stream.Write(messageLengthBytes);

    ASCIIEncoding encoder = new ASCIIEncoding();
    byte[] messageBytes = encoder.GetBytes(message);

    stream.Write(messageBytes);
}

static string GetMessage(SslStream stream)
{
    byte[] byteStreamSize = new byte[sizeof(int)];
    stream.Read(byteStreamSize, 0, sizeof(int));
    int streamSize = BitConverter.ToInt32(byteStreamSize, 0);
    byte[] messageOutput = new byte[streamSize];

    int offset = 0;
    while (offset < streamSize)
    {
        offset += stream.Read(messageOutput, offset, streamSize - offset);
    }

    string output = ASCIIEncoding.ASCII.GetString(messageOutput);

    return output;
}

Closing thoughts

SSL adds an extra layer of security to your communications, but it requires careful management of the certificate files. With this added layer comes added complexity. Fortunately, .net abstracts much of this work into an object that, with a little preparation, you can treat as any other Stream object.

Now you can focus on what your application is supposed to be doing!

Technologies Generation Y Will Replace

Posted in Personal on March 27th, 2009 by djurek – Be the first to comment

Nick Health has written a blog post on ZDNet about technologies that Generation Y will replace. I agree with many of his points. I disagree with some. The article is a great framework for briefly discussing the future.

Replaced technologies

Email

Nick asserts that the youths of today use email to communicate to the folks of older generations and little else. Having recently graduated college, I see where he’s coming from; I used email as little as possible. In college, Facebook, IM’s and text messages facilitated the majority of my interpersonal communication.

Now I work for my money. I assume much of Generation Y will too. Business requires a more robust and free-form environment for the communication of ideas. I can’t illustrate rich ideas in Facebook messages nor can I easily arrange meetings and reserve spaces using 160 character SMS messages. These tasks require a more versatile technology called e-mail.

If Nick is referring to the age-old model of POP/SMTP and text-only email, then I see where he’s coming from. Nick, we’ve already replaced these technologies. It’s entirely likely that we have a semantic disconnect here (see also: any two peoples’ definition of the cloud).

Websites

Right on! Most folks can’t author a web page, nor should they. Down with Geocities!

Datacenters

Based on the quote, Nick seems to think that all computing will become a utility (like electricity and water).

This is doubtful when considering that many government and private institutions will not tolerate the risk of downtime and disclosure. Especially disclosure.

I’m not averse to the idea of cloud computingsimply because the defnition is so nebulous. I do not believe that all private user and business data belongs in someone else’s datacenter. Though I do believe those people and institutions should be able to access their data anywhere.

Fixed line phones

Yes! Yes! You can see it happening right now. I only have a cellphone.

The personal computer

Ambiguity abounds. Nick seems to assert that personal computing sessions will live in the cloud, connecting through thin clients.

Most consumer PC needs could go to the cloud. OnLive, netbooks, and other technologies are questioning the necessity of computing power for consumer purposes. But the cloud will have to to deliver a lightning storm of rich user experience before users stop expanding their hardware.

I’d rather be writing this blog post from a netbook.

Traditional data processing

Nick promises that data will all be tagged and machine parsable. He points to XBRL as a solution. This reminds me of Tim Benders-Lee’s The Semantic Web, published back in 2001.

XBRL suffers from a heavy case of multi-institution collaborative scope creep. Human nature will sabotage these efforts as long as human nature persists.

Closing thoughts

I agree with Nick on many points, but I believe we should consider the practical implications of his many visionary points. Future technologies should:

  • Preserve privacy
  • Allow anonymity
  • Provide flexibility in input and representation
  • Be cheap and reliable

I’ll blog on these points and the cloud at a later date.

Speaking of the future, check out this cool video Microsoft published highlighting its vision. Who wants to take bets on whether 2019 will be this green and satisfying?

A Complaint Free Free World

Posted in Personal on March 11th, 2009 by djurek – Be the first to comment

I have ceased my complaint free world bracelet activity. Going in the metrics for success was a complaint free month. This was a very tough challenge and I learned many things along the way.

I did not reach my intended goal of 30 days complaint free. My longest streak was a short five days. But like so many other projects, I discovered that the “complaint free” aspect of my complaint free world attempt was hindering my ability to be effective in more important areas of my life. I did, however, learn several important lessons.

Think twice before letting something negative out

All too often I find myself focusing on the negative aspects of my world. This is especially challenging because sarcasm plays a large role in my ability to formulate humor.

If you don’t have something nice to say, reword it until it sounds nice.

It’s obvious

Most folks can find the things that displease them in this world on their own. Stating the obvious is an overrated skill. It’s much more interesting to state that which is not obvious.

Everyone can see that it’s cold and rainy outside.

I don’t care if you’re hungry

And you shouldn’t care if I am. Finding a solution to the problem is more important.

Give me the patience

Some things you can’t change. Most of the time the same problem is obvious to everyone else.

The economy is totally ready for some improvement.

Ah well.

Having said all of that, I can’t stand the way people in Seattle drive (I am also not alone in this opinion). The only way to fix the problem involves copious amounts of horn, fist shaking, and screaming with the window rolled down. I can’t take the time to teach you how to drive, but if I can scare you out of my way, I have saved us both the energy. And please, turn on your lights when you drive at night.

Not complaining was an interesting challenge and I think I have modified some of my behaviors for the better. Either way, I have helped myself to a little self help.

Sworn and Broken

Posted in Uncategorized on February 22nd, 2009 by djurek – Be the first to comment

I started writing a long review of the Dulli/Lanegan show. The one where I discovered that the grunge movement is aging, balding, selling insurance, and raising children on the Eastside. I went on about the middle aged man reduced to tears amid a mosh pit that died before it started; a lifeless dead audience shifting from one foot to another in disinterested mediocrity. I’ve filed my complaints with the appropriate parties and sworn to move on.

For your benefit, I will not post that review. It is long, and some may construe it as offensive.

Grunge is, for better or worse, best left in 1996.

Dulli on the left, Lanegan in the middle. This world isnt the one that we once lived in.

Dulli on the left, Lanegan in the middle. This world isn't the one that we once lived in.

Parts of the show were good. And I’ve moved on to exploring Seattle’s current music culture.

Introducing: Remnd.me! (Don’t forget)

Posted in Dynamic Mashup in the Cloud on February 7th, 2009 by djurek – Be the first to comment

Matt and I recently unveiled yet another Web 2.0 social media thought driver. After much toying with Twitter and recognizing that buzz tracking is important, we have developed what should be a memorable service.

Never forget

Never forget

Remnd.me is a link shortening service that adds click tracking to your links. Use Remnd.me to track the flow of your ideas as they spread across the internet. Sign up, log in, create links, and watch the buzz grow.

Remnd Me

Shorten URL's, track clicks. It's aweomse.