Archive for the ‘Geekery’ Category
John Gruber is pretty good at picking good quotes out of an article.
Darby Lines on the Safari-for-Windows software update nano-scandal:
Second, bitching that anyone is a ‘bad’ Windows citizen is the rhetorical equivalent of arguing that one turd in a sea of shit is particularly stinky. Microsoft is a bad Windows citizen.
(Via Daring Fireball.)
Robot playing Towers of Hanoi on iPhone
The fact that someone built a robot for this completely tickles my geeky funny bone, but what really impresses me is how long the iPhone keeps up with the robot. According to the creator:
In the first part, I show the robot solving all 7 levels at 5 moves per second. After a few closeups, there’s a short clip of the robot running at 7 moves per second. It managed to solve the first few levels but then errors started popping up and it was unable to finish the whole game.
Pretty impressive considering it takes 2 taps to make one move.
Via MAKE.
Quote of the Day
On Microsoft buying Yahoo:
It’s like taking the two guys who finished second and third in a 100-yard dash and tying their legs together and asking for a rematch, believing that now they’ll run faster.
It will be a sad day when Yahoo takes this deal (they don’t want to, but they don’t have much choice). Microsoft has no interest in Yahoo technology, they just want to buy up their customers.
(Quote via Daring Fireball)
Apache setup for local hacking
I do most of my local web development under my userdir (/~tvon), but I don’t like dealing with relative URLs (and some webapps prefer to think they live in your document root). So, I fake it.
Edit /etc/hosts to give localhost some extra aliases:
127.0.0.1 localhost local1 local2 local3 local4 local5
Then tweak apache config to add a few VirtualHosts (in this case in my home dir /Users/tvon):
<virtualhost *>
ServerName local1
DocumentRoot /Users/tvon/Sites/local1
</virtualhost>
<virtualhost *>
ServerName local2
DocumentRoot /Users/tvon/Sites/local2
</virtualhost>
<virtualhost *>
ServerName local3
DocumentRoot /Users/tvon/Sites/local3
</virtualhost>
<virtualhost *>
ServerName local4
DocumentRoot /Users/tvon/Sites/local4
</virtualhost>
Now when I want to work on a site, say example.com (assuming it lives in the example.com directory under /Users/tvon/Sites) I symlink it to an available local alias, e.g. ln -s example.com local1 and I can access it as a root site at http://local1/.
Not very fancy, but it makes my life a little easier.
A handy shell alias when working with python
Ever want to clean out all the compiled python files out of a directory tree? Maybe you don’t entirely trust the system you’re working on and you want to make sure the source files are being checked? Maybe you just don’t like looking at them? Either way, stick this in your ~/.bash_profile (or similar):
alias rmpyc="find . -name '*.pyc' -print | xargs rm -f"
(Please test with echo, and watch out for typos, rm -f can be a nasty bedfellow.)
Joel on Ajax
Interesting article by Joel Spolsky:
In the second stage, everybody bought PCs for their desks, and suddenly, programmers could poke text anywhere on the screen wily-nily, anywhere they wanted, any time they wanted, and you could actually read every keystroke from the users as they typed, so you could make a nice fast application that didn’t have to wait for you to hit SEND before the CPU could get involved. So, for example, you could make a word processor that automatically wrapped, moving a word down to the next line when the current line filled up. Right away. Oh my god. You can do that?
I think he takes an opportunity (later in the article) to kick Google in the shins for no good reason, but otherwise it’s a very interesting bit.
Apache 2 SSL Certificate Export for IIS
When it comes to IIS (and pretty much anything on Windows) I know very, very little. This is mostly by design as it lends itself to much more plausible deniability when someone needs help fixing their computer.
Despite my efforts, I still have to interact with Windows on occasion. This week started out with one of those little interactions when I discovered I had to provide our network guys with an SSL certificate that I have been using in Linux for the past year. IIS didn’t seem to know what to do with the files I was using in Apache, and while Googling around helped a bit, I had to do some tweaking to get the magic command, which I will now document here for the sake of the hive mind:
openssl pkcs12 -export -out my_exported_cert.pfx -in my_cert.crt -inkey my_key.key -name 'My Certificate'
Where my_exported_cert.pfx is the file that IIS will be able to use, my_cert.crt is the certificate that Apache is using (SSLCertificateFile in Apache 2) and my_key.key is your key (SSLCertificateKeyFile in Apache 2).I’d tell you how to use the pfx file in IIS, but that part of this task wasn’t my job to complete.