Darwin


Windows 7 64 bit on PPC OS XIf this picture doesn’t make sense, it’s my 32-bit PPC Mac running near-native speeds on an Intel virtual machine of Windows 7 Professional 64-bit through the Internet. If the reason or the methodology isn’t apparent, read on. (more…)

For various reasons, some of which I’ll expound on for the Mac geeks out there, the Bike Friday IRC channel I began so many moons ago is back again.  If you have questions about the bikes or service or just want to chat, this (I hope) will provide a good forum for some live interaction.  Heck, maybe one day I can get the rest of Bike Friday entered into the computer age and we can ALL contribute.  Meanwhile, you got me and whoever else might be there though it’s been pretty empty as of late (read: I’m lonely, come visit).

If you’re not familiar with IRC and your browser is set up to allow JavaScript (most modern ones are– unless you’ve disabled access), clicking here should take you right into the IRC channel or chat room if you prefer.  Before opening your digital mouth, you might first want to make a name for yourself, which you can do by typing /nick name where name is whatever you want your name to be.  Make sure you don’t have any spaces in it.  And don’t forget the forward slash.  Then just type away.  An example is pictured here for your convenience.

Another easy way for anyone to connect regardless of operating system is by using the ChatZilla plugin for Mozilla browsers (e.g. SeaMonkey, Firefox).  The install link is at the bottom.  Once there, just click here.

The more hardcore IRC’er will probably want a dedicated client.  It’s also nice to not have to have your browser open to do IRC.  I can’t help the Windoze folks out there but Wikipedia can.  *nix folks will appreciate my final solution for the Mac was Terminal-based.  Read on.

I once proclaimed an appreciation for Colloquy but have since rescinded that appreciation.  It’s just too darn buggy.  Conversation is worse (could have to do with the fact that the last release is from 2005).  Not many freeware options.  Linkinus was nice but $20 which seemed a bit more than what I wanted to spend for what it could do. 

And then they came out with some free licenses.  Well I got spoiled by a lot of features included one that would leave me on even with the application off.  That was simply too cool.  And then they came out with a new version and I did the automatic update which was incompatible with my license (I did know better at the time), which then became unusable.  I tried to get them to help me re-install the old licensed version but I have received no response and now I’m very glad I never gave them a dime.  They don’t deserve it.

I looked into a million options, especially one that would allow me to always stay connected.  The more I looked into it the more I saw Mac guys mentioned using irssi+screen.  Irssi is one of the best Terminal-based IRC clients out there.  Screen allows you to stay connected not only when the program you’re running in it is closed but also when Terminal itself is closed!

I did this for a while and was really happy with it but then I started exploring other ports on MacPorts and found weechat.  It had some features about it that won me over, like a nicklist that worked (irssi’s nicklist.pl script sucks), the ability to split windows vertically and horizontally and lots of other little things.  I had to play with it a bit to get it where I wanted (including making a 2-line Perl script to automatically create my split windows) but now it loads up just the way I want it to.

So it’s pretty easy to get this running with MacPorts.  Make sure you’re in an admin account in terminal (use login as needed) and then issue a sudo port install +perl.  MacPorts will add on all the dependent programs you need to get it running and verify the configuration.  It’s awesome.  As a slight tangent, I consider this essential if you’re going to use any *nix programs since the ports are built specifically for Darwin.  Anyways, the +perl isn’t necessary but recommended if you want to add on any additional functionality.  This is how my auto-split window script works.

What I’m really excited about though is the possibility of Growl notifications.  The idea of weechat+screen+growl has me ELATED!  Think about it:  with no Terminal running, you get notifications when things you want to know happen!  However, the growl-notify.pl script requires (sensibly so) Mac::Growl which for some reason I can’t get working due to dependencies I can’t get working for some reason, which I think is related to Mac::MoreFiles which I can’t seem to get going (Mac::Growl is looking for it).  I’m in touch with the developer of the script as well as introducing a bug report to Mac::Growl, so we’ll see what happens.

Anyways, however you get on IRC, get on there and let’s talk bikes!

Powered by Qumana

Nothing beats resourcefulness. It’s an essential survival skill. Making the best out of what you got. Usually, too, the most resourceful people are among the most creative. I mean, look at all that recycled art out there!  It’s one thing to imagine something and make it.  It’s another thing to make something out of existing materials.  It’s a greater discipline, like limerick versus free verse.

One example of this that has always amazed me is that of ASCII artASCII can be thought of as the "base" set of characters you have to deal with on a computer.  Everyone knows what emoticons are and they can be thought of as the most simple of ASCII art though the Homer Simpson is impressive: ~(_8(I).  Sometimes people have cute like ASCII caricatures of themselves in their signatures.

ASCII art was far more complex than that right from the get-go.  Kenneth Knowlton, a programmer at Bell Labs and mosiacist by night, developed the field in 1966 and has some pretty impressive works in his collection.  Among my favourite is the portrait of Einstein composed only of 5 characters: e, =, m, c, and 2, being the equation that made him famous.  What made Ken famous, though, is taking an image, scanning it, and then re-rendering it based on a scheme of using a particular character with a particular halftone level.

This is the same process VLC and MPlayer uses to play videos.  Yes, you now can watch the tikit videos in ASCII.  Similarly, a computer generative process is used to create an ASCII version of Google Maps and to generate phrases in different ASCII art fonts.

But what takes the cake is open source, cross platform ASCII drawing program/image editor JavE.  You can do all sorts of things with it including all the things you would expect to do with a similar program.  You can even convert/export to/from ASCII from/to a variety of standard graphics formats.  To show you its power, I give you this:

Stick that in your signature file and post it! 😀

Powered by Qumana

When I had my first computer, we didn’t have graphical user interfaces, at least not in the way that we have come to know them.  Mostly, it was a bunch of colored ANSI/ASCII.  Pretty lame, really.  Certainly didn’t help productivity.  Frankly, I came to resent GUIs.  When Windows came out, I installed it but rarely used it.  It always slowed me down relative to just typing out commands in the shell.  Still, more and more programs were being developed specifically for Windows and so it was a necessary evil. 

Then, one fateful day, I installed Windows 95, rebooted, and exited the program into the DOS shell.  I typed some command and it said "wrong version" because bloody Bill Gates took over my shell and dumbed it down.  It was at that point that I decided that anything was better than Windows.  Looking for other alternatives, I had a certain love/hate relationship with Linux .  I loved its power and tweakability but I struggled to get the sound card to work, even with the more user friendly distribution Red Hat.

Then, I discovered that the Apple folks had hacked a *nix variant called FreeBSD and made it their own as an open source project called Darwin.  Even though it lacks some taken-for-granted features (has anyone noticed concat is missing?) a standard *nix distro comes with, unlike Windows 95 DOS, you can add to it whatever you want (for example, I have installed mplayer so that I can play music within the shell).  So even though OS X-equipped Macs are super user-friendly, they’re completely applicable to the power user as well.  It’s the best of both worlds, really.  Though I certainly spend time in the shell, I find that many things can be done a lot faster/easier with the GUI, which is an experience unique to OS X in my experience.

But despite all their genius and even despite the fact that their first product was a blue box that allowed for illegal free phone calls, I can’t give the differently-thinking Steve² all the credit.  One of the major elements that a GUI can give to an interface is organization.  It’s often pretty difficult to organize pure text.  Sure ircII and vi/m had split windows but tabs are the best implementation I have seen yet.  They leave the desktop uncluttered and yet everything is easily accessible at a glance.  Even though tabs have only been in the forefront for a little more than half a decade, the GUI just doesn’t seem the same without them. 

Case in point:  last night I was working with some text files and was about to pop open my favourite tabbed text editor when I thought I would give Aquamacs Emacs a try.  Though my *nix editor of choice– just for ease of use and accessibility– is pico (Darwin uses nano, which is a pico copy) I’ve used vi and especially emacs before, as well.  I thought it might be cool to have a super powerful *nix text editor with an Aqua interface.  So I popped in my first file and then hit Cmd-T for a new tab and got the old "Funk" sound.  So I searched through the menus, tried different options, to no avail– no tabs.  Screw it, I went back to Smultron.  Ironically, it was in 1988 that tabs were first introduced.. on an implementation of emacs.

That being said, here are my favourite tab-friendly OS X programs, though plenty more exist:

Luckily for those of you that are not convinced of what a joy OS X is to work with, there are plenty of tab-friendly programs for other platforms.  However, so much of the OS X GUI is about approachability and functionality, tabs seem to go hand in hand with it.  Maybe with Leopard steadily approaching public release, now would be a good time to see it for yourself if you haven’t already!

Powered by Qumana

I’m not totally one of those anti-anything kind of people. I don’t think all corporations or Republicans or synthetic chemicals are bad for us, though many are. I tend to consider myself open minded. But damn if Bill Gates just doesn’t want to force everyone to buy his crap. Here’s two situations to help illustrate this.

First, I’d like to defend any *nix-based operating system (like OS X– incidentially created by BG’s arch-nemesis who chooses apparently not to be defensive) for making it possible to use ANY file system, whether it was made on a Mac, a PC, or a *nix box. They don’t care whether or not you’re using their OS to use someone else’s software, they just want you to enjoy using their OS. Simple enough.

But no, Windows machines are horribly opposed to anything else. For one, they hate Apple-formatted drives. Well, Mac users, guess what your iPod is? That’s right, if you want to plug your music player into a Windows machine– nuh uh. Sure you could reformat it to a Windows format and then it would work on a Mac, too, but why would you want to do that? There is a good solution but it’s not an inexpensive one. It’s called MacDrive and with it your iPod will appear as just another drive and you can drag and drop with glee– after you drop the money on the piece of software. In addition to MacDrive, though, you’ll need to download this driver for those of you cursed with the worst OSs of all: Windows 98/ME. Otherwise the machine won’t even recognize it!

Luckily (sarcasm) this is what we’re blessed with at Bike Friday. Like our bikes, we have a totally customized database built out of the Windows 98 edition of Microsoft Access. Our eventual goal is to port it all over to something more Open Source, perhaps even something as simple as an intranet database with a variety of webapps. However, we have other priorities and that is no small undertaking. So meanwhile we must suffer. Lynette and I both have figured out ways to nearly avoid using our Windows machines all together, choosing instead to bring our Macs to work. Kind of sad when you think about it. It’s not Bike Friday’s fault though. It’s Bill’s fault for forcing Windows on the world!
I digress.

The other thing that’s driving me nuts is WMA files. I downloaded a song in said proprietary format only to find that though they claim iTunes can handle them, it doesn’t seem to want to whether you try to Import or Add to Library. So off I went looking for a good conversion solution. Surprisingly not a lot of freeware options. I did find ffmpegX, done by some of the same people that do the awesome command line/GUI Open Source alternative to Quick Time: MPlayer. ffmpegX literally does any a/v format under the sun, but it was big and ultimately Shareware. So I thought I’d give the command line ffmpeg a shot. It worked really well in the version installed under ffmpegX, so I got rid of ffmpegX (I might add I used the very efficient AppZapper for this– one of the very few pieces of software I would pay for [though I won it in a contest]– since OS X software so rarely has an uninstaller) and set out to install ffmpeg.

There are pretty easy to follow OS X instructions that basically has you install LAME (MP3 Encoder), Fink (which, like DarwinPorts makes it easy to install *nix packages on OS X though it does require installation of latest Xcode Tools which you can get for free from the Apple Developers Connection) and Subversion (keeps track of changes to the source code). All this works pretty smoothly. Only not for our particular application. For one thing, it lacks the option to actually enable the WMA decoder. Secondly, it lacks the option to encode to the wonderful AAC format Apple developed. Here’s how to fix this. I will provide a revised HOW-TO that further smooth out the rest of the process:

  1. Get Xcode Tools. See above.
  2. Get FAAC so you can encode AACs.
    1. This is a very problematic install though the software is wonderful, so you’ll need to follow these steps after downloading and opening up the archive.
    2. Go to Terminal and go to the appropriate directory and type:
      1. aclocal -I .
      2. autoheader
      3. glibtoolize --automake
      4. automake --add-missing
      5. autoconf
      6. sed -i '' "s/^M//g" configure (instead of ^M hold the CTRL key and type vm — the result should look like the code here)
      7. ./configure
      8. make
      9. sudo make install
  3. Get Fink:
    1. Mount the disk image, run the installer. Give it permission to change your config files.
    2. Open Terminal and issue the following commands:
      1. fink scanpackages; fink index
      2. fink selfupdate
  4. Stay in the Terminal and use Fink to get LAME and Subversion:
    1. fink install lame
    2. fink install subversion
  5. Use Subversion to get ffmpeg:
    1. cd /Applications
    2. svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
    3. cd ffmpeg
    4. ./configure --enable-mp3lame --enable-decoder=wmav2 --enable-faac --enable-shared --disable-vhook
    5. make
    6. sudo make install

Furthermore if you want to make it really easy you can open up your favourite text editor and make a script to help out. I’m going to give you all the commands you would need to do this with the great *nix editor vim since it’s got a bit of a steep learning curve. The 1st indent indicates we are within vim and the 2nd indicates we’re entering input into vim:

  1. vim wma2aac
    1. i
      1. #! /bin/bash
      2. ls | grep ".*wma$" > foo
      3. sed -e "/.*.wma$/s/.wma//" foo > foo2
      4. for i in $( cat foo2 ); do
      5. ffmpeg -i $i.wma -ac 2 -ab 128 $i.aac
      6. done
      7. rm foo foo2
    2. hit the ESC key
    3. ZZ
  2. chmod a+x wma2aac
  3. ./wma2aac

All this goes to show that the versatility of Macs allow them to be capable of such elegant work arounds to what would otherwise be a very vexing problem. Oh, and Bill– lighten up! Learn to play nice with the other boys. You might have more fun that way.

As a Mac owner, I’ve really enjoyed how aesthetically pleasing everything is, including the icons. Even the tiniest icons look beautiful and clear. It only makes sense to make thumbnail icons out of your pictures so that you can view them in Finder. Freeware options exist to do this for you, but usually they require you to drag and drop or do it one folder at a time. You can just do everything. Now you can.

Turns out that one of the tweaks that Apple did to Darwin is called sips. It does lots of cool things with images but in particular it can add an icon thumbnail with the -i argument. And you can do this for multiple files, too. In fact, with a few more *nix commands, you can make a powerful statement that can search through your directories. For example, if you want to fix every image in your home (~) directory, you could do this in Terminal:

find ~ -iname "*.jp*g" -or -iname "*.gif" -or -iname "*.ti*f" -or -iname "*.png" | xargs -0 sips -i

This says to look through the whole directory structure that roots at your home directory and look for files that end with some typical image format extension (in a case insensitive manner) and then pass these files over as arguments (ignoring whitespace) to sips -i.

Actually for me the discovery of xargs was the real exciting bit. Many times I have wondered how to get past the fact that the pipe (|) doesn’t always work and this is why: they need to be passed as arguments. Duh. I mean this works fine:

ls | grep ".*jpg"

Which says list the contents of the current directory and then have grep search for any instances of lines ending with jpg. But if you add -l to ls then you get a directory listing, not a file listing. Try to pass this over to sips and it gets pissed. You can however, do the same thing as the above with ls | grep. In fact the command that will do the exact same thing is this:

ls -R | grep ".*[jJ][pP].*[gG]\|.*[gG][iI][fF]\|.*[tT][iI][fF]*\|.*[pP][nN][gG]" | xargs -0 sips -i

Which means list all the files starting with the current directory and work recursively through them and then pass it over to grep to look for one of these typical image file extensions in a case insensitive manner (note that the regular expressions that grep uses is a little more complicated than the simple asterisk in find) and then pass any lines that match over to sips -i as an arguement, ignoring any white space.

If you wanted to go all out, you could even contain that in an Automator application and run it every now and then! See, with a Mac, you can have the awesome power of *nix, but still have the easily-supported simple-to-use GUI environment that an Apple inheriently is. Jeez, maybe I should start working for them.

Bike Friday was once called the “Macintosh of the bicycle industry.” It should come as no surprise, then, that I’m a Mac geek. I must admit, though, that like a lot of Bike Friday owners approaching purchase for the first time, my love for the Mac didn’t come quickly.

When I was in high school I played with machines running OS Classic. I have to admit that the simple intuitive user interface was highly offensive to someone who was used to using the DOS command line and who had a general disdain for Windows. I thought of them more as “Fisher Price” computers marketed to novices for multimedia processing and pretty much ignored them. I kind of got the same feeling when Windows 95 came out. I shelled out to DOS, typed some command and got “wrong version” back. It turns out the version of my new DOS was “Windows 95 DOS” and so the darn GUI had taken over my machine.

I had enough of Microsoft at that point. I acquired a hand-me-down IBM ThinkPad and installed it with Linux, though I kept Windows on, just in case. I used the Slackware distribution which was the favourite of our old IS guy, Michael Calabrese. In the end, I found it was a little too little user friendly given that I didn’t have the time to figure out how to do simple things like configure the modem (which I finally figured out) or the sound card (which I never figured out). I tried Red Hat which made life a lot easier. I liked it but eventually the ‘puter died.

So when it was time for a new machine, I decided I wanted to continue this trend and avoid Windows. I looked around at various pre-set-up Linux boxes. I eventually came under the influence of a few Mac geeks, and was really interested to see them being employed in the epigenetics lab I was working in. In fact, almost all the science guys used them. And supposedly these machines weren’t so good for computationally intensive tasks? So after liking playing around with it at the lab, I did some more research and found that Apple had really grown up since I had last experienced their products.

The fact that there is a highly tweaked *nix core to Mac OS X (which is also a standalone Open Source release from them called Darwin) was highly appealing. It was also appealing to discover that because of the *nix core, it could play well with any file system, including *nix and Windows (though it’s interesting to note that Windows does not reciprocate). This meant that I didn’t have to have Windows on the machine (though it is nice to know that Intel Macs can now run Windows if need be).

Though student discounts certainly weighed into my decision, the thing that really tipped me over the edge was the thing that is currently most controversial. This is another thing that makes us so consistent with Apple: a stated committment to the environment (if you’re not familiar with ours, look here). They approach this not only from a manufacturing and design (this is particularly cool in that they try to make everything replacable/rebuildable– if not by the user, then at least by Apple Support) standpoint, but also have a huge recycling program where they will, among other things, take back old machines– of any brand! When you recycle your iPod (which you don’t have to because they can replace the batteries for you), you recieve a 10% discount on a new one.

Furthermore, my iPod was the inspiration for me to get rid of my CD collection and never buy another CD again. iTunes really makes this a reality. A recent study suggests that this indeed is a more environmentally friendly way of collecting and enjoying music.

There are really so many things I love about my Mac, which I realize is not perfect. It can be very difficult to figure out where BSD stops and Darwin begins and vice versa, for example. But this is really no big deal.

For example, in my CIS class, I can highlight some code in Safari and go to the Services menu and pick jEdit and tell it to make a new buffer out of it and *poof* there it is. The whole iLife suite is dreamy, not to mention many of the other included apps– iCal in particular is a big favourite and much better than other solutions I’ve seen. Disk Image technology is super cool and Exposé is an often used feature. Spotlight finds anything quickly.

And then there’s the whole AppleScript technology. You can literally make AppleScript-able applications do whatever you want. How cool is that? Oh and don’t get me started on how easy they are in terms of connectivity. I have easily connected to our network printer, VNC’d to a local machine, connected to the WiFi, whatever. Never a problem. In fact, just about everything is easy to set up.

Heck, I could go on and on all day. This brings to me my point: this is what our customers do. There is indeed a parallel between us. In fact, quite a few times I have found myself entertaining a great discussion with our customers on both Bike Fridays and Macs. For example, Joel Young, owner of the first official production BFFG and I have been known to indulge discussions on Macs, Fridays, fixed gears, Critical Mass, music, etc. So just as I am proud to sport my Bike Friday headbadge on my bike, I happily display my affection for Apple as well.

Maybe this connection goes deeper than we think. Perhaps I should suggest an Apple-like marketing strategy:

The team-kit equipped couch potato roadie says “I’m a bike” and insists he can ride. In fact, he just did 30 miles. And man, is he pooped. On the other hand, the more-fun loving world-travelled Friday owner says “I’m a Bike Friday” and says he can ride, too. In fact, he just got done circling the globe. And he can’t wait to plan his next trip.

It might just work.