jump to navigation

Technical goals for this weekend May 20, 2006

Posted by spanky in Linux, programming.
add a comment

Well, since I seem to have basically failed to meet every other goal I set for myself in the previous post, I'm going to make more short term ones for the time being.  For starters, I'm going to set up SSH tunneling through https by the end of the weekend.  It shouldn't take too long, and I think I've found a better way that doesn't involve running a full-blown apache proxy.

Technical goals to meet by the end of April March 30, 2006

Posted by spanky in Linux, carpc, programming.
add a comment
  • Have some kind of definite software solution for the CarPC system. As it is, I'm bouncing between distros trying to balance boot time/bloat with functionality. amaroK looks like it's going to be the backbone of the music-playing site since it has great plugins, supports ratings, and will sync with a music player/ipod with probably not too much fuss.
  • Make a honeypot and look at some attack profiles the script kiddies generally use. Hopefully get a good idea of a rootkitter's MO
  • Make and maintain a Linux distro (more on this later; it's contingent on progress in a project I have no control over)

Why does bittorrent + podcasting matter? (Or, “why open source?”) February 28, 2006

Posted by spanky in apple.
4 comments

Quite often, some of my friends and acquaintances don’t really think open source is something that they need to pay attention to, that it’s a quaint little hobby for tinkerers and doesn’t have a really large place in their day-to-day internet life.  While I’ll be the first to admit that the products of the open source community are not a panacea, it is probably the only group that has nothing other than the satisfaction of end users in mind.  Corporate entities, while often appearing benevolent, will inevitably limit choices or features, or use the product to further their own interests, be it building a user base, or mindshare, or whatever.

An example of this is Apple’s iTunes including PodCasting.  It’s a double-edged sword; by making podcasting much easier to subscribe to, shows are getting much wider exposure and more listeners.  The cost of this is that now Apple has a great deal of control over podcasters since they are now the point of entry for the listener base.  If an RSS feed works with other podcast clients, but not with iTunes, the number of people who will subscribe to your show will drop precipitously.  If, for whatever reason, your podcast doesn’t show up in the top/featured podcasts, you won’t get the coverage that a podcast that Apple features will.  Apple has the mindshare and market clout, as well as the content delivery software in place to establish this hegemony on what was once a community-led phenomenon.  Now, I’m not stupid.  For Apple, this was an incredibly smart business move.  While they may not have invented podcasting (i.e. the simple act of putting MP3 URLs into RSS) they get to become a primary supplier for the content.  Why should you care?  Simple.  Without bittorrent, podcasting will not be able to scale well to a larger listener base.  Already, a lot of my favorite podcasts are taking on sponsors and ads for revenue to offset bandwidth costs that keep rising.  Podcasts are already recorded on sub-par equipment and downsampled and compressed to appallingly low file sizes to cut back on bandwidth spending, but if podcasting keeps growing, it won’t matter.  If podcasters don’t start using bittorrent, small, independent people may not be able to attract and sustain a larger listener base.  And I don’t see that happening unless iTunes supports it.  This may not seem like a big deal, but I think the strength of podcasting lies in independence and free speech (like blogging).  I just don’t want to see a day where Clear Channels and Time Warners move in and become the only game in town for podcasting.

Webcam Woes February 18, 2006

Posted by spanky in Linux.
add a comment

I own a Logitech Quickcam Express I got for free with some promotion, and I’ve been trying to get it working with Kubuntu on my Powerbook to no avail.  There’s a quickcam kernel module, which requires video4linux support, which I loaded.  The problem may actually be USB-related, though I’m not sure yet.  I spent an hour or two messing with it.  When I tried this on my old and busted Gentoo box, it loaded up the modules, and worked right off the bat, so I’m not sure what’s going on.  More later if I end up fixing it.

Optimizing Linux boot times and other kernel tuning February 5, 2006

Posted by spanky in Linux, carpc.
add a comment

So as part of my CarPC project, I’m putting together a build of Linux that is very light and very fast. I didn’t start out with any particular distro or set of tools in mind. The hardware is one of the main project constraints, in this case a Duron 700 with a Riva128 (Thanks, Jon!) and a meager 128 MB of old and busted system memory.

I tried Damn Small Linux, which is a Knoppix-derived LiveCD build. It booted in about ~60 seconds from power on to X/fluxbox session accepting user input. It’s very fast, even on this system, but had a lot of quirks, and had all the disadvantages of a binary-only distro as well. Installing odd software and tweaking it is critical to my application, so this wasn’t really the direction in which I wanted to go.

Given that DSL wasn’t for me, there are two ways I could have gone. I’ve heard of people getting very fast boot times with Linux From Scratch, but that would involve building an entire distro from scratch, and having to probably install packages and such all by hand. It’d have all the advantages of a bottom-up approach, but may or may not be worth it in the end.

The second solution, which is what I’m trying now, is to do a top-down approach: install a bare Gentoo system, and pare it down to exactly what I need, and nothing more. I’m very familiar with the Gentoo install process (it still took forever, though), and yesterday I put together a working system. It went from power on to a terminal login prompt in about 45 seconds. I’ve made a lot of changes since then, the kernel is getting smaller at each recompile as I zero in on exactly what I need. Things I’ve used to help my boot time:

  • Everything I need and only what I need are compiled directly into the kernel. No modules, I eliminated those module autodetect scripts from startup, and so forth. Definitely saves a few steps and at least 7 seconds.
  • I noticed an inexplicable delay between the last init script starting and getting a login prompt. It’s gone away, what I *think* fixed it was changing an option in /etc/conf.d/rc that says whether or not Linux should save /dev to a tarball on shutdown and restore it on startup.
  • I spent a bit of time trying to figure out why nvidia’s X drivers for the Riva128 weren’t working. I found a bit on some forums about their latest Linux driver breaking compatibility with their older cards, and that downgrading might help, but it’s really a moot point. X.org takes a decent amount of time to start up, and Xvesa takes about 1 second.
  • There’s an option in /etc/conf.d/rc that allows some parallelization of bootup, but I don’t think it makes that much of a difference for a single-processor system (at least it doesn’t for me), but YMMV

Some links I found that I’ll be checking up on:

IBM Article on faster boot times

Optimizing the boot process

This is really sweet : Bootchart tells you where your system is spending time in the boot process.  If it comes down to it, I’ll use this, though it may not be necessary.
Current boot: 25 seconds

Internet connection sharing on Linux (IP Masquerading on a Powerbook) February 2, 2006

Posted by spanky in Linux, apple.
add a comment

So I left my PCI wireless card with Linux drivers at school, my wireless router is next to the TV and not a great place to setup a Linux box, and I want to install packages onto a Linux box I’m setting up.  I recently put Linux on my Powerbook, so what is commonly termed “Internet Connection Sharing” is no longer as easy as it used to be, and is bound to be a pain in the ass.

Or is it?

To clarify, what I wanted to do was share my Powerbook’s wireless connection over its Ethernet port.  There are quite a few good tutorials on setting up IP masquerading, but the only one I needed was here.  I copied and pasted that script into init.d, made it executable, and ran it on the Powerbook.  It checks for and loads modules that I’m sure are running already, changes some network settings, and then sets up the forwarding rules in iptables.  Note that I had to change 2 lines in the script, since my external interface was eth1 (wireless) and my internal interface was eth0 (wired Ethernet).  I ran that, set the IP address on the host Powerbook to 192.168.2.1, set the IP address on the client system to 192.168.2.2 (both via ifconfig) and then “sudo route add default 192.168.2.1″ to the client system, and done.  Pings, DNS, it was all taken care of.

Initial release of JSimViz January 30, 2006

Posted by spanky in jsimviz, programming.
add a comment

JSimViz is now out at version 0.1. Should have basic functionality and the RUU display window. Documentation is pretty bare now, but will be steadily updated.

An interesting article in 2600 January 26, 2006

Posted by spanky in Uncategorized.
add a comment

mirrorshades has an interesting article (more like a rant) titled “I Am Not a Hacker” in the current issue of 2600 (22:3, Autumn 2005) about how “hackers” don’t exist anymore.  The media has been misusing the term for as long as it has existed, but the group of people it once referred to doesn’t exist anymore.  “The title conveys and eclectic sense of rugged nobility from a bygone era – to call someone a hacker is to call them a true old-school master… it simply doesn’t make sense to refer to anyone as a hacker if they can’t remember a time before desktop computers.”  He makes it clear that people with the same motivations exist in the Internet era, and span a wide range of backgrounds, but just that the term is becoming archaic and no longer applies.

Gyakuten Saiban 3 Translation Project January 18, 2006

Posted by spanky in gaming, japanese, programming.
add a comment

So someone has finally answered the call and started to translate Gyakuten Saiban 3 (known to most of you as that silly lawyer adventure game for GBA). This seems like it’d be right up my alley, incorporating some programming, reverse engineering, and (mostly) Japanese translation. The guy is apparently working only in Windows, but he’s written the code very Linux-style with makefiles and such, so adjusting the compile options isn’t that hard. I’m still having problems with some of the quirky flags his compiler uses, but we’ll see what I can do about that. I’m sure my code monkey CS friends are already familiar with every little flag in gcc, but I’m just a CpE, what do I know? =)
The good news is that the hard stuff has already been taken care of by the project maintainer. Problems involving getting font sizes right, etc. All of Case 1 is translated, and a patch is available. I’m joining the project and adding whatever I can as much as time allows. I’ll post whatever updates are relevant here.

Gyakuten Saiban 3 screenshot 1

Installing Linux on a Powerbook G4 January 13, 2006

Posted by spanky in Linux, apple.
5 comments

Since the Airport Extreme drivers have been reverse engineered, I thought now would be the perfect time to finally install Linux on the ol’ PB. The popular distro of late is Ubuntu (Ubuntu is an ancient African word meaning “I’m sick of waiting for Gentoo to finish compiling,” as the joke goes), so I thought I’d give it a try. Nothing against Gentoo, which is still my distro of choice for the desktop. Gentoo of course is named after a fast swimming species of penguin that preys primarily on small krill and n00bs who use binary-only distros. Since I’ve always been more fond of KDE than GNOME just as a matter of preference, I chose the Kubuntu flavor. Dapper Drake is the latest version of the distro, and it’s still in testing, but it had the kernel version and modules I needed (bleeding edge packages don’t hurt, either ^_^) The timing turned out to be fortuitous, since Dapper Drake release candidate 2 was just released to the public, so I grabbed myself a copy.

The install itself is far and away the least painful Linux install I have ever seen or heard of. I put the CD in, it detected things and went into a setup program, and presented me with some basic choices like language and keyboard setup. The partition setup screen had several options, one being a “suggested” partition table, one being a guided process, and one being the manual partition setup most of us are used to. At this point, I decided to let it choose for me, and it showed me what it was going to do, and asked to write the new partition table to disk. After that, the base system and related packages were all installed, which took about 20 minutes and a reboot or two, and that is basically it. Gentoo Linux has really great documentation about install and setup. Kubuntu? It doesn’t need documentation. After the progress bar hit 100% I had a Powerbook that:

  • Booted straight into kdm/KDE 3.5
  • Had OpenOffice installed
  • Displayed battery status correctly in the panel
  • Had ALSA sound working out of the box
  • Touchpad worked great (had to tone down the sensitivity– cursor moved too fast)
  • Frequency scaling enabled to prevent overheating
  • Eject button worked to eject cds, provided they were not mounted

If Linux is going to seriously break into the desktop world, Ubuntu/Kubuntu is the distro to do it. After this, I went into the shortcuts and reassigned some functions to the Apple keys, went into KMix and mapped the volume control Powerbook buttons to work, and got wireless working. Dapper actually shipped with almost everything I needed to get Airport Extreme started. Google for fwcutter, it’s a utility you need to download, compile, and run on an Airport Extreme driver to extract the firmware, which it will then copy to the correct directory. After that, this is what I do to get my wireless connected:

sudo modprobe bcm43xx (this should also load the 80211_softmac module, if not, do it manually)
sudo ifconfig eth1 up (static IP goes here)

sudo route add default gateway (router IP, often 192.168.1.1)

sudo iwconfig eth1 essid (Wireless network name)

sudo iwconfig eth rate 11Mb

The reason for the last command is the driver currently only works for 802.11b. Another limitation is that the SoftMac layer is not complete. I read a post about devicescape, which is supposedly much more functional, though harder to get working. I’ll see if I can get more out of the wireless in terms of packet sniffing, etc. later. If the above doesn’t work for you, check the output of dmesg and see if your computer has successfully associated with the access point. I have also heard tell of WEP encryption working as well.

As for what remains to be done, the pbuttonsd that controls things like power button behavior, suspend-to-disk and so forth often seems to require reconfiguration to work properly on some Powerbooks vs. others. All in all, it was a painless experience. As is usually the case with Linux, not everything is sunshine and roses. There are projects under way to create an open source implementation of Flash, but it’s still in progress. If you want to play something that requires Flash 7+, forget about it. Macromedia does have a Linux binary available for download, but it’s x86 (The Man giveth, and The Man taketh away). So I can’t watch Google Video at the moment, but at least now I can save it to disk. There’s a petition for them to release a Linux ppc binary, but I’m not holding my breath. The petition for open sourced Airport Extreme drivers has been around for years since the first release of the product, and we’re only seeing results now because hardworking device driver people rolled up their sleeves and took matters into their own hands. And if you don’t understand, or at least respect that, I’m not sure why you’d want to run Linux in the first place.

Screenshots:

Gaim, Image Browing with Konq

Processor Stats (1Ghz processor frequency scaled to 66%)

Showing off Katapult, a KDE launcher application like the outstanding OS X app, Quicksilver