February 9, 2009

getting wired

A recent Slashdot article reminded me of my first attempts at trying to communicate with the outside world via computer. Growing up, I lived in a relatively remote area with no one I could talk to about computers or swap tips and programs with. But I learned as much as I could through magazines and books and eventually I learned that it was possible (with the right equipment) to connect your computer to a phone line and have it "talk" to another computer.

It wasn't until we got a Packard Hell 16MHz 386 that I was able to try this out for myself. It happened to come with a 2400 bps modem pre-installed. And if you know me, you'd know that there was no way I was going to let that thing go unplayed with. One boring day, I ran a long phone line over to the computer, plugged it in, and used HyperTerminal (or something like it) to connect to a BBS on the other side of the state. I can't remember exactly how I got the number, but on this BBS I found that you could download programs, leave messages on the electronic forums, play games, and even talk with people in real time. I was floored. I had to share it with someone.

Me: Mom! I'm talking to someone on the computer!
Mom: What? How?
Me: I connected it to the phone line and dialed up someone else's computer. Now I'm talking to them.
Mom: Oh cool!
Mom: ...
Mom: Wait, is that long distance?

In my area, pretty much every phone call was long distance and it wasn't cheap. Although we had a CompuServe account for some time, it wasn't until our local phone company added a local dial-up number for Internet access that I was able to spend huge amounts of time online.

Now, a mere 15-20 years later, it's rare to not have instant and constant access to the largest computer network in the world. I can't even imagine what kind of access the next couple of decades will bring.

January 21, 2009

OpenSSH: The Poor Man's SOCKS Proxy

Just when I think I know everything I need to know about OpenSSH, I end up learning something new and tremendously useful. Today, that would be the -D argument.

Many times I have been stuck on an "untrusted" Internet connection and need to log in (insecurely) to a certain site. My university, for example, uses a system that has no way of logging in via HTTPS, nor does it secure the traffic to and from the browser. I have moderate faith that the folks at my ISP aren't snooping my traffic (since I know the company pretty well and used to work with them), so I don't have a huge problem logging into their site at home. I also have a colocated server at the web hosting company I work for, so I know the layout of their network even better and trust them not to snoop or interfere with my traffic. But when I'm on the road connected to some dodgy insecure hotel wifi, I acquire no small amount of anxiety over the fact that anyone with a packet sniffer can get access to all of my personal and academic details.

For the past few years, I've had this plan to get OpenVPN set up for my network and laptop so that I can always have a secure connection to my home and colocated server. And for the past few years, I've kept putting it off. While OpenVPN is easier to use than many other VPN solutions I could name, it's still at least a good hour of my time getting all the settings right and testing it out.

I was already aware of OpenSSH's -L option which simply forwards a local port through an SSH tunnel to a port on the remote machine. Very handy when you want to connect surely to a site hosted on that server and happen to have a shell account on it. But to do much more than that ranges from the complex to impossible. This is where -D comes in.

The -D arg tells OpenSSH to be a SOCKS proxy. So you simply log in to the endpoint via SSH with the -D arg like:

ssh -D 1234 user@host.example.com

And then tell your web browser to use a SOCKS v5 proxy on localhost at the specified port and bingo, you have a secure connection to your endpoint. In fact, any application with SOCKS support can have its traffic routed through the SSH tunnel via SOCKS. Firefox supports SOCKS just fine, Opera doesn't. Konqueror is supposed to, but judging from the Google responses I got, support might be a little flaky.

The final test was whether I'd be able to use this newfangled (to me) proxy method on my Nokia N800, a device that I browse and email with quite often whilst traveling. Obviously OpenSSH has to be installed as it doesn't come with the firmware. And the N800's web browser, MicroB, uses the Gecko engine. The UI has no widgets for entering a SOCKS proxy, but you can set the preferences manually with about:config:

network.proxy.socks localhost
network.proxy.socks_port 1234
network.proxy.type 1

The result? Portable proxy surfing!

January 18, 2009

Korg Electribe EMX-1

Next on my list of completely bad-ass gadgets to acquire in the distant future:



(This is not me playing by the way, it's the user known as Denkitribe on YouTube and his beats generally rock.)

November 25, 2008

muddy thinking

3,000 Riot to Protest Crackdown on Illegal Amazon Logging

You know you've had your head stuck inside a computer for too long when, after reading the headline above, you start wondering why:

1. How long had Amazon.com been keeping these logs?
2. In which country is excessive logging of customer data illegal?
3. How much did Jeff Bezos have to pay these protesters to incite a riot?

But it turns out of course that it's a rainforest article. (Insert "couldn't see the forest for the trees" pun here.)

November 15, 2008

We be x0xing

It occurred to me today that I hadn't put up many pictures yet of my x0xb0x whilst under construction. It further occurred to me I had not taken many pictures of my x0xb0x whilst under construction either. Besides the one a few posts down, this is it:



Here the power supply is done (the components on the smaller PCB to the right) as well as the VCO and VCA sections of the mainboard. And also a few IC sockets are in because I got bored one night and wanted to solder but didn't have all the parts yet.

Here's a photo of the finished product:



It simply sounds marvelous and is a joy to tinker with. I used diffused blue LEDs (which are actually hard to get a hold of cheaply) and metal knobs. The knobs ended up being the wrong size though, so they sort of wobble a little when you turn them. (The center of the pot is not the same as the center of the knob.)

I also happened across a picture of the oscilloscope I bought on eBay. Four channels, 100MHz, all awesome. It's the exact same model that I used in the Air Force to repair autopilot systems so I'm already familiar with its operation. Usually, buying something like an oscilloscope on eBay is extremely risky. An oscilloscope is a precision instrument with a million different things that can go wrong and quite a few bits inside that have to be calibrated every so often. On top of that, most of the test equipment for sale on eBay comes from auctions a.k.a., refuse.

I got lucky, though: $300 (free shipping) and there's not a single thing wrong with it. I like gambles that work out in my favor.

November 2, 2008

Overcontroller

Not only is this my first x0xb0x track, it's the first full piece of "music" I've composed. Evar.

The main sound is a x0xb0x connected to a Zoom 506 bass guitar effects pedal with some pretty wild settings. The x0x provided MIDI sync to ReBirth, a software synthesizer for Windows which donated a second 303 to the track as well as authentic 808 and 909 drum machine sounds. ReBirth performs admirably on Linux with the help of Wine, even the MIDI stuff.

This was recorded "live" in a single go, although there was some rehearsal. (And obviously the patterns were not programmed on the fly.) It's also kinda noisy since I've yet to perfect the art of recording things from the audio-in of a sound card. The drum machine effects themselves are known to be cheesy (808 cowbell!) since I was just trying to get something that sounded somewhat catchy without getting bogged down in minutiae. Overall, I'm quite happy with how it turned out.

Here are links to it in two formats: OGG and MP3. The OGG one sounds better but you might only have an MP3 player handy.





Creative Commons License

October 27, 2008

Linux terminal speed benchmarks

In system administration, you spend a lot of time typing into and reading back information from a terminal. Although all terminals pretty much do the same thing, they can differ somewhat in their UI features or which desktop they were designed to be integrated into.

A few years back I was doing a lot of compiling (Gentoo, FreeBSD) and I felt that a good deal of that time was spent just waiting for the terminal to print the enormous amount of compiler cruft to the screen. So I did some quick benchmarks. I don't remember the exact results of those benchmarks nor if I actually made a decision based on them but I clearly remember that results were interesting.

The topic of terminal speed came up at work today so I set out to replicate the experiment. Creating a benchmark like this is harder than it sounds because every time a single a character is printed in a graphical terminal, code is being run in the Linux kernel, numerous places in X, the video card driver, the command shell (bash), and the application running the benchmark itself and even the raw performance of the video card itself can come into play. To design the perfect graphical terminal benchmark, you'd need deep knowledge of how all of those work and carefully craft the benchmark so as to maximize the "stress" on the graphical terminal code while minimizing "stress" on the other components of the system.

However, I'm far too lazy for all that.

So I just catted a Linux kernel changelog to the screen. Each benchmark was run four times times sequentially and the time averaged among the last three trials. (The first is a dry run to ensure that the file is cached in memory.)


Terminal time cat ChangeLog-2.6.23
-----------------------------------------
xfce4-terminal 11.109
gnome-terminal 11.022
terminator 10.878
xterm 7.320
konsole 3.191
rxvt 2.983


I was rather expecting rxvt to win since it's widely regarded as the minimalist terminal, but Konsole was a surprise. It beats even xterm by a large margin. Like KDE, Konsole is almost certainly written in C++, widely regarded as slower than C which is what makes these results pretty interesting. It's also noteworthy that the xfce4 terminal is right on par with the Gnome terminal when XFCE is supposed to be more lightweight than Gnome. (And probably is, overall.) Based on these figures, one could speculate that terminator, xfce4-terminal, and gnome-terminal are all based on similar code or libraries.

And finally, just in case you skipped the part above where I said how poorly this "benchmark" was really constructed, I want to emphasize it again: This benchmark is completely unscientific. This is how these terminals did on my computer. You may get a different (even perhaps contradictory) set of results if you run them on your computer. Nevertheless, I'm fairly confident that the results here are representative of what most people will see.

October 24, 2008

Ghetto-sistor

This, my friends, is what is called a "ghetto-sistor."



It's what you get when you need a 1K ohm resistor, but don't have a new one handy, and instead have to settle for ripping one out of an old telephone before you realize that one leg is going to be too short so you solder a piece of solid scrap wire onto it so it's the right length.

Ghetto-sistor. GET IT?

Sheesh, you have no sense of humor.

It's Alive!



And by god, it is blinky.

October 13, 2008

Well, heck dang.

Seeing as everyone else in the known universe has a blog now, I figured it was high time I jumped on the bandwagon. Technically, I was blogging before it was cool, but ye olde archive machine doesn't have too many of my pages from way back when.

Because I'm picky, I'd like to write my own backend for the site and host it on my own server as I don't exactly trust teh Googles. But writing that is going to take a small eternity, most likely, so this will have to do for now.