about: twothirds | twothirds on the go (mobile) | Race Checklists

Saturday, March 24, 2007

Stupid Cool--DOS on a Mac in a JVM?!?

I just played a game of Donkey Kong on my MacBook in a browser window that was emulating [Free] DOS through a JVM. Hu? Give it a try yourself.

I also enjoyed the FAQ section. There has been a myth for sometime now that Java is slow. Well, from the authors (Emphasis added by me.):

How fast is JPC?
...Moreover, we have seen that in some circumstances a HotSpot JVM can outperform gcc-compiled C, so we believe a lot more is possible.

Why Java?
Basically, Java turns out to be ideal for this kind of project: it's robust, it works across many platforms, it's built with security in mind and, with HotSpot, it can run about as efficiently as natively compiled code...

Take that C and C++!

Labels: , ,

Sunday, March 04, 2007

MacBook Finally Healthy?

The MacBook is finally healthy for the first time since mid-summer. The top-cover was replaced the other day and my mouse button gives the proper feedback. I am still mulling over the extended warranty plan which is ~$250. Incidentally, the mouse click repair would have set me back about that same amount of money if I was not under warranty still.

Labels: ,

Friday, February 09, 2007

Apple LemonBook or Lemon MacBook?

I am fed up with my macbook. While I have been in love with the little guy when in working order, I have spent way too much time on the phone and traveling to visit my local Genius. I'm still not sure why I broke my never-buy-one-dot-oh-products rule.

The latest in the LemonBook saga includes
  • Defective battery
  • Limp Mouse button

This brings the complete list to four warranty items over the past ~7 months with the inclusive list being
  • Stained case (cover replaced)
  • Random shutdowns (internals replaced)
  • Limp mouse button (pending part replacement)
  • Defective battery (battery replaced)

While I am not much for extended warranties, I might make an exception and spring for the extended care. The biggest issue with all these repairs is "downgrade" process before requesting repair work. Each repair quest requires me to swap out my RAM and HDD upgrade. Quite the pain in the ass.

Labels: , , ,

Monday, January 29, 2007

Butler Config File for Improved OS X Shortcut Keys

A bit late, but as a follow up to this post, my "butler" config file can be grabbed here. With this config, I can:
o Use my "windows/*nix" shortcut keys for firefox such as "cntr t" and "cntrl r" (new tab/reload)
o Use "cntrl c/v/z/y/x/a" for copy/paste/undo/redo/cut/select all
o Retain a "break" in terminal for "cntrl c"
o Use "shift cntrl c/v" in terminal for copy/paste (ala gnome-terminal)

Thinking about this from a different mindset, the following might work out well for me and require less remaps:
o Swap the cntrl/cmd key
o Use the butler to remap "cmd" to "cntrl" for a few specific items such as sending a "break" in a terminal

Labels: , , , ,

Thursday, January 25, 2007

iTerm != iCrash?

When I first got my mac, I tried to use iTerm for my terminal needs since it supported desirable features such as:
* Copy on Select
* Middle click paste
* Configurable copy characters
* Tabs
* etc

Whenever I copy/pasted a large buffer, the bloody program would crash. So far, after 1/2 day of usage, the thing has stayed stable. While "gterm" on a mac works, the X11/OS X integration does lack a bit. iTerm might be a keeper!

Update 2/28/2006: iTerm did crash on me the other day. But I guess 1/month is acceptable.

Labels: , , , ,

Tuesday, January 02, 2007

TOSLINK Optical Mini Adaptor + DVD Upconversion + MacBook


I recently went all 1080p and realized how inadequate my 6-year old DVD player was. I could pay money to fix this problem with an upconverting DVD player or commit to one side of the bluray/hd dvd mess, but I decided to cheap out. My MacBook does a great job of rendering DVD's and even output optical audio for Dolby Digital goodness. With "Front Row", the setup is actually pretty slick. Unfortunately, the mac uses a "mini" optical output.

The good news--I own two of these from previous optical cable purchases. I had always wondered what device used them.

The bad news--I have not quite learned the "put your toys aways when done playing" life lesson. One two separate occasions, I have stepped on the cable and snapped both adapters. Bummer!

A trip to Fry's and Radio Shack (yes, I felt very dirty after that trip) revealed no one was going to have my desired adapters. I would have even settled for a new cable that included the adapter, but even the new cables lacked the adapter. Thankfully, after a quick amazon search, I have found my adaptor and ordered four more. This should last me for a month or so....

If you have ever sought these out unsuccessfully, read the amazon comments for a good laugh. For example, "You can't find this anywhere else, I'm serious. Bestbuy and Radioshack dont have them. This took me a while to figure out."

PS: If you are in the market for an optical cable, go with "GE". Not only do they include an adapter which you can step on, but they are reasonably priced unlike Monster Crap Cable. A cable should not cost $10/foot!

Labels: , , ,

Monday, May 29, 2006

Opie (otp) on OS X/Mac

I have to use opie to login to various servers that require one time passwords (otp). The Skey DarwinPorts package provides the required client, but I could not copy/paste the opie challenge and invoke the opie client:
jmichno@MacBook:~
> otp-md5 499 ba4826
-bash: otp-md5: command not found

This is easily remedied with a simple shell script:
/usr/local/bin/otp-md5
#!/bin/sh

CMD="skey -md5 $1 $2"
$CMD

And the after...
> otp-md5 499 ba4826
Reminder - Do not use this program while logged
in via telnet or rlogin.
Enter secret password:
SOCK AMES BANE BORN DIN COOK

Labels: , , ,

Saturday, May 27, 2006

Fixing the Mac "Terminal" with gnone-terminal

Update: iTerm may not suck anymore


While I have been happy with my recent switch to OS X for "home" usage, the mac--er OS X has not been as friendly for "work" usage. Since I spend most of my day hooked up to various machines through a command prompt, a quality "terminal" application is of the utmost importance. Some of the good qualities I look for in a terminal app are:
  • Auto copy mouse selection to the clipboard
  • Auto paste clipboard with middle mouse click
  • Tabs
  • Large scroll buffer
  • Focus follows mouse
  • Configure text selection characters (Hint: -A-Za-z0-9,./?%&#:_)
  • Reliability (aka does not crash)

Terminal.app
The "out of the box" option with OS X was pretty unusable. I immediately tossed the default OS X terminal since it could not copy the selection to the clipboard or paste with the middle mouse button.

xterm
After installing X11, the default "xterm" was a viable options, but it is a bit too barebones. Mainly, it lacks a proper scrollback, tabs are lacking and it is difficult to configure.

iCrashTerm
iTerm supported everything I wanted, but it would crash whenever I pasted a larger buffer. Since a crash causes data loss, iTerm was tossed.

gnome-terminal
Taking a look at the Darwin Ports project, I found what I needed--gnome-terminal. Since this has been my default terminal on solaris and linux for the past few years, this would be a welcome addition to the mac. After installing Darwin Ports, I was happily hacking away in my terminal of choice on Linux and Solaris.

gnome-terminal on the dock
I was able to configure gnome-terminal in the X11 menu, but I wanted to launch gnone-terminal from the dock. Below are the steps to get it done.

Assumptions:
  • X11 is installed
  • gnome-terminal is installed

The steps:
  1. Launch AppleScript (Applications > AppleScript > Script Editor)
  2. Create the following script:

    do shell script "/usr/bin/open-x11 /opt/local/bin/gnome-terminal > /dev/null 2> 1 & "

  3. Save the script somewhere using "application" as the file format
  4. 2xClick the new app and gnome-terminal will launch. If X11 has not been launched yet, this should launch X.

With a little luck, you might have gterm running from an icon....


To get gnome-terminal on the doc, drag the new AppleScript icon to the dock. Clicking the icon should launch a new instance of gnome-terminal. Of course, I do recommend using an alternative icon for your new app. The default OS X terminal app is what I use.



Extra Credit
Chances are you will want to launch gnome-terminal with a command line argument or two. The default "open-x11" does not gracefully handle arguments, but using this open-x11 script, you can pass arguments. I recommend dumping it to /usr/local/bin instead of overwriting the default script. With this modified open-x11, you can now update the AppleScript to something like the following:

do shell script "/usr/local/bin/open-x11 /opt/local/bin/gnome-terminal --show-menubar --geometry=80x50 > /dev/null 2> 1 & "

Labels: , , , , ,