The iPad is not a standalone computing platform

One thing I’ve not read with all the buzz on Apple’s new iPad is this simple fact that you must connect the iPad to another computer to perform backups and updates via iTunes.

This statement means, unceremoniously, that you cannot ONLY have an iPad as your sole computing device. If you want to have the magical experience that the iPhone OS experience gives you, with automatic backup of all your applications, music purchased OTA or via wifi, your personal settings, notes, audio recordings, (and now) downloaded iBooks, you must connect it to another computer to sync that information to an iTunes installation.

And when the next new iPad OS is released, if you want those new features and functionality, you had better not have pitched that clunky old Dell or old iMac you “used to use everyday, but haven’t in months” because of the new freedom granted by your spanky new iPad.

All the talk of the freedom to chuck the traditional OS in favor of the stable, predictable, controlled existence of the iPad (iPhone) OS which seems to be the huge buzz now misses the fact that you, at least in the current form and for the foreseeable future, simply cannot live with an iPad as your only computer.

I’d like to think that someday Apple will provide a .mac MobileMe experience that will negate the need for a “real computer” in your home, backing up and installing OS updates over the air, but that may not be the case. Apple is in the business of selling hardware as well as the underlying software and media (conveniently downloadable via the App Store or mobile iTunes). Why would they give up the revenue stream of selling computers for one that will be arguably smaller, even though it would be subscription based?

Maybe someday this will be your only computer, but today is not that day. So let’s all tether up and sync away.

Compiling monit in 64-bit on Mac OS X Leopard 10.5

download the source, untar, cd into expanded directory and
CFLAGS=’-m64′ LDFLAGS=’-m64′ ./configure && make && make install && cp monitrc /etc/monitrc

Building mod_xsendfile on Mac OS X

Copying this here, in case it ever disappears and I need it again.

Today I needed to compile mod_xsendfile for OS X on Intel. The standard command for this,

apxs -cia mod_xsendfile.c

resulted in a module that was for i386 only.

Apache on Leopard (untested on Tiger) doesn’t appreciate this, throwing this error:

4/7/08 5:08:08 PM org.apache.httpd[ 15990] httpd: Syntax error on line 116 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_xsendfile.so into server: dlopen(/usr/libexec/apache2/mod_xsendfile.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_xsendfile.so: mach-o, but wrong architecture

Turns out the solution is pretty simple. Just change the command to apxs to this:

apxs -cia -Wc,"-arch x86_64 -arch ppc -arch i386 -arch ppc64" -Wl,"-arch x86_64 -arch ppc -arch i386 -arch ppc64" mod_xsendfile.c

This will generate a fat-binary for all four current Mac architectures.

Adventures in Firefox – places.sqlite

I love Firefox. Don’t get me wrong here. It allows me to customize my browsing environment to exactly how I like it, has a ton of great extensions, and generally lets me feel like I have more ownership of my browser.

What I don’t like is that it had gotten slow lately. I’m not talking about just plain takes a few more seconds to launch slow, but more like launching Firefox required a good 3 minutes to fully finish whatever it was doing and become usable.

So I did a little digging and here’s what I found.

Firefox 3 now uses a local sqlite database to store many of it’s settings like bookmarks, browsing history, favicons, etc. This is a good thing in general, as the previous storage format for those things was ugly. Now we have a full-fledged database to poke with a sharp stick should we choose to.

Greatness of using sqlite aside, databases can become bloated when you do a lot of adds/updates/deletes (especially deletes) if they don’t get the proper maintenance. Sqlite databases use VACUUM for this basic maintenance, so that’s the first thing to try if Firefox is feeling sluggish. It’s a fairly easy operation, and it’s well documented on the net with regard to Firefox. In general, you use your command line access (in my case, Terminal.app) and navigate to your Firefox profile directory. Once there, you can issue the following command to VACUUM your places.sqlite database:

sqlite3 places.sqlite VACUUM;

That was easy.

You can perform this same VACUUM procedure on the other sqlite databases Firefox uses, one by one (do a ls *.sqlite in your profile directory to find them all) or you can take my little inline shell script and do them all in one fell swoop:

for z in `/bin/ls *.sqlite`; do sqlite3 $z VACUUM; done

This assumes 3 things: you’re using a bash as a shell, /bin/ls is where your system ls lives, and sqlite3 is in your PATH. If you’re on Mac OS X, you can copy/paste that once you’ve changed to your profile directory and it’ll work fine. Other operating systems, well, you’re on your own, but it’s a simple thing to track down those bits.

What that little inline script says, in a nutshell, is “find all files ending in sqlite in the current directory, then for each of them, call sqlite $filename with the VACUUM; argument to perform the maintenance”.

That’s the easiest thing you can do and many people have mentioned that it does indeed help in many situations. That said, it didn’t help mine much.

My places.sqlite database had grown to over 60Mb. I do a lot of browsing in my day-to-day job, but 60Mb worth of history is A LOT of entries, no matter how you dice it. After continuing to hear Firefox thrash my disk for a good 2-3 minutes every time I started it, I decided to dig in and see what it was doing.

Thank God for Mac OS X and DTrace.

One of my favorite things about UNIX in general, is that there are so many neat tools for observing what is going on in your computer. One of those tools is called iosnoop, and it comes courtesy of the inclusion of DTrace in Mac OS X Leopard. iosnoop is actually just a bash script wrapper for a DTrace script, albeit with quite a few knobs and buttons.
[rts-xeon:~] ryan$ iosnoop -h
USAGE: iosnoop [-a|-A|-DeghiNostv] [-d device] [-f filename]
[-m mount_point] [-n name] [-p PID]
iosnoop # default output
-a # print all data (mostly)
-A # dump all data, space delimited
-D # print time delta, us (elapsed)
-e # print device name
-g # print command arguments
-i # print device instance
-N # print major and minor numbers
-o # print disk delta time, us
-s # print start time, us
-t # print completion time, us
-v # print completion time, string
-d device # instance name to snoop
-f filename # snoop this file only
-m mount_point # this FS only
-n name # this process name only
-p PID # this PID only
eg,
iosnoop -v # human readable timestamps
iosnoop -N # print major and minor numbers
iosnoop -m / # snoop events on filesystem / only

Well, firing up iosnoop as root (which is required to access the DTrace probes) is as easy as issuing

sudo iosnoop

in Terminal.app.

When I did that while Firefox was grinding through it’s startup, I was still seeing TONS of reads and writes to it’s places.sqlite database. Doing a bit of Google research told me I wasn’t the only one.

So I quit Firefox (it locks the sqlite database) and fired up my old friend sqlite3 to take a look at the database and found that moz_places had over 175,000 rows. 155,000 of those rows were marked as hidden (hidden = 1) which means that they were never visited in the browser, and “are commonly embedded pages, i-frames, RSS bookmarks and javascript calls” (via firefoxforensics).

Well, I’ve never once used a Live Bookmark and don’t need to keep the history of those other items, so I decided to just delete them all. You can do that using sqlite3 very easily with a quick

[rts-xeon:~/Library/Application Support/Firefox/Profiles/rts] ryan$ sqlite3 places.sqlite
SQLite version 3.4.0
Enter ".help" for instructions
sqlite> delete from moz_places where hidden=1 and url like 'http%';
sqlite> .quit

That SQL statement tells sqlite to delete all the hidden items that have a url beginning with http. It’s important not to just delete all the hidden items, as some of them are required for Firefox to operate. I found that out the hard way, and am glad I made a copy of my places.sqlite before deleting all the hidden items and breaking my Firefox history/bookmark manager entirely.

Once you’ve deleted those hidden items, your places.sqlite database should decrease significantly in size. Mine dropped from 61Mb or so down to around 9Mb. There are still 10,000 items in my history, but those are all places I’ve explicitly visited so I’m fine with that.

Launching Firefox is no longer a 3 minute endeavour – it comes up about as fast as Safari does and I get to have my cake and eat it too.

Hope this article helps someone, and feel free to leave your comments/experience below.

Not often you see this on an Apple subdomain…

Wow – mail for root on OS X goes to /dev/null by default

Color me stymied. What a poor choice.

So, if you’re wondering why root doesn’t get any mail for cron jobs or the like, /var/root/.forward contains /dev/null

If you want root to get mail so you can see it, rm /var/root/.forward (or edit it and put in a real email address)

Disabling the desktop environment in Solaris

To disable the GUI startup: /usr/dt/bin/dtconfig -d
And, to enable it again: /usr/dt/bin/dtconfig -e

I never remember this and have to google it. Hope it helps someone besides me. :-)

I can never get into the BIOS under vmware

Just paste the following text into the image’s vmx file while it’s shut down:

bios.forceSetupOnce = “TRUE”


# The VMware Fusion BIOS posts too quickly to access.
Most users will not need to access the BIOS, but advanced users might want to do so, to change the boot order, set a boot password, or enable a second floppy drive. To work around this problem, use a text editor to add the following line to the configuration (.vmx) file of the virtual machine:
bios.forceSetupOnce = "TRUE"
The next time you boot up the virtual machine, it will automatically boot into the BIOS. This configuration option then reverts to FALSE. You must set the option to TRUE each time you want to boot the virtual machine into the BIOS.

via http://www.vmware.com/support/fusion/doc/releasenotes_fusion.html

A Little Story

Emma Letter People Story

I am Ms. F. I am happy to have come your way.
RRR. Said Mr. R. I do not like you Ms. F. Not at all.
And Ms. F went to Ms. T and said, “Mr. R does not like me.”
“Not all letter people like each other”
The End

Just a little story my 5 year old Emma made up. They’re learning the alphabet in kindergarten and the letter people are the stars, and she’s writing stories about them already. By herself.

GObama

Congratulations President-elect Barack Obama! Yes We Can!