Tunnel to the World 0

A lot of people know that OpenSSH’s client supports tunneling out of the box. But some don’t realize that it also supports tunneled SOCKS out of the box. Here’s how to set up a quick SOCKS proxy across an encrypted tunnel:

ssh -NfD 8888 user@host

The proxy will be on port 8888. The other flags just tell ssh to go immediately to the background (after getting your password, if needed) without running a command.

Willfull Ignorance 2

Sometimes, writing good code is really hard. But other times, writing good code is so darn easy you shouldn’t even have to think about it. In fact, it shouldn’t even be called “good code” — in these cases there should never be anything else, so we’ll just call it “code”.

For instance, if I see another line of code that does this:

$foo = isset($foo) ? $foo : 'default value';

I think I’ll kill someone.

Let me clear something up for you: using the ternary operator does not make you cool. However, assigning a variable to itself makes you very uncool.

if (!isset($foo)) $foo = 'default value';

Now why is that so hard to write?

Disappearing Act 1

I’ve started trying to train myself to use Google Reader: rather than trying to remember all of the sites that I want to visit each day, and having to visit each one independently, I can go to one place and view them all. Sure, these are all benefits of RSS readers, and everybody else discovered them years ago. What can I say, I’m slow.

Anyways, Google Reader caches things on its own (which makes sense), and that has a peculiar effect: if Reader hits up the RSS feed while an article exists, and then the author decides to delete said article, said article will appear in Reader, but not on the site.

Which is where I find myself right now: I have an entry from Matt entitled, “A More Perfect Blog,” that shows nowhere on the site. So… where’d it go, Matt? 😉

Jack & Jill 3

Not too long ago I was dragged into trying out Twitter. It’s interesting — like a glorified Facebook status; I’m sure they cringe every time someone makes that comparison — but I didn’t really catch on to it.

Now I’ve decided to give Tumblr a try. So far, I like it: it has the main component of Twitter — quick, short blogish entries — but also lets you easily post pictures, videos, quotes, chat transcripts, etc. The icing on the cake would have been posting code snippets complete with syntax highlighting. Ah, one can dream.

Recycle Bin FTW 2

(The title rhymes, if you didn’t notice, assuming you expand the acronym.)

Last night I decided that I should finally scrape all of my pictures off my two 4GB cards — I still don’t have my final photo storage solution worked out, so in the meantime I’m never really quite sure where I want to put things — since I had some 971 pictures in the mix. I put them on the largest drive I have; the one I record TV to, the one hooked up to my TV, the one low enough to be within arm range of toddlers and cruising infants alike.

As always, I used Ctrl+A to select everything on the card, then dragged it over, repeating for the other card. Then I turned off the TV and walked away. If you aren’t familiar with this process, it’s worth noting that after the copy operating finishes, all the copied files remain selected. That will be vital information.

This morning, Izzie (our youngest) was playing around on the keyboard connected to said machine, and although I heard a few dings and such, I didn’t worry about it.

Just now, I turned on the LCD and immediately noticed a warning about trying to delete a read only file. Sure enough, Izzie had managed to hit the delete button — with an entire card’s worth of copied files still selected — and sent that entire card’s worth of pictures to purgatory.

So, today, I’m thankful for the recycle bin.

Going Small 3

Here’s an interesting hobby: taking real photos and making them look like they’re photos of a model. I first saw this when a coworker sent me a link to the daily dose of imagery. It was a photo of a parking lot, but I couldn’t tell whether it was real, or whether it was a model.

But apparently this picture is not alone. In fact, there are entire Flickr groups devoted to this. And it’s really rather amazing — the insanely shallow depth of field plays horrible tricks on your brain and can actually convince you that you’re looking at something miniature.

One of my favorites so far.

~Time 0

I’ve been playing around with Xubuntu on an old machine, and happened to install the latest version of Eclipse + PDT (1.0.3, IIRC?). While setting up the myriad of options I require to feel comfortable in the editor, I noticed that they’ve added the ability to strip whitespace on save. May the authors be praised!

I’m in DC 2

So, as I mentioned a while ago, I’m presenting at DC PHP ’08. It’s this week.

The presenter I’m listening to right now just reminded me why I hate MVC on the web. But I’m not going to go into it.

The conference appears to have gotten the wireless correct, at the very least. The past two conferences I’ve been to have both had extremely flaky wireless connections, which presented problems for not only the attendees, but presenters who were depending upon an internet connection.

My talk is tomorrow, so for now I just listen.

Unplugged and overplayed 1

Time for a blast from the past. Harmlessly enough, this technology was originally introduced to save users the pain of manually configuring their ISA cards (do you even remember the ISA bus?). I’m referring, of course, to ‘Plug and Play’ (PnP for short; ‘Plug and Pray’ for the cynical).

End of flashback.

Today, ‘plug and play’ can describe just about anything that the marketers have decided is easy to set up and use (seemingly whether or not it actually is). For instance, do you think the term was ever meant to apply to residential solar power systems? Or search Amazon.com for the term, and marvel at the number of video games that are ‘plug and play’ — and that’s perhaps the most literal usage of the phrase ever. You plug the game in to your TV, and you play it. Plug and play.

Yet, oddly enough, it didn’t make CNet’s list of the top 10 buzzwords. To their shame, in my humble opinion.

Pharmacists 5

Tonight I installed dnsmasq as a caching DNS forwarder on our home network (under a VM, no less). Additionally, I changed our primary DNS servers to those hosted by OpenDNS. To double-check that things were working, I figured I’d whip up a quick script to make a bunch of DNS requests and give an average time. First round, I faced the OpenDNS server against Cox’s own. I’d never really benchmarked the Cox DNS servers, so this was quite enlightening:

andrew@ubuntu-server-vm:~$ php ./dns_bench.php dothedrew.net 208.67.222.222
Average response time: 27.53
andrew@ubuntu-server-vm:~$ php ./dns_bench.php dothedrew.net 68.105.28.11
Average response time: 158.58

This only serves to strengthen my belief that all cable ISPs are run by pharmacists.

To satisfy morbid curiosity, here are the results against the local dnsmasq daemon:

andrew@ubuntu-server-vm:~$ php ./dns_bench.php dothedrew.net 127.0.0.1
Average response time: 0.21

That’s only about, oh, a 755x improvement. Hopefully that’ll sufficiently speed things up.

« Previous PageNext Page »