/dev/trouble
Eric Roller's Development Blog

General

General development topics.

Seen errors like this, e.g. upon "svn update" issued on a remote machine when the repository is on a server:

svn: Berkeley DB error for filesystem '.../Repositories/proj/db' while
opening 'nodes' table: Invalid argument
svn: bdb: file nodes (meta pgno = 0) has LSN [95][515282].
svn: bdb: end of log is [95][14597]
svn: bdb: .../Repositories/proj/db/nodes: unexpected file type or
format

Not sure what the main cause is, but it could be a bug with svnserve since it is the one who is running as root. Login with ssh on the server and cd to the directory mentioned in the error:

cd Repositories/proj/db
ls -l
[...]
-rw-r--r--   1 root  goblin   1048576 Aug  4 17:42 log.0000000095
-rw-r--r--   1 root  goblin   1048576 Aug  4 17:52 log.0000000096

Notice that there are files whose owner is root while the other files (not shown) are owned by globlin. We can fix that with chmod:

sudo chown goblin log.000000009*
cd ../..
svnadmin recover proj

Back on the remote machine, try again to run "svn update".

Saw this before version 2.2.2 and the solution was to use the current beta version of Apache (2.1.8-beta I think). Now I see it again for the new photo page.

Found some online forum message where they suggested to change the output_buffering value in /usr/local/lib/php.ini to something like "1048576" (1MB). I don't have pictures that large so I set it to "512000" (500kB). This solved the problem for me.

While searching for the culprit that is responsible for the AirTunes cut-outs, I thought it might be a good idea to try disabling Spotlight and Dashboard.

Two steps are necessary, first turn Spotlight off in the hostconfig file, then disable indexing and remove the existing indexes with mdutil:

> sudo vi /etc/hostconfig
vi> Go
SPOTLIGHT=-NO-
vi> ZZ
> sudo mdutil -i off /
> sudo mdutil -E /

You can then use Activity Monitor to kill any mds or mdimport processes or else just reboot.

If you later change your mind and decide you want Spotlight after all, it's easy to reactivate. Set SPOTLIGHT=-YES- in /etc/hostconfig, run in Terminal:

> mdutil -i on /</pre>and reboot.

Disabling Dashboard

To turn Dashboard off:

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

To turn Dashboard on:

> defaults write com.apple.dashboard mcx-disabled -boolean NO

You have to restart the Dock after making either change for it to take effect:

> killall Dock

(NB. Neither turned out to be the culprit for AirTunes. It was the broadband router which dropped more and more packages until it died a couple of months later.)

Enter this in the Terminal application:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

This tip originally surfaced for Mac OS X 10.4 Tiger, but may also work for 10.5 Leopard.

Splitting Disk Images

- Posted in General by

This has been bugging me for a while: How do you split large .dmg files such that you can save them onto multiple CDs (as opposed to an expensive DVD). It turns out, there is no special tool required (although it would be nice if Disk Utility would do the job). No, the functionality is already built-in in the Mac OS. All you need to do is to use the hdiutil in the Terminal to create your partitions:

% cd Downloads
% mkdir parts
% hdiutil segment -o ./parts/large_image.dmg \
    -segmentSize 100m large_image.dmg

Of the resulting files in the parts directory, one can simply double-click the first one in the Finder to mount the entire image:

large_image.dmg
large_image.002.dmgpart
[...]
large_image.010.dmgpart

To enable the debug menu, type in the Terminal application:

> defaults write com.apple.safari IncludeDebugMenu 1

To use Yahoo instead of Google in the search bar, you can hack the Safari binary, for instance with the vi text editor:

> vi /Applications/Safari.app/Contents/MacOS/Safari
vi>/%@.google.gom

Then replace these strings (must be the exactly the same length!):

http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8
http://%@@search.yahoo.com/%@?p=%@&ie=UTF-8&a=

[Update 2014-12-25] NB. Since GateKeeper was introduced, you can no longer hack the binary. Safari would no longer be allowed to launch.