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
gnome-terminal Keyboard Shortcuts in OS X
After installing the Darwin ports gnome-terminal app, I noticed my favorite keyboard shortcuts were not configured. The Edit > Keyboard Shortcuts tool was not working for me, so I was stuck without my favorite shortcuts such as “New Tab”. After remapping a few shortcuts on a Solaris box, I figured out the correct config to hack up. To setup some simple keyboard mappings such as new tab, new window, paste, etc, do the following:
- Create a directory for the keybindings
mkdir -p ~/.gconf/apps/gnome-terminal/keybindings
- Edit a [new] %gconf file
vi ~/.gconf/apps/gnome-terminal/keybindings/%gconf.xml
- Paste in some mappings. Below are a few standard defaults
<?xml version="1.0"?> <gconf> <entry name="new_window" mtime="1148771763" type="string"> <stringvalue><Shift><Control>n</stringvalue> </entry> <entry name="new_tab" mtime="1148771848" type="string"> <stringvalue><Shift><Control>t</stringvalue> </entry> <entry name="copy" mtime="1148771848" type="string"> <stringvalue><Shift><Control>c</stringvalue> </entry> <entry name="paste" mtime="1148771848" type="string"> <stringvalue><Shift><Control>v</stringvalue> </entry> <entry name="switch_to_tab_1" mtime="1148771848" type="string"> <stringvalue><Alt>1</stringvalue> </entry> <entry name="switch_to_tab_2" mtime="1148771848" type="string"> <stringvalue><Alt>2</stringvalue> </entry> <entry name="switch_to_tab_3" mtime="1148771848" type="string"> <stringvalue><Alt>3</stringvalue> </entry> <entry name="switch_to_tab_4" mtime="1148771848" type="string"> <stringvalue><Alt>4</stringvalue> </entry> </gconf>
Note:
- After adding the mappings, restart X
- I cannot get “copy” to work, but paste seems to work??
- If you are looking for other remaps, you can always update a keybinding on a Solaris or Linux box and inspect “~/.gconf/apps/gnome-terminal/keybindings/%gconf.xml” for the correct config value
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:
- Launch AppleScript (Applications > AppleScript > Script Editor)
- Create the following script:do shell script “/usr/bin/open-x11 /opt/local/bin/gnome-terminal > /dev/null 2> 1 & “
- Save the script somewhere using “application” as the file format
- 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=80×50 > /dev/null 2> 1 & “

Apple IIe –> MacBook

Apple IIe–that was the last Mac I used. I was in primary school and Mr. Santich (or whatever his name was) was teaching us how to use “Logo” in between Vulcan death grips to the neck to keep us in line. (I still have nightmares about that damn turtle. I could never get him around the maze.) I am not really sure why I “switched”. I think I was just fed up with crap x86 hardware that was heavy, loud, hot, battery hungry, buggy under Linux and undesirable under windows. Impressions to follow…
Red Pill (Matrix) Screen Saver — MAC OS X Intel (x86)
I just got a MAC. Yeah? Damn the “open apple” key and its non-Cntrl c/v copy/paste functionality. Anyway, one of the first things I looked for was a “matrix” screensaver. I found “Red Pill“, but it was not Intel friendly. Taking some advice from the forum, I grabbed the source and compiled an intel version. Not too difficult, but I have no idea how to properly package the app–I just dumped everything into a zip file. So, with no warranty of any kind, and kudos to the original auther, the Intel Red Pill bits are here.
Update: I recompiled with the “universal” option. This might work on Power PC as well, but since I do not have a PPC box YMMV.
Update Jan 16 2008: File moved to off-site storage to lower my bandwidth costs.

