November 01, 2006

GLX Stereo Visuals

Oh yeah, I'm really glad that 51 MB of bandwidth was used up so I could have GLX Stereo Visuals! I was dying over here without them. That definitely could not wait until the next major OS patch. Or Leopard. Yeah! Wooooo. Hoo.


Screenshot 63

Posted by billo at 05:40 PM | Comments (0)

October 31, 2006

Weird Mac OS X Font Corruption

Every now and then, if I have been logged into my machine (Mac Pro, OS X 10.4.8) for a few days, I get weird font corruption. It affects a single character, usually a "t" or a "\"

And it affects all my apps: emacs, terminal, etc that use that same font (in my case, Monaco 10pt.)

See the goofy back slashes:

Backslash Corruption

Then log out, and log back in again:

Screenshot 61

It's creepy, and annoying, because it takes a while to figure out why things
on the screen don't quite look right.

Posted by billo at 11:03 AM | Comments (0)

October 20, 2006

WinXP Home under Parallels VM on Mac Pro

Parallels, the popular virtual machine software that is available for Intel Macs, recently came out with a stable patch that works on 64-bit Intel Macs. I downloaded it, found it no longer panicked my Mac (quad-core 2.66 xeon, 3GB RAM), and decided to buy it.

I then installed Ubuntu on it. It works fine.

Then I downloaded the beta version of Windows Vista, just to see what it was like. It's very shiny, a very hungry memory hog and kind of slow. I attributed a lot of the slowness to the fact that it was running in the VM. Vista boots in about 2-3 minutes, and everything is very sluggish to start up.

But then I got a copy of Windows XP Home, and installed that under Parallels*. Holy crap, the thing boots in 6.5 seconds. 6.5 SECONDS!!! FireFox running in XP in that VM starts INSTANTLY, like in zero seconds. If I run FireFox "natively" it takes 3-4 seconds to start. That blows!

This leads me to leap to several wildly unsubstantiated conclusions:

1. Vista is a huge, ugly (but shiny) pig, and I'm not going to buy it for playing computer games until the standard $1000 PC is a quad-core 4 Ghz 64 bit xeon with 8GB RAM. Probably around 2008?

2. An old, old OS like Win XP (from 2001, right?) runs pretty fast on the latest hardware, five years later.

3. Mac OS X Tiger is a lot more bloated and sluggish than it should be. How can a basic app like FF start so slowly?

*You might ask "Why would you want to run Windows XP on your Mac?" There is only one reason: so I can test running IE6 and IE7 against the web site at work. It doesn't happen often, but occasionally I'll make a change where it looks OK on FireFox, but bad on IE.

Posted by billo at 05:52 PM | Comments (1)

October 13, 2006

Quick Setup Guide for Mac OS X

This is how I like to set up Mac OS X. This article is a work in progress. I'll post updates from time to time.

First, install OS X Tiger (10.4) and apply all patches.

Open system preferences, and make the following adjustments:

Preference Area Settings to change
Appearance Turn off text smoothing to the maximum possible degree (choose a high number.)
Dock Make the Dock very small. You really won't be needing it much.
Turn of magnification.
Minimize using "Scale Effect": this is much faster, or appears so.
I don't like to automatically hide/show the dock, but some people do.
Security Disable automatic login
Set a master password, just in case some moron turns on FileVault. DO NOT TURN ON FILE VAULT!
Require password to wake from sleep (if you are paranoid like me).
Spotlight Spotlight is a pig. It hogs HUGE system resources and it doesn't actually work. I recommend disabling it, which I detail later in this article.
Energy Saver If you are setting up a desktop mac, you really don't want it to go to sleep, ever. So it can download patches and do other stuff while you are away. And so you can connect to it remotely. So set computer sleep to "never," and set display sleep to whatever you want, to avoid burning out your monitor and to save electricity.
Keyboard and Mouse
I crank Key Repeat Rate and Delat all the way up to the max (fast/short).
.Mac
A .Mac account it worth having if you have more than one mac AND you use Address Book, Apple Mail, Calendar or Safari. For me, Address Book is the thing: a .Mac account keeps it in sync and backed up no matter what machine I am on, work or home.

Aside from that, .Mac kinda sucks.
Network
If you have a generic home network, then you can just leave the network settings alone. I'm picky, however, and I like to be able to remotely access my machines. So I always manually assign TCP/IP addresses.

If you have a notebook Mac, the Location feature is awesome. You can save all your settings related to networking in different locations (home, work, starbucks, etc) and not have to reconfigure it every time you move around.
Sharing
The Sharing tab is really more like a service control tab. If you want to share files on the network, etc. To enable SSH server (so you can log in to your mac from another machine), enable "Remote Login". To enable remote graphical access (via VNC) enable "Apple Remote Desktop" and then choose "Access Privileges" and enable VNC viewers.

If you are on an untrusted network, turn on the firewall.
Accounts
For the cautious/paranoid (like me): go to "Login Options" and show users as name and password; also enable fast user switching.
Date & Time
Use apple's time server to set date and time automatically.
Software Update
check for updates daily; download important updates in the background.

Open a finder window. Navigate to Applications (on the left nav bar.) Scroll to "Utilities." Drag this icon to the navbar. Now you have a shortcut to Utilities.

Go to Utilities, drag the Terminal icon to the dock. Now you can launch a terminal when you need it.

Open a terminal. If you like tcsh, do chsh; if you like bash, do chsh bash; etc.

Enable verbose booting:

% sudo nvram boot-args="-v"

Install extra stuff that is not installed by default

X11: the X11 server is not installed by default, but it is on the OS X Tiger DVD. See additional packages and install it.

Xcode: you need this to compile any open source software. It's gcc, cvs, etc. It's on the Tiger DVD, but you should probably get the latest version from http://developer.apple.com/

Must-have freeware:

Quicksilver: http://quicksilver.blacktree.com/

Adium: the Apple iChat client (an AIM client without advertising!) is pretty nice, especially the way it integrates with Address Book. But it has some annoying characteristics, the biggest of which is that you can't make the fonts smaller. So if you have a large buddy list, you can only see mayb 35 of them, depending on the side of your monitor. Adium is similar to iChat in that it is very restrained design-wise, but you can make small fonts in the buddy list. It also talks Yahoo, MSN, ICQ etc. Not that anybody uses those.

FireFox: http://www.getfirefox.com/ Right? right.

Chicken of the VNC. A VNC client. Google for it. It's nice.

Emacs: Mac OS comes with emacs, but it's strictly terminal-based. If you want emacs in it's own window with full color and mouse support, either build it yourself (challenging) or get it from here: http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html

The Gimp: (you need X11 installed to run this): http://www.gimp.org/

Flickr uploadr: assuming you have a Flickr account. Get it from http://www.flickr.com/

Yahoo! Widget Engine: Apple ripped off the idea of dashboard from Konfabulator, and ruined it completely. Get the original, now called Yahoo! Widget Engine. http://www.konfabulator.com/

Email

Email clients are a very personal thing. If you love Thunderbird, by all means get it for OS X. If you are an Outlook user, or have no particular allegiance, I suggest you try the Apple mail client. It's called "Mail." (Why they decided to call their web browser "Safari" instead of "Web Browser" is a mystery to me. Apple is nothing if not inconsistent, but in an annoyingly hip sort of way.) It works really well with Address Book, pretty much seemlessly autocompleting contact names that are in there. It's like Outlook, except the applications ARE separate: you don't have to launch your mail client to look up somebody's phone number.

If you don't like fat mail clients, just use gmail or whatever. I like using gmail, but I use the Apple Mail client to pop messages off. That way I can speed through the morning mail queue, but all the messages are up their on gmail for me to search through. Yeah, spotlight is supposed to search mail, but a) it sucks, b) it doesn't work, and c) it only searches stuff on one computer. I need my email on a server.

System Services

Spotlight first: it's broken and piggy. Open a terminal, "sudo emacs /etc/hostconfig" and change the SPOTLIGHT setting to -NO-

Dashboard: it's a pig, a ruined version of Konfabulator. Turn it off. In a terminal:

defaults write com.apple.dashboard mcx-disabled -boolean YES

killall Dock

Postfix: I like to enable a locate mail transfer agent. The one that ships on Mac OS X by default is Postfix, and not Sendmail. It's a sign that Apple knows what they are doing. Edit /etc/hostconfig and set POSTFIX=-YES-. You can reboot, or you can do /System/Library/StartupItems/post

That's it

That's all I really think you need to do to get a Mac from opened box to tamely usable. It's really not much, when you compare what most people do to get Windows the way they like it. Mostly this is because the stuff that is enabled by default on a Mac is fairly minimal. You actually have to turn extra stuff on.

Posted by billo at 07:57 PM | Comments (2)

September 19, 2006

DIY SMART disk reporter.

Most (all?) SATA drives have self-diagnostics that report hardware problems. There are a number of freeware utilities available to monitor your disks for problems via this feature.

Here is a do-it-yourself SMART reporter. First create this script, and name it bin/macmaint or something.

#! /bin/sh
email=[email protected]
host=`hostname`

diskstatus=`/usr/sbin/diskutil info disk0 | grep SMART | awk '{print $3}'`

#debug
#echo $diskstatus

if test "$diskstatus" == "Verified"; then
    #echo "disk ok"
    /usr/bin/true
else
    #echo "disk very bad"
    /usr/sbin/diskutil info disk0 | mail -s "Disk problem on $host" $email
fi

Next, add it to your crontab, like this.

% crontab -e

05 * * * * bin/macmaint

This will run once/hour, and email if anything goes wrong.

Posted by billo at 09:43 AM | Comments (0)

September 14, 2006

Mac Pro unboxing


Mostly this is a test of blogging from flickr.

Posted by billo at 10:57 AM | Comments (0)

September 13, 2006

Powerbook back to Tiger

Remember how I switched my old powerbook to Ubuntu?

Well, I switched back. The finer points (WPA support, good power management)
just made it not worth it.

I did a clean install of tiger, and turned off spotlight and dashboard. It's
reasonably usable now; I'm going to try hard to avoid installing
anything but the bare minimum on the machine.

So far: only Firefox, Developer Tools and Darwin Ports.

Posted by billo at 02:31 PM | Comments (0)

September 08, 2006

Parallels and Mac Pro

I tried out the update to Parallels for Mac yesterday. The good news is that it doesn't panic my Mac Pro instantly. The bad news is that it does panic it at least some of the time, and the worse news is that VT-x support is apparently disabled by the boot ROM on the Mac Pro. So everything I tried ran pretty slowly.

This is apparently a problem that afflicts certain Mac Intel Minis, and there are some instructions for adjusting the nvram to enable VT-x. But that's not something I can really fool around with; if my Mac Pro becomes unbootable, it would not be fun.

I think it's worth waiting a bit before Parallels is fully baked on Core 2 Xeons.

Posted by billo at 01:50 PM | Comments (0)

August 29, 2006

Parallels Desktop and Mac Pro

As I noted, Parallels panics my Mac Pro. Presumably it's some kind of 64-bit thing. Parallels has now officially acknowledged the problem, and it looks like a new build will be coming very soon.

Posted by billo at 01:11 PM | Comments (0)

Tips for installing Ruby mysql module in OS X Tiger

I got my new machine and my ruby installation was pretty broken. The ruby that comes with Mac OS X is hopelessly out-of-date, and I had forgotten the things to do to get it to work.

Hand-building ruby from source to get to 1.8.4 is the first thing to do. Then I move the /usr/bin/ruby that comes with mac out of the way and create a symlink to /usr/local/bin/ruby, and ditto for /usr/lib/ruby (symlink to /usr/local/lib/ruby). That way I'm not going to get confused and launch the wrong ruby.

Then, you need to install the Ruby mysql module. I guess I'm a mysql bigot, but don't most people use mysql? I know that there are lots of choices out there, but mysql is what most people use, just for fooling around with stuff at least. Seriously.

To build ruby mysql, follow the instructions at the tmtm.org. In particular, you want to make sure that the configurator can find your mysql includes and libs, e.g.:

% ruby extconf.rb --with-mysql-dir=/usr/local/mysql

Posted by billo at 11:37 AM | Comments (0)

August 15, 2006

Enable Postfix mail on Mac OS X Tiger

I got my shiny new Mac Pro. It's wicked fast. But now I get to find all the obscure modifications I made to my old machine over the last 2.5 years, and figure out how to reapply them.

First, increase the stupidly low process limit.

Next, enable Postfix (thanks to Mac OS X Tiger for Unix Geeks):

Edit /etc/postfix/main.cf and set up these variables:

# my machine name is "buffy"
myhostname = buffy.example.com
mydomain = example.com
myorigin = $mydomain

If you want mail forwarded to yourself (if you have cron jobs that will send mail to your local account, for example), edit the aliases file:

# put your local aliases here 
billo:  [email protected]

Now you need to start postfix:

sudo postfix stop
sudo postfix start

Finally, you need to put postfix start in a startup script in /Library/StartupItems. Left as an exercise to the reader.

Posted by billo at 11:05 AM | Comments (0)

August 11, 2006

Ubuntu Linux on Powerbook G4

I got sick of how slow my old powerbook (800MHz) G4 was running Mac OS X (Tiger). I wiped out the disk and installed Ubuntu 6.06. It seems to be just working. Sound, graphics, battery management and wireless network all seem to work out of the box. Unfortunately, it doesn't come pre configured with essentials like emacs or tcsh, so I have to add those.

Seems to boot a lot faster, to start!

Update:

Some bad things: sleep/suspend don't seem to actually work; the fan is still going while it's "asleep."

WPA2 encryption is known not to work, apparently, a big/little endian thing in the base driver.

There is no nvidia driver for PPC, only i386.

I'll stick with it for a few weeks to see if the no sleep/no WPA are showstoppers.

Posted by billo at 04:18 PM | Comments (2)

August 07, 2006

Mac Pro

Oh baby.

Screenshot 44

Posted by billo at 03:46 PM | Comments (0)

Apple WWDC fanboy-dom

I'm all anxious about WWDC. I'm most interested in Leopard (OS X 10.5) announcements and the Mac Pro.

Leopard: I really hope they turn virtualization into an OS feature. How great would it be to be able to run a little Linux VM and one or two Windows applications right out of the box? Also, spotlight just blows. They should fix it or remove it. If they remove it, maybe google will finally release google desktop for OS X.

Mac Pro: the other nerds at work who run Intel workstations (Ubuntu) endlessly tease me about my slow G5. I've got no upgrade path to fight back until the Intel workstation is released. I hope the Mac Pro is fast.

Jon Gruber (Daring Fireball) has a bunch of WWDC predictions. I'm a big fan of his articles, and I agree with much of this one. However, he takes a little dig at the old "striped" interface decorations in OS 10.0 and 10.1 (X.0 and X.1?), calling them goofy and ugly. What about brushed metal? How can that possibly be considered any less goofy, ugly or childish? I'm hoping they make a universal control in Leopard to set the skin of applications. Let people with no taste make their UI look ugly if they want: let the rest of us have plain, elegant austere windows.

Regarding the Apple Phone: it would be really great if Apple brought focused design and simplicity to the wireless communication device. To me, that means making a phone that is great at making phone calls, and explicitly not an iPod. Adding a phone to an iPod or vice versa ruins the simplicity and elegance of both. (Not there there are any simple and elegant phones these days. How I miss my Nokia 8800!) What I would like to see from Apple in the wireless space:

- A dedicated push email device. Like a blackberry, but no phone BS. Think Nano form factor. But no iTunes.

- A dedicated phone: with big physical keys: 0-9, #, *. Maybe with push email. No iTunes. Please. Think nano form factor again, but maybe clamshell (fold nano in half.)

Posted by billo at 08:10 AM | Comments (0)

July 09, 2006

Note to self: Mac utils to investigate

DropCopy from 10base-t.com: a bonjour file-sharing utility

RCDefaultApp: new version is available.

Sharepoints: NFS/SMB/AFS file share management application. It's now donate ware, which I always am happier to pay than shareware.

Mactracker: a nifty looking mac hardware information database.

Posted by billo at 06:38 PM | Comments (0)

July 05, 2006

My wishlist for the new Mac Pro

Rumors are starting to fly about what will be new, exciting and different about the upcoming Mac Pro. Here's what I'm hoping for:

Reasonable size: sorry, but even though the G5 looks cool, I really don't get why it has to be so much bigger and heavier than 95% of other desktop/tower machines. The thing weighs a ton, has two inches above and below that aren't even vented. Yet it only has two hard drive slots and one 5.25" peripheral bay. So I either use half my desk, or bang my knee into it.

Speed: I'm so tired of my super slow G5. I'm a programmer, not a movie editor, not a music producer. The 64-bit velocity engine does me zero good running MySQL, javac and emacs. I need clock cycles. Lay on the gigahertz, baby! If it's not at least 3.2 GHz, forget it. I'm switching to Ubuntu.

Drive bays: as I said, two drives in the G5 just blows. Give me at least four 3.5" SATA bays, so i can load it up with 2TB of storage.

A real desktop form factor: this relates to the size thing. The G5 is for most purposes, a server. It's too big to sit on a desk. But if it's under the desk, you have a mess of cables. It would be good to have a lower-profile layout. Something that a monitor could reasonable sit on top of, and something that would have a full complement of front ports: audio in/out/optical, USB, firewire. I'm thinking of the old Sun SPARCstation pizza box. It would have to be wider and/or deeper, but the low height and utility as a monitor stand were just right.

Some cool gadgety features: I know Apple likes cool, elegant design. And this wish wouldn't make that easy. But, this supposed to be a pro Mac. Meaning, it's in a studio, lab or office. It's not an iMac that needs to look nice in a living room. Right? So how about: a flash reader; a halfway decent speaker with a physical volume control knob; an integrated microphone and iSight.

I have a feeling I'll get nothing I want on this list. Ok just, the speed. That's all I really care about. Please.

Posted by billo at 09:54 PM | Comments (0)

June 29, 2006

How to add mod_jk to apache on Mac OS X

The apache that ships with Mac OS X is still 1.3, not 2.0. Not that this matters, but it surprised me a little.

1. Download mod_jk from apache.org. I used 1.2.15, which is what we use on our Linux machines at work.

2. Compile mod_jk like this:

cd jakarta-tomcat-connectors-1.2.15-src/jk/native
./configure --with-apxs=/usr/sbin/apxs
cd apache-1.3
make -f Makefile.apxs
sudo cp mod_jk.so /usr/libexec/httpd

3. Edit /etc/httpd/httpd.conf:

#jk must be before rewrite
LoadModule jk_module libexec/httpd/mod_jk.so
LoadModule rewrite_module libexec/httpd/mod_rewrite.so
.
.
#jk must be before rewrite
AddModule mod_jk.c
AddModule mod_rewrite.c

4. Define your worker properties and jk mounts normally.

5. restart Apache:

/System/Library/StartupItems/Apache/Apache restart

Posted by billo at 11:53 AM | Comments (0)

May 19, 2006

Note to self: SuperDuper backup software

My friend julie pointed me at this package. Possible recommendation for mom and sister, looks like nice simple backup solution for mac.

Posted by billo at 10:46 AM | Comments (0)

May 16, 2006

You want that in black? That will be $150.

"How much more black could it be? The answer is none. None more black."

The new consumer-grade Apple notebook computer, the MacBook, is available in black or white. However, as far as I can tell, the black one is $1499, and the white one is $1299. The only difference aside from the color is that the black one comes with a 20GB bigger hard disk. But you can upgrade the white one to the same hard drive for $50.

So being stylish will cost you $150. That's either very clever or very stupid. There's such a fine line between the two.

Posted by billo at 09:49 AM | Comments (0)

May 15, 2006

memcached on Mac OS 10.4 slowness fix

We use memcached at work to vastly reduce load on the application servers and on mysql. The problem is that on Mac OS 10.4 Tiger it was so slow as to be worse than not using it: one query would take 5 seconds, instead of like 5 milliseconds on Linux. It was never a huge deal, because we deploy on Linux, and there are lots of Linux machines around the office. But it made it hard to run a self-contained deployment environment on the developer's Mac.

My friend Derek found this article, which details the fix. I tested it, and it works for me. Super short summary:

Edit memcached.c and add (anywhere above line 105, which reads #ifdef TCP_NOPUSH) the line:

#undef TCP_NOPUSH

Then


make install
setenv EVENT_NOKQUEUE 1
/usr/local/bin/memcached -m 128 -p 11211

Posted by billo at 05:00 PM | Comments (0)

April 13, 2006

What will the new Intel desktop Macintosh line be called?

Apple has rolled out intel processors on consumer desktops (Mac Mini and iMac), and on the pro notebook line (MacBook Pro). It seems pretty clear that the consumer notebook will be called "macbook."

What will the professional desktop line be called? This is the successor to the Power Mac G5.

It can't be called G6, or "Power" anything because it's not a PowerPC chip.

My guesses:

Posted by billo at 09:52 AM | Comments (0)

April 04, 2006

Spotlight is such crap.

Spotlight, Apple's answer to Google Desktop (or possibly Apple's answer to Longhorn's Vista's never-completed über file system), just doesn't work. It's garbage. It eats up my system's memory and CPU at random intervals. It chugs along super-slowly and can't even find anything most of the time.

Often, I will be looking for a file, and I can with my human eyes and hands find it faster than spotlight. Which is easy because a lot of times spotlight can find it like NEVER. Seriously.

Maybe it's just me; maybe because I have 30,000 files adding up to 115GB, Spotlight goes non-linear.

So don't run out and buy Tiger because you believed Jobs' demo of it. The reality distortion field still works.

Posted by billo at 03:47 PM | Comments (0)

March 30, 2006

How to transfer big files between two Macs using a firewire cable

If you have two Macs and a firewire cable, you can make a superfast TCP/IP connection over which you can ftp or ssh or whatever. Here is a step-by-step way to do it, mostly for my own benefit, so I don't have to think too much.

Pretend you have two Macs. In my case, I have a G5 and a Powerbook.

1. Connect one end of the firewire cable to the G5; connect the other end to the Powerbook.

2. On each computer, open the System Preferences->Network panel.

3. Switch each panel to Show: Built-in Firewire.

4. On the G5, use these settings. You can pick and IP subnet you want, but I used 10.43.0.0/24 for no particular reason, other than it is different than my LAN:

Screenshot 12

5. On the Powerbook, use these settings. The only difference is that the IP address is different:

Screenshot 13

Now go to either computer and open a file share, or ssh, or ftp, or whatever. Use the IP address of the other machine. For example, on the powerbook:

% scp bigfile.tar 10.43.0.1:

Or:

Finder -> Go -> Connect to Server and use afp://10.43.0.1/ (assuming you have Apple File Sharing enabled).

Hints and possible problems:

1. Make sure your Firewall is OFF on both machines, or you at least set the right ports open.

2. Make sure Built-in Firewire is enabled on the Network Port Configurations screen on the Network Panel.

Posted by billo at 02:00 PM | Comments (0)

Growl notification managed for OS X

Growl is a really cool utility. It essentially lets you unify all "you have mail" or "something happened" or whatever notifications. At first it seemed a little pointless to me, but after using it for a few days, I really like it. Also, I'm discovering that some applications that I really like are growl-enabled, like ecto.

Posted by billo at 09:14 AM | Comments (0)

March 27, 2006

Quicksilver

Quicksilver is a clever indexer/launcher tool. It's been around for a while. A friend of mine tried to get me hooked on it over two years ago. But I didn't quite catch it.

Since then I had accumulated about 50 applications in my dock; I would often be aiming to click on, for example "emacs" and hit "textmate" instead. So I tried Quicksilver again, and now I am an addict. My dock is reserved for the few most used apps (emacs, firefox, ichat, mail, textmate) and then for a bunch of things I don't use much, but are useful. I have in the dock because I would actually forget I have them, or I would forget their names. That's how senile I am.

So try it; maybe two years from now you'll try it again and get addicted.

Posted by billo at 12:07 PM | Comments (0)

March 23, 2006

Gmail Notifier for Mac is broken.

I stopped using the Mac Gmail notifier a while back, because it was acting strangely. They came out with an update today, so I tried it again. It's broken in a somewhat scary way. Here is my setup:

1. I have two gmail accounts: one is for my work email, one is for personal.

2. I keep FireFox (my default browser) logged in to my personal gmail.

3. I keep Safari logged in to my work gmail.

4. I set up gmail notifier to monitor my personal gmail.

But, surprise, when I use gmail notifier, it is looking in my work gmail. This is even though my account settings are telling it to use my home gmail. How could it possibly be getting my work gmail? I was suspicious that it was looking at Safari somehow. So I opened Safari, signed out of my work gmail, and now gmail notifier thinks I have no mail. Even though I do have unread mail in my account!

Based on this exhaustive 7-minute investigation, it appears that gmail notifier is looking into Safari cookies and is ignoring the account settings I told it. This is in spite of the fact that Safari is not my default browser.

Bummer.

Posted by billo at 09:09 AM | Comments (1)

March 16, 2006

SSH tunneling VNC

Sometimes I need to be able to get into my Mac at home, with the the full GUI and not just ssh. To do this, I use ssh tunneling. There are many variants of this recipe, but if your network is like mine, this one will work for you.

At home I have a fixed IP address, and I have my router set to forward port 22 to my bastion host. This is a minimal linux server with nothing much on it. To log in to any machine at home, I ssh to the fixed IP of my router, which forwards to the bastion host. Then from there I can ssh to any machine at home: the mac mini in the family room, the old g4 cube in the office or the old pentium 3 linux machine that serves as my internal DNS.

Caution: It's of course very important that the bastion host be kept up-to-date, and have very good passwords on the few account that are ssh-able. More than once I've had my house "hacked" because of vulnerabilities in various network services, and that is no fun. Fortunately, I've always detected the hackage within a few hours because of tripwires I had set up. It's also a very good idea to use IP tables to limit the places on the net that can connect to your SSH. For example, I only allow connections to my house from the IP addresses at work and at a couple of other places on the net. This makes my home server unreachable from the random hackers trolling for open SSH connections. This means, if I need to ssh tunnel from a new location (like from a Starbucks), I am out of luck.

On the Mac itself, you need to enable Apple Remote Desktop. This is nothing more than an enhanced VNC server. If you buy the ARD client it has some nice extra features like remote software updating, and probably optimized performance. But you can use any free VNC view to connect. I like Chicken of the VNC, mostly because it has a silly name. To enable ARD on your Mac, open System Preferences, click Sharing, check "Apple Remote Desktop," open the "Access Privileges" dialogue. Enable "VNC Viewers may control screen" and choose a password. The password could be something simple, because you aren't going to expose VNC to the network, you are tunneling over a secure connection.

For our example, let's pretend that your router fixed-IP has a DNS name of home.example.com; your mac at home has an internal DNS name of mini.home.example.com.

From outside your network, on your Mac with Chicken of the VNC, open a terminal and do:

ssh home.example.com -L 5901:mini.home.example.com:5900

After you sign in with ssh, your terminal window will show you signed in to the bastion host. You need to leave that running to keep the tunnel going.

Now, open Chicken of the VNC. You should add a new server entry, as shown. Use "hostname" and Display 1. Display 1 is 5901; if you tunneled from 5902, the display would be 2. The password should be the simple password you created on the remote Mac under Apple Remote Desktop access controls.

Screenshot 10-1

Click "connect" and you'll be connected. One more tip: don't put background images on your Mac desktop at home, since this will make everything REALLY slow. A solid background color is best.

Posted by billo at 08:30 AM | Comments (0)

March 02, 2006

Software Update Heart Attack

I installed the latest security patch from Apple this morning. It required reboot (come on, Apple, quit it).

After reboot I could not log in with my normal username. We're using an LDAP login on our network, so I figured it was some kind of hiccup with that. Not to worry, I thought, I'll just use my backup (local) user account and see what's what.

Oops, that one wasn't working either. Oh crap. Did I forget the password?

Panic starting to set in. I have a lot of work to do today, and I don't want to blow the morning doing an OS repair. And I certainly don't want to endure the taunts of the Windows who sits at the desk on my left. Or the Linux user who sits on my right, for that matter. No problem, I'll ssh in using my public key. That will bypass any password issues, LDAP or otherwise.

So I hopped on to my backup keyboard (connected to my backup machine, which happens to be Ubuntu Linux).

slayer% ssh buffy
ssh: connect to host buffy port 22: Connection refused
slayer%

OK. Now I'm freaking out. I really don't want to pull out the install DVD. In desperation, I reboot again. That should make no difference, right? Wrong. Everything is fine on reboot. As if nothing was ever wrong. No trace of a problem can be found in the system logs. Ugh.

Lessons:

1. make sure you know your backup account password.

2. don't accept reboot patches in the middle of the morning.

3. think seriously about switching to linux full time. (giving up itunes would be hard)

UPDATE: Derek just did this update on his mac, and it actually had a thing that said "ok you need to reboot one more time." Looks like they patched the patch, and I am not nuts.

Posted by billo at 01:52 PM | Comments (0)

February 08, 2006

Linux Machine as File Server for Macs

I'm not sure exactly why I want to try this, but it seems like a good idea. I have this super cheap Dell file server I built for less $1/GB. It has 1TB of disk storage (on 4 250GB disks), and was about $900, including the server itself. It's some low-end model that has 4 SATA slots. The key is not buying the disks from Dell. You can get 250GB SATA disks for about $110 now, and the server is like $399 or something. I'll bet you could get one even cheaper if you tried.

In any case, the only way I have been using the server is do network backups of my Macs at home: an new one (mac mini), a sort of old one (2003 G5) and a wicked old one (2000 G4 Cube). Each mac is pretty isolated otherwise, and there is a lot of overlap, and the small one (the mini) is always low on disk space. So I wanted to be able to use that big file server to do something like store all my music files and iMovie projects in one place (not counting backups). But I've had bad luck in the past mounting network file systems on a Mac (samba or NFS). It seems like the lack of resource-fork stuff almost works, but not quite. Things get weird, and break in odd ways.

So my hope was that I could have the Linux machine serve up Apple shares more "natively" and that would make things better. I did some research and found netatalk, which is a full implementation of an Appletalk file server for unix. So far, it's worked like a charm. I installed the RPM, and was able to connect to my home directory on the linux machine without any problem. I'll have to try more things later tonight, like editing an iMovie project over the network and see how that goes.

Posted by billo at 02:33 PM | Comments (0)

November 28, 2005

A Critique of Mac OS X, as a unix flavor

Thomas Driemeyer at bitrot.de has a nice critique of Mac OS X as a unix implementation. (thanks julie for the link!)

On the whole, I would agree with his technical criticisms of Mac OS X, especially regarding the "spinning rainbow of death." The rate of its appearance has seriously stepped up, for me at least, since tiger. I feel like I am back on a crappy Windows machine waiting for floppy drives to spin up, whenever I open a file dialog.

His UI criticisms are on softer ground: I would say they are mostly a matter of taste, and the same old thing: either you like menu bars attached to windows, or you like them on top of the screen. I used to be a big fan of having them inside the windows, because that's what I was used to from Vax VWS, X11, Motif, and Windows. But there are distinct usability advantages to having the menu in one place on the whole screen, specifically:

1. You can be a lot less precise with your gesture to get to the menu bar: you just "slam" the cursor up to the top of the screen, and only have to fine-tune the horizontal position.

2. there is that much more screen real estate  in each window for the application.

 

Posted by billo at 04:19 PM | Comments (0)

November 22, 2005

Vuescan is AWESOME.

I have this cheap Canon USB flatbed scanner that I bought about a year ago. I use to have a fancier HP scanner that I bought about 8 years ago, but it is SCSI, and I don't really have any computers that do SCSI any more. (It's really annoying that there is no Mac OS X support for the Adaptec 2940 SCSI PCI card that I have, but that's a rant for another day.)

When I got the scanner, I had a hard time getting it working. Mostly this is because (unsurprisingly, I guess) the drivers that came with it were complete garbage. When I got it, the drivers were for the Mac OS version that was already old, and they haven't updated their downloads on their web site.
In any case, I needed to use the scanner the other day, and I realized I had reinstalled my OS since the last time I used it. And whatever hacks I did to get the scanner to work before, I didn't remember. Or maybe they just wouldn't work with Tiger.

After some googling around, I found Vuecan, a third-party scanner software package that claims to support most scanners. I tried the free download, and it worked perfectly. No setup, just copy the app into place, and it works. It's a really nicely usable package too; it strikes the balance well between being a data capture tool, and a useful imaging application.

They have a Linux version also, so I am going to try to revive my old SCSI scanner on my Ubuntu Linux machine.

So, if you're on a Mac, need to scan, Vuescan is well worth the $49. Just toss those junky OEM drivers in the trash.


Posted by billo at 09:34 AM | Comments (0)

November 16, 2005

Why should I get a Mac?

A friend of mine is having some hardware problems. He explicitly asked not to be told to get a Mac. So of course I wrote him this email:

I've become a huge Mac fan in the past 4 years. Well, not really a Mac fan, but a Mac OS X fan.  I could care less about their beautiful but not necessarily much different hardware.

Mac OS X is the difference.  And not because it is more beautiful or elegant or anything than Windows.  I think that is largely a matter of taste.  I think it could be objectively argued that Apple does a better job of thematic and design consistency than Microsoft, but I don't think that really matters either when you are counting your dollars spent and hours used working.

Here then, are the big wins of Mac OS X over Windows:

1. the home directory.  It is very, very difficult as a Mac OS X user to put anything anywhere on the machine EXCEPT in your home directory: documents, preferences, music, EVERYTHING is there.  If you back up your home dir, you will not lose anything important.

2. installing == copying.  To install an application on OS X, generally all you need to do is copy the   application "file" to your hard disk.  That's it. (there are a rare exceptions to this).  And (here is the important part): since your settings, including license keys, etc, are in your HOME DIRECTORY, there is no registry synch.

3. there is no registry. The registry was a monumentally idiotic idea. The person who thought it up   should be retroactively fired from every job he ever had.

Minor wins that you are sick of hearing:

1. security: I've never installed anti-virus software on any of the 6 macs I have owned since 2001.  I have never had a virus.

2. uptime: my macs at home regularly go for 30-60 days between reboots.

In your particular situation, here's why the first 3 wins should make you never want to go to Windows again.  You need a laptop to do your business, so you should have two laptops all the time.  Nobody is going to be able to fix your laptop in a timeframe that you need.  So just buy two.  Keep one as a "warm" spare.  That is, turn it on now and then, download any system updates, maybe install a snapshot of your home directory backup on it.  Once a month should be often enough to give you confidence that the warm spare is still working.

Or don't keep a warm spare.  Just drive to the Apple store and buy a powerbook if/when disaster strikes.

So if your primary Mac dies (it will happen as often as your IBM: Mac hardware is basically the same as everything else), you just take out your spare mac, copy your backup home directory to it, copy your extra apps to it, and you are back up and running in between 10 minutes and 1 hour, the time depending solely on how many gigabytes of stuff you need to copy.  SOLELY.  It would take you 6 hours to do that on any moderately customized Windows.  At least.

Posted by billo at 06:31 PM | Comments (0)

November 08, 2005

Book Recommendation: Mac OS X Tiger for Unix Geeks

Seriously, how can you not love a book with this title? This is an update to the title Panther for Unix Geeks. It's got a lot of the same stuff, but it does add some interesting stuff about spotlight, launchd, and directory services in Tiger. It has lots of practical documentation for command-line access for user management, and disk utility stuff.

There's a ton of stuff about sharing files and printers with Windows and Linux, and guides for installing free x86 emulators (such as the free  qemu).  There's also a guide for setting up the PowerPC emulator PearPC on a Linux machine!

There are also some very good, if basic, tutorials on setting up and building open source programs. If you are a Linux or BSD geek who is new to Mac OS X, then this book will make you very comfortable, very quickly.

Here is the amazon link for the book.

 

Posted by billo at 07:58 PM | Comments (0)

October 25, 2005

Pending Apple OS X patch

Apparently the next major patch of Tiger is coming soon, and it's really huge. It might fix the random hard freezes that have been plaguing my G5 at work. But what do you want to bet it breaks emacs?

Posted by billo at 03:33 PM | Comments (1)

September 27, 2005

Aqua Emacs broken. Again

I've had a report that the latest OS X Tiger patch breaks Aqua emacs again. What the hell?

I'll post a fixed build here probably tomorrow.

My friend Steve built one that works. Here it is.

Posted by billo at 10:36 AM | Comments (0)

September 26, 2005

iPhoto frustration

I've just about had it with iPhoto. It does some things very well, like organize and order the bound photo books that Apple sells. However, if you have a lot of pictures, it really starts to break down. I don't even think I have a lot, at least not in this age of digital cameras. I have about 6 years worth of pictures in my iPhoto, which is about 5,000.

iPhoto does weird stuff with caching at different resolutions. It winds up sucking down vast quantities of CPU time just to display thumbnails.

Then there is the bigger problem, in that it keeps all the JPG files inside its own little directory tree. Normally, that's not a big deal, but when I moved my photo library from my old G4 Cube to my new Mac Mini, iPhoto decided to make double copies of thousands and thousands of files. Not all of them, mind you; just about 2-3000 of them. So now my carefully maintained photo db is a mess.

I want a separate photo database program that will look at a hiearchy of JPEGs, inspect the JFIF info, and keep track of them by some reasonable unique ID number. Maybe some message digest of the JFIF info, if not the entire file. Is that so hard? I would be perfectly happy if that program even launched external programs for editing.

Why can't google release picasa for mac?

Posted by billo at 03:00 PM | Comments (4)

August 08, 2005

OS X86, part deux

So, Apple is coming out with an Intel version of OS X. They still haven't done what I said they would not do: release OS X86 that you can install on any PC. But soon you will be able to buy a Macintosh with with an Intel processor in it. Overall, I think this is a very good thing, because whatever marketing spin Apple has put on G4/G5 over the past few years, they are dog slow compared to Intel processors. For 99% of the things 99% of the people in the world want to do, anyway.

I wonder what this is going to do to Macintosh sales volume over the next year or so. I personally was going to but a Mac Mini to replace my old G4 Cube. But not now, no way. I'll wait until the Intel mini comes out, which will be 3X faster. If 10% of Apple customers are thinking the same way, that's 10% reduction in Mac sales this year.

Ditto for my powerbook which I was going to replace sometime in the next year.

Posted by billo at 09:07 AM | Comments (0)

May 17, 2005

Tiger 10.4.1 emacs breakage

Applying the first patch to Tiger (10.4.1) crashes my Aqua emacs build. I'm working on a new one. WTF?

I had to rebuild from source, then had to fight stupid OS X package manager for hours and hours. Then stupid Fink ncurses library kept infecting my build. Argh! Anyway, here is a new build that should work with 10.4.1: EmacsInstaller.dmg

Posted by billo at 08:38 AM | Comments (1)

May 04, 2005

Not enough processes!

In Tiger, each of the dashboard widgets is its own process. I had always been running close to the ragged limit of processes before, and dashboard put me over the top. Apparently there is a simple kernel parameter to increase the process limit.

Here is what you need in your /etc/sysctl.conf. (Or something like this. Maybe you need more, or not so much. This works for me, with 2GB of RAM.) The default Tiger values were (oddly) 532 and 100, respectively:

kern.maxproc=2048
kern.macprocperuid=512

And here are the commands you can run to update these parameters without rebooting:

% sysctl -w kern.maxproc=2048
% sysctl -w kern.maxprocperuid=512

You then also have to increase the limits on various daemons (in particular, WindowServer) to allow your user processes to exceed the default shell limit of 100. This is dangerous to do, but it does work. Detailed instructions are at macosxhints.

Thanks to Joseph Scott for writing about this on his web site! He rules.

Posted by billo at 08:18 AM | Comments (0)

May 03, 2005

ArsTechnica technical article on tiger.

ArsTechnica has an excellent, in-depth technical overview of Tiger. Included are interesting details and tutorials on file metadata and ACLs. (this entry generating a lot of comment spam, so I'm closing it.)

Posted by billo at 02:16 PM

May 02, 2005

Other random tiger breakage

I had this shareware app called DoubleCommand which does all kinds low-level keyboard remapping (using kernel extensions.) I used it to disable the CAPS LOCK key which my clumsy fingers always graze. (The CAPS LOCK key is, IMO, a stupid anachronism. I mean, who uses it, really? Besides BIFF.) So it's broken, and the news that it's broken until further notice is sad.

I have Virtual PC, so I can run Windows 2000 and do horrible things like run Internet Explorer to test web sites. It's complaining about the network virtual switch driver not working.

Something on my machine is using a bit more VM than usual. I keep hitting the process/VM limit, somewhere around 22GB. I think it might be the Dashboard widgets, each of which has a pretty fat (250MB) VM footprint. Ugh.

Posted by billo at 05:58 PM | Comments (0)

Java 1.5 on Mac OS X Tiger

I was really bummed out when I ran "java -version" on Tiger and it was still 1.4.2. I mean, what the hell? The two things I cared about in Tiger were Spotlight and Java 1.5. (Yes, I am a big nerd.)

Anyway, it turns out it's not quite done. If you want it, get it at the apple developer download site. It's still beta, but I don't care. I just need it to mostly work so I can develop on my Mac and deploy to Linux.

Posted by billo at 09:04 AM | Comments (0)

May 01, 2005

Tiger OK So Far

So far I've upgraded three of my four Macs to Tiger. No major problems. They include a 500Mhz G4 Cube, an 800Mhz Powerbook G4 and my 2x2Ghz G5. I started with the slowest computer and have just finished the fastest.

In general, I am very happy that there is little in the way of gratuitous cosmetic changes. When I sit down and look at the screen, I would not even really realize anything was different. The only things I can see are the little apple menu icon in the upper left, which is bluer, or something; and the spotlight icon in the upper right (which of course isn't there at all in panther). I've already found some documents I had completely forgotten about.

Spotlight is pretty great. I've been jealous of my friends who have installed google desktop search on their Windows machines, but that's all over now. It takes a while to do the initial index, over an hour beyond the install of Tiger.

Dashboard is the other feature that is nice. It's a blatant, heinous rip-off of Konfabulator, but it's executed a little better. I never really got into Konfabulator, but I can see myself using Dashboard quite often.

My one complaint is that the integrate Tiger Sync (which replaces iSync) is a little sketchy. I've already had several odd error messages like: "an inconsistency has been detected. We recommend you re-sync from a Mac with good contact data." Yikes. I haven't lost any data, though, so it's not horrible. The Sync is quite slow, but I'm hoping it's because everybody is upgrading this weekend and trying it for the first time.

Posted by billo at 02:15 PM | Comments (0)

April 19, 2005

Apple OS X86

Every now and then, in a conversation about operating systems, somebody brings up the idea of Apple releasing Mac OS X for Intel processors. I don't think it will happen, not soon anyway. And gosh do I hope I am really, really wrong.

Now, Mac OS X86 is a beautiful dream for OS X fans like me, and the nightmare of those with a Macintosh hardware fetish. Here's why: the only reason Apple is selling so many of their pretty but expensive and slow computers is OS X. I own four of them myself. I would maybe have bought one because it was pretty; I bought 4 because it's the only hardware platform for OS X. My belief is that Apple will never release OS X86 until their PC business is clearly dead-diddly-ead. If they did release it, sales of G4/G5 macs would vaporize. Why the heck would I spend $4000 on a 2GHz G5 when I could build a sweet 3.6Ghz P4 in a custom chassis for $1500? I wouldn't, most other people wouldn't either. Bye-bye Macintosh hardware sales.

Apple has carved a niche for themselves at <5% of the PC market, with gross margin on PC hardware that struggling Intel box makers like HP can only dream about. It's a still a huge part of their operating profit, despite their huge focus on being a consumer electronics and music company: the Sony for the 21st century. iPod, iTunes now, probably phone or TiVo-like device next; maybe digital cameras. Look at all the electronic consumer products that have shitty design: think how Apple industrial design could clean up the crappy usability of most (all?) digital cameras. How about the ridiculous Java cell phones that do everything poorly except make phone calls? And they SUCK at making phone calls!

But they still make too much money on Macintosh hardware to just let that business melt away. Maybe they have crazy dreams of beating Microsoft on the desktop, but I doubt it.

My big hope is that it will just get too expensive to for Apple/Motorola/IBM to keep up with Intel in processor performance. In that case, Macintosh sales will slump (because they will just be too darn slow compared to cheaper Intel machines.) Faced with a dead PC business, Apple will release Mac OS X86 to the world. $99 for freedom from Windows!

Posted by billo at 07:11 PM | Comments (1)

April 18, 2005

I am not a Mac nut.

Lately I keep hearing myself say to people, "Get a mac." I'm the big computer nerd in my family, so people always ask me for help with technical problems. Usually I tell them how to solve their problem, which often is kind of complex, and I'm pretty sure they won't be able to do it right without hand-holding. Then I say, "You know, if you had a Mac you wouldn't have problems like that."

I think most people think I'm joking. Others take a step back like I'm some kind of religious nut. "Oh, you're one of those Mac nuts."

No, I'm not. I never much cared for the Macintosh operating system in its first nine incarnations. That's right. Nine. Until OS X came out, I found MacOS cute but laughably primitive. The folks at Apple railed that Windows was cheap theft of their ideas. But guess what, by the time Windows NT was out, Windows was way more advanced than MacOS. Meanwhile, the real, solid, reliable, good operating systems, the descendants of Unix, were slipping into obscurity. Only geeks (like me) cared about them. In the mid-90's (while MacOS was wallowing in 1970's operating system technology) Linux started to become popular. That is, if, by "popular," you mean that 0.02% of the population were technically capable enough to find, install and make it usable enough to do weird things like write computer programs.

I fell in love with Linux the first time I used it. (And, of course, by "used" I mean spent two weeks getting a custom kernel built and working to the point that I could run emacs.) It was just like having my only little unix workstation, on cheap, widely available Intel hardware. Here was an OS that I knew would never go away: the structure and paradigms it was built on had been around for over 25 years. It had staying power.

The problem was, it was hard to get software for it that interoperated with other people's stuff. Somebody would give you a word document and you wouldn't be able to use it. Things have changed a lot since then, Linux is a lot easier to install, and there is a lot more software out there. However, it still feels like you are using a patchwork. Different applications that had different ancestry (Gnome, or KDE or whatever) wouldn't print or drag-and-drop the way you'd expect. There must be something about the nature of Open Source that makes very good and strong infrastructure, but terrible finished UI.

Anyway, when I heard the tenth iteration of MacOS was going to be based on a very strong Unix technology (BSD/Mach) that Apple had acquired when they bought NeXT, I was totally, and I mean TOTALLY stoked. It seemed too good to be true: a "mainstream" OS with a pretty, well-integrated UI built on a solid infrastructure.

I bought a Mac a few weeks later; Mac OS X wasn't even out. I had to wait months to use the beta version. Meanwhile, I suffered through using MacOS 9. Ugh. There was nothing magically intuitive or better about MacOS 9 vs. Windows, at least nothing that I could see. See? I am not a Mac nut!

Finally the OS X beta came out, and it was fantastic. It *is* fantastic: applications are installed by copying files; no registry; users have home directories; applications don't pollute the system files with overrides and customizations; NFS shareds can be mounted; apache, emacs, vi, are all INCLUDED in the distribution; all the shells are there, bash, csh; perl is included. You can even buy real Microsoft Office, so you can exchange documents with your poor pals that still use Windows.

People make a big deal about the general lack of viruses, worms and spyware on OS X. It's mostly accurate, but it's not so much that Mac OS X is a whole lot more secure. It is somewhat more secure, but the biggest factor is that it is less than 5% of the market, so it's not a big target. Whatever the case, with Mac OS X, if you are not careless, you will be fine; with Windows, if you are careful, you will be fine.

I use computers a lot. All the time. I estimate I save 2-3 hours a week not doing system administration that I would do on Windows. I spend more time getting stuff done and less caring for the operating system.

So, get a Mac, you'll be happier.

For more non-zealot Mac zealotry check out kernelthread.com.

Posted by billo at 10:10 PM | Comments (0)