Mac OS X
Safari tip of the week - history search
At least once a week, I run into a situation where I want to revisit a site I had visited earlier but forgot to bookmark or didn't even think of bookmarking. All I can remember is a part of the page's title. Wouldn't it be nice if there was a slick tool that would allow you to quickly search your browser history? I was all ready to fire up XCode when I discovered that the Safari team had already thought of this.

Simply hit Cmd-Option-B and type something in the little search field in the bottom of the window.

Pasted Graphic

Could maybe be a tad quicker (without having to click to focus on the search field), but a really useful feature nonetheless.

|
Temporarily changing passwords
This came up on comp.sys.mac.system - how could you easily change a users password without having admin access to the system? Say a customer asks you to install Final Cut Studio before going into a meeting and forgets to give you his password (or writes down the wrong one, or whatever). Do you just wait for the customer to return and tell them they'll have to wait another 45 mins for the 30+ GB to finish installing?

You could always just reset the password with the help of the OS X install disc, but there's an easier way and one that will actually let you restore the old password. All you need to know is the owner's user name (actually you can do some more dscl digging to use their real name as well).

You start off by booting into Single User mode (Cmd-S) and then:
# mount -uw /; sh /etc/rc
# cd /var/db/shadow/hashes
# guid=`dscl . -read /Users/username GeneratedUID | awk '{print $2}'`
# cp $guid $guid.old
# passwd username
# reboot

You can now log in as that user with your new password. When you're done, just boot back into Single User mode and mv the .old hash file back in place. Just to make sure you test that the owner can log in when they get back. ;)
|
Finding things
I find it ironic, that things get increasingly difficult to find as their physical proximity increases (ie distance decreases). Thanks to Google, I can easily find a solution to a problem some guy, thousands of kilometres, and more importantly, years away, found and yet I'm utterly helpless if I have to find my bus ticket under the pile of papers that is my workdesk. In other words, filipp's search theorem states that "the physical distance of an object is inversely proportionate to the chance of me actually finding it".

My media library is another example (and I'm sure I'm not alone in this). I have tends of thousands of files stored on different mediums (computers and discs) within the confines of my home, only tens of meters apart, but when I need to find a single file, it's pretty much hopeless. While I can't really do much about my workdesk - it's just a force of habit, I'm still convinced I can do something about those files.

So what are the solutions?


1) Consolidate your storage by getting a bigger disk. I could image this working quite well. If I had about a terabyte of local storage, I could just store everything in one place, and use Spotlight to find it. Ofcourse, this is a band-aid. In a year, would need 2 TB, at least. It's also expensive.

2) Stop hoarding stuff. This isn't really an option for me, but the basic idea is that the really important data doesn't really take up much space. For me it's mostly text, with some pictures that I could easily fit within 10 GB. The rest (music and videos) is just enterntainment, right? Applications have become the most disposable form of "hd filler". But then you also have music bought from iTunes that you simply have nowhere else.

3) Start using some sort of DAM (Digital Asset Management) system. We're already doing this in many areas - Mail.app, iTunes, iPhoto, del.icio.us etc are all managing some assets. But which one should I install? I'm sure there's a really fancy and expensive solution out there, but all I really need is a generic tool that would essentially take snapshots of folders and then allow me to search them.

4) Hack Spotlight to support read-only media and file servers. I actually tried this, but after failed attempts to index SMB shares, I quickly gave up. Who knows, Leopard might help here, but I'm not betting on it.

Taking a snapshot of a folder on a UNIX system, is ofcourse a piece of cake:
> find ~/Movies \! -name '.*' > movies.txt

With more effort this could be made to check for duplicates (when importing the same folder again) and all sorts of cool things. Things will get hairy when I ned to store some extra attributes for an item. Like the QuickTime comment of a .mov or the year of an MP3. For this, a flat file becomes tedious.

The snapshot approach is really all I need - a medium-agnostic method for indexing and offline-searching file archives. So I'm starting yet another sideproject - a Python script that does exactly that. Here's what I have so far:
> ./lumi.py /Volumes/300G/Movies/
> importing /Volumes/300G/Movies/
> Successfully imported 1296 items
> ./lumi.py list
> 2007-03-17T12:22:23.827078 (/Volumes/300G/Movies/)
> 2007-03-17T12:23:04.715256 (/Volumes/Shared Items/Movies/)
> ./lumi.py name blender
> /Volumes/300G/Movies/Training (blendervt-interface-3dviewport-v234-r0.avi)
> /Volumes/300G/Movies/Training (blendervt-interface-concept-v234-r0.avi)
> /Volumes/Shared Items/Movies/Animation (Blender3d_SIGGRAPH2005_DVDRip.avi)
> /Volumes/Shared Items/Movies/Animation (BlenderTricksEpisode.avi)

The datastore is XML. Every import action has it's own Import element. This allows me to do things like undos etc. Oh, and the trick to getting Unicode to work somewhat properly, is to add:
import sys
sys.setdefaultencoding('iso-8859-1')

to /Library/Frameworks/Python.framework//Versions/2.4/lib/python2.4/site-packages/sitecustomize.py

While all of this is very basic ATM, it's already useful for me. No longer do I have to boot up a file server just find out if some music video is stored on it.
|
Mac Mythbusters: white on black saves battery
While reviewing Journler, I stumbled upon a funny command - Toggle Low Light Display. This is the same as System Preferences > Universl Acces > White on Black and is obviously meant for writing in the dark, but it made me wonder if it would also help to conserve battery power. The reasoning being that in a standard black-on-white configuration we're burning pixels that really don't have to be lit at all. Granted, the majority of power consumption in a TFT comes from backlighting, which has nothing to do with the video signal, but I was convinced that there would be a difference. The only question is - how big of a difference?

To set up a consistent environment, I compiled an Automator workflow that triest to simulate a typical writing scenario - grab a few HTML pages, find some words, create a new document in TextEdit, paste the text, pause for 5 mins, check email, repeat (I created the loop by adding an Open Workflow step that opened the same file). The display in this case is a 20" ACD. I also have a bunch of USB devices, but they're not used during the test so they should all be constants. Display Sleep was disabled and brightness was at maximum. The Mac was left to charge overnight between the test runs.

I run the script twice, fiirst with Black-on-White and then the opposite and measure how long the battery lasts, from being totally charged until it completely blacks out.

Luckily, Automator comes with a cli interface making it easy to measure the time. This is not 100% accurate because to stop the timer, I had to reconnect the power cord and kill automator:
> time automator /Users/filipp/Desktop/Loop\ test.workflow/


The results:
Black on white: 54m55.852s
White on black: 52m39.918s

So there's a difference, but it's the exact opposite - WOB actually gave a shorter battery life. I guess this could happen if the Mac is actually doing more graphics processing for the inversion and eating more power as a result. The difference is also so small, that there's really no need for another test.
|
Thou shalt not delete!
This came up in the chatroom. How do you protect a folder from being deleted while still being able to write to it? Locking it directly doesn't work, locking the parent one does, but then you can't write to the parent dir. Standard UNIX permissions are of little help, as there is no such thing as a "delete bit". Enter Access Control Lists. First let's make sure they're on:
> sudo fsaclctl -p / -e

and then we can just take away the right to delete:
> chmod +a "filipp deny delete" test
> ls -e
drwxr-xr-x + 5 filipp filipp 170 Mar 11 19:15 test
0: user:filipp deny delete

+a always adds an ACE, so to delete one:
> chmod -a# 0 test

Suhweet!
|
Concatenating a bunch of files
A useful little tidbit. To merge the contents of all the files in an arbitrary directory hierachy into one single file, while skipping dot-files:
> find . -type f \! -name ".*" -exec cat {} > /Users/filipp/specs.txt \;

|
Windows and OS X benchmarks
I've said this before, but one thing that baffles me is in all the benchmarks and performance comparisons, people tend to compare a fresh copy of Windows against a fresh copy of OS X. I think this is completely false. Every self-respecting reviewer should, first of all install all the software they would normally in a production machine, preferably use the reviewed system as their main system for a while.

We all know what happens to Windows, and to some extent to OS X after you start installing stuff on them. But what I'd like to see is a benchmark of Windows with over 100 third party apps installed on it. This is exactly how many apps I have in my Applications folder (96 items in /Applications + sub-folders for stuff like browsers, games and server tools).
 > system_profiler SPApplicationsDataType | egrep ":$" | wc -l
269

That's exactly how many apps I have on my system altogether, not counting system-level stuff. With that many apps in the registry, I would bet it would take the Windows PC longer to boot up than the Mac to finish the benchmark. If it would start up at all.

And this all comes back to the cost issue as well. Ask any Windows-using media professional and they'll tell you that you shouldn't install anything else except your bare necessities on your production workstation. That you should essentially have one machine for your video work and another for your email and P2P. But now you're already paying for 2 machines, aren't you?
|
Stranger than fiction
filipp@fiBook.local [Metadata]  > curl -v http://127.0.0.1/~filipp/collective/show.php?id=rss
* About to connect() to 127.0.0.1 port 80
* Trying 127.0.0.1... * connected
* Connected to 127.0.0.1 (127.0.0.1) port 80
> GET /~filipp/collective/show.php?id=rss HTTP/1.1
User-Agent: curl/7.13.1 (powerpc-apple-darwin8.0) libcurl/7.13.1 OpenSSL/0.9.7l zlib/1.2.3
Host: 127.0.0.1
Pragma: no-cache
Accept: */*

< HTTP/1.1 200 OK
< Date: Sat, 24 Feb 2007 10:27:41 GMT
< Server: Apache/1.3.33 (Darwin) PHP/5.2.0
< X-Powered-By: PHP/5.2.0
< Set-Cookie: PHPSESSID=4fnmhuf56d5h3ifqg6qcai8k12; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: text/xml

AND
filipp@fiBook.local [Metadata]  > curl -v http://localhost/~filipp/collective/show.php?id=rss
* About to connect() to localhost port 80
* Trying ::1... * connected
* Connected to localhost (::1) port 80
> GET /~filipp/collective/show.php?id=rss HTTP/1.1
User-Agent: curl/7.13.1 (powerpc-apple-darwin8.0) libcurl/7.13.1 OpenSSL/0.9.7l zlib/1.2.3
Host: localhost
Pragma: no-cache
Accept: */*

< HTTP/1.1 200 OK
< Date: Sat, 24 Feb 2007 10:28:51 GMT
< Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7l DAV/2
< Last-Modified: Sat, 24 Feb 2007 10:05:15 GMT
< ETag: "3747e6-d1b-b6aecc0"
< Accept-Ranges: bytes
< Content-Length: 3355
< Content-Type: text/plain

When I open the page in a browser, the first one is returned regardless if I use localhost.

Just a silly Listen directive somewhere I'm sure, but goes to show what can happen when you start monkeying around with multiple web servers on the same machine.
|
Using Google's sitemap generator with RW
The sitemap generation process may seem a little daunting at first but it's actually quite simple, even when you're just using RapidWeaver. All you have to do is download their Sitemap Generator script. Then make a local export of your RW site (ie ~/Sites/mysite.com). The sitemap generator has 3 modes of operation, we're interested in having it generate the map based on the directory structure, so config.xml would be:
<site base_url="http://mysite.com/" store_into="/Users/filipp/sitemap.xml.gz" verbose="1">
<directory path="/Users/filipp/Sites/mysite.com" url="http://mysite.com" default_file="index.html" />
</site>

Then just run sitemap_get.py and copy the resultant sitemap.xml.gz to your hosting site's root directory. The whole idea here is to match your RW export with your site's root on the server.
|
Apache 2.2.4 Universal Binary
Long story short, I needed a server-side Python interpreter. For this there's two options (that I know of) - install Zope and run it along or in place of your existing web server (probably what any intelligent being would do), or go the hard way and run mod_python instead. The latest version works with either httpd 2.0 or later so it won't run OOtB on OS X. I figured since I'm upgrading my Apache anyway, I may as well grab the latest version. Turns out there's actually no OS X package out there for that (not counting the XAMPP monster, which is Intel-only). OK, no biggie I'll roll it myself - and why not make it UB as well.

> ./configure --prefix=/usr/local/httpd-2.2 --enable-isapi --disable-mem-cache --enable-mime-magic --enable-ssl \
--enable-http --enable-dav --enable-cgi --enable-rewrite --enable-so --enable-headers --with-ldap --enable-dbd \
--enable-auth-digest --enable-authnz-ldap --enable-authn-anon --enable-mods-shared=most --enable-ldap --enable-cache

I think those features should make it more or less usable also in a real server environment.

Then, due to a bug in GNU libtool, you have to manually replace all the sys_lib_search_path_spec lines in two files - srclib/apr/libtool and srclib/apr-util/xml/expat/libtool to
sys_lib_search_path_spec="/Developer/SDKs/MacOSX10.4u.sdk/usr/lib"

After compiling and installing I had to go through the config files to make it more of a drop-in replacement for Apache 1.3. So that it works nicely with what's already there without actually replacing anything. Simply start with config/httpd.config and work through it and all the included files to check for any "incompatibilities" with OS X (document rooot, the www user, homedirs, tmp dirs, the usual).

Finally you just need an interface to control the server. Some fancier distros come with PrefPanes, mine simply has a StartupItem with the service name "Apache 2.2". You set this up by adding something in /etc/hostconfig (like APACHE22=-YES-) and then the relevant StartupItem into /LibraryStartupItems. So finally, to start our new server:
> sudo SystemStarter start "Apache 2.2"

You can't use launchd because it's not appropriate for wrapping things like apachectl.

Currently things seem to run nicely, I'm still testing stuff before maybe building a package. WebDAV works, which is nice.

It's incredible how many things you have to keep in mind to finally get a successful build out, a lot due to the fact that configure scripts don't seem to do any sanity checking between the different switches. For example, you can enable DAV, but if you forget to add any auth modules, nothing will work. Or the fact that --with-ldap and --enable-ldap are two different things - and you only find out that the first one (which isn't even mentioned in --help, btw) is compulsory if you want to add any kind of LDAP support. It took a lot of TTA to finally get this far...
|
Emulators over RDC
Always remember to keep the sound option at "Play on remote computer". I tend to leave mine at "Do not play" and then wonder why the S60 emulator will launch and then quit after about 20 seconds.

Pasted Graphic

|
As If Nothing Ever Happened
To restore a customised and updated machine so that it looks as if it's never been booted:

Boot to single-user mode
> mount -uw /
> rm -rf /Users/* /var/db/netinfo/local.nidb /var/db/.AppleSetupDone /Library/Preferences/* /Library/Caches/*
> shutdown now

|
Revitilizing Camino's Flashblock
I noticed the little FlashBlock checkbox in CaminoTools wasn't actually doing anything. It's supposed to disable all flash content until you click on it. Turns out this is achieved with simple CSS and here's how you enable it:
> cd ~/Library/Application\ Support/Camino/chrome
> cat > ./flashblock.css << EOF
/* Prevent flash animations from playing until you click on them. */
object[classid$=":D27CDB6E-AE6D-11cf-96B8-444553540000"],
object[codebase*="swflash.cab"],
object[type="application/x-shockwave-flash"],
embed[type="application/x-shockwave-flash"]
{ -moz-binding: url("http://www.cs.hmc.edu/~jruderma/clickToView.xml#ctv"); }
EOF

and then just include that css file in your userContent.css:
> echo "@import url(flashblock.css);" >> ./userContent.css

I think this is a pretty useful thing to do to Camino since many Flash objects seem to slow it down to a crawl.
|
Giving .doc an Icon
I don't work much with Word files, but when I do, the only major "problem" I have is that if you only have Pages and TextEdit installed, .doc files have a generic-looking white icon. It's easy to fix though:

/Applications/TextEdit.app > Show package contents > Contents > Resources
Duplicate rtf.icns and rename copy to doc.icns
From the Contents folder open Info.plist and into the CFBundleDocumentTypes array append:
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>doc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>doc.icns</string>
<key>CFBundleTypeName</key>
<string>Microsoft Word Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>W8BN</string>
<string>W6BN</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>

Then flush the LaunchServices cache (this will reset all document/app associations so be prepared to be annoyed):
> cd /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support
> ./lsregister -kill -r -domain local -domain system -domain user

Pasted Graphic 1

|
Display Sleep
I usually leave my Mac on when I go to bed. This means setting the display sleep to now or the next best thing, 1 minute. The most obvious way to do it is from System Prefs, but I wanted something faster:
> sudo pmset displaysleep 1

is great, but requires root prvileges (due to some of the other things you can do with it) so it's out for any kind of automation/scripting purpose.

Enter Apple Remote Desktop. Among other niceties, ARD includes a CLI utility called systemsetup that you can use to set various system preferences, like so:
> /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup -setdisplaysleep 30

Nice. Time to wrap this into something Mac-like and give it a keyboard shortcut:
property ARDPath : "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup"

set currSleep to do shell script ARDPath & " -getdisplaysleep"

if (currSleep) does not end with "1 minutes" then
set newSleep to 1
else
set newSleep to 30
end if

do shell script ARDPath & " -setdisplaysleep " & newSleep

Throw that into ~/Library/Scripts and give it a fitting shortcut in System Prefs/Keyboard & Mouse.
|
Audio Transcoding with Automator
Got a bunch of FLAC files that I wanted to add to the iTunes library. Options: a) install the FLAC component and hope it works b) decode them with flac, import wavs to iTunes, delete the wavs or c) do point b), but with a click of a button:

Pasted Graphic

Pretty nice. I only wish QuickTime Player had such a nice Automator Library...

|
Points on ZFS
* Snapshots. This feature was the reason people originally thought it was behind Time Machine.

"A snapshot is a read-only point-in-time copy of a filesystem which takes practically no time to create and uses no additional space at the beginning. Any snapshot can be cloned to make a read-write filesystem and any snapshot of a filesystem can be restored to the original filesystem to return to the previous state."

Because this is implemented on the fs level, it's very fast and totally transparent.

* Dynamic striping. ZFS not only promises much improved consistency, but also performance. Dynamic striping allows to write to all devices in a "pool" simultaniously.

Here's a nice 10-point list of the advantages and a Flash animation of ZFS in action.

Boot support is not actually implemented in the FS. Because it's such a low-level thing, it has to be implemented in the actual hardware (ROM). This is definitely something that will set the PPC and Intel Macs apart one day since the Intel machines have EFI which is a modern programmable BIOS that Apple will probably one day update to support booting from ZFS.
|
IOHWSensor
Q: Is it possible to read the hardware sensors from the Terminal, without any 3rd party help?
A: Yes it is.
Q: Mmkay, but how?
A: I'm glad yo asked. With ioreg and a few extra utilities, like awk:
ioreg -n IOHWSensor | awk -F "=" '/\"current-value\" = (\d*)|\"location\" = (\d*)/ { print ($2); }'

That will output:
 3031040
"HDD BOTTOMSIDE"
3309568
"CPU TOPSIDE"
3440640
"GPU ON DIE"
80033
"CPU CORE"
307429376
"REAR MAIN ENCLOSURE"
1900544
"BATTERY"

As you can see the numbers don't make any sense. And this where the amazing "Mac OS X System Internals" comes in. In chapter 10.7 "A Programming Tour of the I/O Kit's Functionality" (page 1307) we find that the values should be bit shifted right by 16. So here's another example, in Python, with the bit shift applied:
import commands
ioreg = commands.getoutput ('/usr/sbin/ioreg -n IOHWSensor')
k = re.findall ("\"location\" = \"(.*?)\"", ioreg)
v = re.findall ("\"current-value\" = (\d*)", ioreg)

aDict = dict (zip ([lower (el) for el in k], [int (el) >> 16 for el in v]))

Giving us the temps in centigrade:
{'gpu on die': 52, 'battery': 29, 'cpu topside': 49, 'rear main enclosure': 4732, 'cpu core': 1, 'hdd bottomside': 46}

This code also wraps the results in a nice Python dictionary. 'rear main enclosure' is obviously the RPM of the only fan this machine has.

Here's the output from running the shell command on a G5:
476
"CPU T-Diode"
107
"CPU Current"
823
"CPU Voltage"
124
"Slots Power"
2097152
"DRIVE BAY"


hw_prefs machine_type

Many thanks to all the people who helped me piece this one together!
|
Find out Correct Base Install Permissions
Found this little nugget of information while going through the Package Maker help:

lsbom -p MUGsf /Library/Receipts/BaseSystem.pkg/Contents/Archive.bom
|
SQLite 3.3.7 Package
Available here. Universal, no TCL extension.

|
Subversion 1.4 Package
Available here. Built as Universal binary. Also includes SVN book PDF. Installs into /usr/local, no Apache support (wouldn't work with 1.3 anyways).

|
nmap and wget packages
Binaries as PKG available here and here. Both universal.

Making them was really easy. Just create a sparse image, and ./configure with --prefix=/Volumes/MyImage
Then set that as the root in PackageMaker and check perms etc.

|
Empty Trash from Automator
You'll notice there's no "Empty the trash" Automator action. There are those who will try to sell you this action. But why?
Add Automator > Run AppleScript action and:
tell application "Finder"
empty trash
end tell

Can I have some money now? ;-)
|
UnitInfo and Punk Released
Available on the Software page. Huge thanks to Martin for the graphics and UI design!

|
What's SourceCache?
Working with different tools in OS X, you'll often notice these paths show up in console.log:
/SourceCache/JavaScriptCore/JavaScriptCore-418.3/bindings/objc/WebScriptObject.mm
/SourceCache/apache_mod_php/apache_mod_php-18.4/php/configure

What are they?
My guess is they're the development environment directories at Apple.

|
KDX MacUnix
Copy app to /Applications/KDXServer1600, try and run it. Define shares and link folders if necessary:

ln -s /my/shared/folder /Applications/KDXServer1600/Bases/Default/Downloads.

Create a LaunchDaemon (from haxial.com):

sudo nano /Library/LaunchDaemons/com.haxial.kdxserver.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.haxial.kdxerver</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/KDXServer1600/KDXServer.command</string>
<string>--bkgnd</string>
<string>--nohup</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

Load the daemon:
$ launchctl load -w /Library/LaunchDaemons/com.haxial.kdxserver.plist
$ launchctl start com.haxial.kdxserver


http://developer.apple.com/macosx/launchd.html
man 5 launchd.plist
|
pidof
Here's one way of recreating that handy utility. I'm assuming that the utility is always run after the program we're looking for, so it has a smaller PID

fiBook:~ filipp$ ps A | grep something | grep -v grep | awk '{print $1;}'

|
Repair Permissions != Chumbug
Contrary to popular belief, Disk Utility's Repair Permissions function can be very helpful. Here's an example:

Software Update wouldn't work ("There were errors bla-bla-bla). Installing from PKG gave a better error (checking from install log) something about broken DiscRecording Frameworks. Repair Permissions had this to say:

Symbolic link ./System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/Current->A repaired
Symbolic link ./System/Library/Frameworks/DVDPlayback.framework/Versions/Current->A repaired
Symbolic link ./System/Library/Frameworks/DiscRecording.framework/DiscRecording->Versions/Current/DiscRecording repaired
Symbolic link ./System/Library/Frameworks/DiscRecording.framework/Frameworks->Versions/Current/Frameworks repaired
Symbolic link ./System/Library/Frameworks/DiscRecording.framework/Resources->Versions/Current/Resources repaired
Symbolic link ./System/Library/Frameworks/DiscRecording.framework/Versions/A/Frameworks/DiscRecordingContent.framework/Versions/Current->A repaired
Symbolic link ./System/Library/Frameworks/DiscRecording.framework/Versions/A/Frameworks/DiscRecordingEngine.framework/Versions/Current->A repaired
Symbolic link ./System/Library/Frameworks/FWAUserLib.framework/Versions/Current->A repaired
Symbolic link ./System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current->A repaired
Symbolic link ./System/Library/PrivateFrameworks/AppleVA.framework/Versions/Current->A repaired
Symbolic link ./System/Library/PrivateFrameworks/BezelServices.framework/Versions/Current->A repaired
Symbolic link ./System/Library/PrivateFrameworks/Bom.framework/Versions/Current->A repaired

After this and a 10.4.7 Combo Install, the machine worked fine again.

Another example, Activity Monitor wouldn't start, system.log had this to say:

2006-10-17 16:07:18.904 Activity Monitor[21307] The tool is not setuid root - please repair the privileges

Needless to say, repairing permissions fixed the problem. I've also seen cases where no application would launch - meaning you get the "blinking desktop" problem with the Finder constantly trying to start itself up. It was caused by a broken /tmp symlink (which in OS X links to /private/tmp, and we also have /var/tmp!) which Disk Utility nicely repaired.

Repair Permissions is often called the "PRAM zap of the 21'st century" and I agree. But just as a PRAM zap could fix a no-video issue, Repair Permissions can also help sometimes.

|
Back To Basics vol 2
Just so's I don't ever forget this again. To set up SSH without passwords:
mkdir ~/.ssh
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub me@server:~/me/.ssh/authorized_keys2

man ssh

|
A Tribute To Michael Ransom
http://growingontrees.com

|
Creative Workflow Hacks
Ainult power-useritele! ;)

|
Localtime
For some weird reason this gets set incorrectly sometimes, so this helps:
sudo ln -s /usr/share/zoneinfo/EET /etc/localtime

|
Resizing FileVault Disk Images
After installing a bigger drive:

1) Log in as another admin user
2) cd /Users/filevaultuser
3) hdiutil resize -size 1t filevaultuser.sparseimage
4) Give *filevaultusers* password

|
Secure Subversion 1.3 w/ Apache 2.2 & XCode 2
http://developer.apple.com/tools/subversionxcode.html

>./configure --prefix=/usr/local --mandir=/usr/local/share/man --with-ssl --with-apxs=/usr/local/apache2/bin/apxs --with-zlib --without-berkeley-d 

> httpd.conf
## SVN
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

WebSVN:
include/config.inc
> nano include/setup.inc > languages/english.inc

> mkdir /usr/local/subversion/repos
> sudo svnadmin create /usr/local/subversion/repos
> mkdir branches tags trunk; mv MyProject/* trunk
> svn import MyProject file:///usr/local/subversion/repos
> chown -R www:www /usr/local/subversion/repos


Machine B
> svn checkout http://host/ project


Authentication
> htpasswd -cm /path/to/htpasswd/file user 
> nano -w httpd.conf

DAV svn
SVNPath /path/to/repos
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /path/to/htpasswd/file

Require valid-user



XCode:
SCM Config > Subversion > /usr/local/bin/subversion --username user --password pw

http://www.alajaam.net/websvn

|