Jason’s musings

I just need a little time

Pimp

with one comment

Because there weren’t already lyrics for So F’ing Pimp:

I’m so Pimp it should be a crime
My site’s been slashdotted four seperate times
I can factor numbers into their constituent primes
Oh, and did I mention that I spit the dopest rhymes

My cotton sheets are three hundred thread count
I got overdraft protection on my checking account
I got dual flat panel nineteen inch screens
I got slim flit boot cut Levi jeans
I can solve a rubicks cube in ninety seconds flat
I know all the fatalities in mortal combat
I scored a fifteen ninety on the SATs
I got a masters degree from MIT
I got Office season three on DVD
And that’s why I’m a motherfucking P-I-M-P

[I’m pimp… So pimp…]

I code in Java, Lisp, C and Perl
One time I swear I even saw a naked girl
I wear boxer briefs from Fruit of the Loom
There’s a foosball table in my living room

I’m top of the line, first in the class
Leader of the pack, number one brass
It’s platonic truth, I’m like an ideal gas
Pretty as a picture and smooth as glass

I’m fast as lightning, strong as an ox
Fit as a fiddle and sly as a fox
Cool as a cucumber, in fact I’m ice cold
I’m fine as wine, I’m good as gold
I’m the best there is son, second to none
Cream of the crop, can’t be outdone

I’m sharp as a tack, bright as the sun
I’m sweeter than sugar, and twice as fun
I’m tough as nails, hard as a rock
Tip of the top, the cock of the wok

You know I’m honest as the day is long
And I’m so fucking pimp I had to write this song

[I’m pimp… So pimp…]

My HMO’s co pay is only ten bucks
My motherboard’s a sus-p-five deluxe
I got a quad band walkman phone
And you know I got a badass ringtone

I’m the head honcho, the daddy mack
I’m the numero uno, the leader of the pack
I’m the big kahuna, the top of the stack
Yo, if this were France, I’d be Jacques Chirac

If I were a perfume, I would be Chanel
If i were a prize, I would be the Nobel
If I were a hotel, I would be the Plaza
If I were an espresso, I would be Lavazza
If I were a number, I would be complex
If I were a watch, I would be Rolex
If I were Greek, they would call me Zeus
If I were a vodka, I would be grey goose
If I were a primate, I would be a chimp
Which is just a way of saying that I’m so fucking pimp

[I’m pimp… So pimp…]

Were I a play mode, I would be shuffle
Were I a fungus, I would be a truffle
A composer? I would be Bach
A bag? I’d be a Ziploc

Written by jasonmc

November 20, 2008 at 2:41 pm

Posted in nerdcore

Tagged with

Really achieving your childhood dreams

with 2 comments

The “Last Lecture” by Randy Pausch. A CS professor fighting pancreatic cancer.

Written by jasonmc

May 14, 2008 at 11:13 am

Posted in Uncategorized

Tagged with ,

SSH magic

with 5 comments

I’m currently bedridden at home from a nasty dose of the flu and therefore have to use ssh to connect to my machine in the lab.

This machine is behind a firewall however, requiring the use of an intermediary SSH server. So typically you’d do:

CLIENT>  ssh GATEWAY
GATEWAY> ssh DESTINATION

While this can be satisfactory enough for most uses, it doesn’t make copying files any easier, and my usual course of action was to copy the file to the gateway machine and then copy it from there to my laptop.

Today I got a little tired of that and decided to fix it.

This exerpt from “SSH: The definitive guide” proposes that you either use a remote authorized_hosts file command from the gateway to connect to the destination or to create a manual tunnel like so:
# ~/.ssh/config on client C
host S
hostname localhost
port 2001


# Execute on client C
$ ssh -L2001:S:22 G

# Execute on client C in a different shell
$ ssh S

This works well enough, but annoying that it required the manual creation of the tunnel. As for the authorized_hosts command method, it would require creating a new key for the client to use to make each connection to the gateway in order for the gateway to know which machine to connect to. (Doesn’t matter if you don’t understand what I mean) – Too much effort.

Instead I started thinking about using ssh_config to create the tunnel automatically before the connection:

~/.ssh/config:

HOST DESTINATION
hostname GATEWAY
ControlPath=none
LocalForward 2002 DESTINATION:22
PermitLocalCommand yes
LocalCommand ssh -p 2002 localhost

However, this didn’t work, and I didn’t figure out why it couldn’t get past the key exchange.

Another solution I considered was to use something called ProxyCommand, which I already use to connect to machines using HTTPS and SOCKS proxies. So I wrote a script that will make an ssh tunnel through the gateway and connect to the remote machine using the handy ‘nc’ utility.

~/.ssh/config:

HOST [DESTINATION]
ProxyCommand ~/bin/sc 2002 %h %p [GATEWAY]

~/bin/sc:

#!/bin/sh
#$1 == local port $2 == far away host $3 == far away host port $4 == gateway host
ssh -oControlPath=~/.$2$4 -f -N -L$1:$2:$3 $4
nc localhost $1

This will always use the same tunnel to forward a connection to the ssh server on the destination machine, saving resources. There was however the issue that ssh would constantly try to create the tunnel at each invocation, and the ControlPath was a neat solution to avoid that (if there is already exists a tunnel it silently does nothing). The only problem with this technique is that I couldn’t come up with a good way to garbage collect the unused tunnels. Perhaps a file locking based technique, using a counter (similar to reference counting) would work well. But it would be a much bigger project than I wanted.

I realised that using nc on the gateway machine would also work:

~/.ssh/config

HOST [DESTINATION]
ProxyCommand ssh [GATEWAY] nc %h %p

However this unsatisfactorily left nc processes running on the gateway machine, probably due to unimplemented shutdown message handling in some part of the network stack.

Both of these solutions were nice that they allowed the client to connect directly to the ssh server on the destination, enabling the use of ssh keys, forwarded ports, and preventing man-in-the-middle attacks. However, the nc utility is not exactly meant to be used in a production setup. A proper solution to the whole problem would involve modifying the sourcecode of ssh, to allow specifying a gateway in some fashion.

Update: Looking at the  Git tips page I noticed that the following works:

Host *.foo.internal
     ProxyCommand ssh gateway.foo.com exec nc %h %p

I really should have realized that would work. This is the perfect solution.

Written by jasonmc

April 16, 2008 at 12:09 am

Posted in Computing

Tagged with

I was there

leave a comment »

I attended this great talk at the Computer History Museum in Mountain View, CA while I was in San Francisco in March.

Written by jasonmc

April 14, 2008 at 12:41 am

Posted in Computing

A notable find

with 4 comments

Today I came across the “famous” Reith Lectures (named after the first Director General of the BBC). If you were ignorant like me to their existance, they can be found at http://www.bbc.co.uk/radio4/reith/

BertrandOf considerable note is the collection of historic Reith lectures, and in particular the one by Bertrand Russell, where he talks about social cohesion and human nature: http://www.bbc.co.uk/radio4/reith/historic_audio/reith_historic.shtml

It certainly makes for good listening. Just a shame that they’re only available in RealCrap format.

Written by jasonmc

February 26, 2008 at 2:20 am

Posted in humanity

Tagged with

In memory

leave a comment »

Christopher Johnson McCandless

February 12, 1968 – August 18, 1992

Written by jasonmc

November 16, 2007 at 12:41 am

Posted in Uncategorized

Here I am

with 6 comments

europe trip map

Written by jasonmc

September 22, 2007 at 8:18 pm

Posted in Uncategorized

Beauty of Mathematics

with 2 comments

While posting videos is not something I do very often at this blog. I came across this one particular documentary film that really struck me. It’s called Dangerous Knowledge and it’s about four thinkers — Georg Cantor, Ludwig Boltzmann, Kurt Gödel and Alan Turing who destroyed any hopes we would ever have for certainty in knowledge. The film is especially powerful to me right now as I have for weeks been obsessing with the limits of knowledge, undoubtedly to unhealthy levels. This film does not tell me anything new of course, but it presents it in a light that shows how very deep these problems were to these great mathematicians. The commentary for the documentary was also well chosen — Gregory Chaitin and Roger Penrose among those talking. At one point I was almost reduced to tears by the beauty that was hinted at.

Written by jasonmc

September 5, 2007 at 11:57 pm

Posted in mathematics, Video

IT Crowd series 2

leave a comment »

A new season of the British sitcom, the IT Crowd, set in an IT department/basement has just started showing on TV. It’s from Graham Lineham (the same guy as Father Ted). I must admit that first time round I didn’t find the series that funny (and neither did many people), or at least not laugh-out-loud funny; but the new series I’m glad to say had me in stitches. The characters are all basically still the same, but their production values seem to have increased massively. The first episode wasn’t set in the office, so maybe that had a large part to do with the hilarity.

If you can’t get it on TV, then fear not, it’s all over the interwebs. Check out stage6 or youtube.

Written by jasonmc

August 29, 2007 at 10:25 pm

Posted in television

Gecko engine does not render vibrant images on the mac

with 6 comments

I was looking at this beautiful image today in Firefox and made it my desktop background, but then I noticed that it looked even better as a background than in the Firefox window. A little more investigating revealed that (at least on mac) Gecko doesn’t render images as vibrant as Safari.

Webkit (Safari) vs. Camino (Mozilla):

Render

Just something to keep in mind next time you’re Flickring.

Written by jasonmc

July 8, 2007 at 12:23 am

Posted in Macintosh