dfbills.com blog

Setting a Time Machine size limit

To create a Time Machine size limit in Leopard, simply issue the following command in the terminal:

defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 102400

Size is measured in megabytes- my example is 100GB.

A year later, this does not appear to work (even after using the integer option).  Here is the code to reverse this change:

defaults delete /Library/Preferences/com.apple.TimeMachine MaxSize

The accepted way to limit the size now is to create a sparse disk image.

comment on this | posted in: Mac Tips Unix

Open data from shell in any graphical application

A sweet tip for opening data from the Mac shell environment in any graphical application from MacOSXHints.

Previous to this hint, the only way I was using “open” was to open files from the command line with their related graphical app.  For instance, opening a .rtf file in TextEdit:

open mytext.rtf

Or simply piping source code to TextMate via a curl download:

curl http://dfbills.com | mate

Now, I can can load data and files into any application by adding the -f and -a flags:


curl ‘http://example.com/encodingerror.html’ | open -a ‘Hex Fiend’ -f
curl ‘http://example.com/example.html’ | open -a ‘TextMate’ -f
curl ‘http://example.com/example.png’ | open -a ‘Preview’ -f
curl ‘http://example.com/example.m4v’ | open -a ‘QuickTime Player’ -f

comment on this | posted in: Mac Tips Unix

Kickstart mac screen sharing

Great trick to start up Mac screen sharing remotely via Terminal from MacOSXHints.

The screen sharing system component uses launchd to monitor its state. This means that enabling and disabling the feature as simple as adding a file in /Library/Preferences.

cd /Library/Preferences
echo -n enabled > com.apple.ScreenSharing.launchd

To disable, simply delete the file.

comment on this | posted in: Music Tips Unix

Setting up Pine for Gmail with IMAP

I just got IMAP Gmail for my domain working with pine.  Here’s how I did it:

In the .pinerc:


user-id=myusername@mydomain.com

user-domain=mydomain.com

smtp-server=smtp.gmail.com:587/tls/user=myusername@mydomain.com

inbox-path={imap.gmail.com:993/ssl/novalidate-cert/user=myusername@mydomain.com}INBOX

incoming-folders=myusername@mydomain.com {imap.gmail.com:993/novalidate-cert/ssl/user=myusername@mydomain.com}

folder-collections=“myusername@mydomain.com” {imap.gmail.com:993/ssl/user=myusername@mydomain.com}[]

I’m still getting the “unable to validate certificate” message when viewing folders (starred) items, but it isn’t that big of a deal.  The prefix and novalidate-cert probably need to be set in an additional area that I haven’t identified yet.

comment on this | posted in: News Tips Unix

Fixing iPhone Installer.app “Main Script execution failed”

Finally got around to fixing the iPhone Installer.app “Main Script execution failed” problem.  I was running 1.1.4 and it turned out that the Installer.app somehow had acquired wrong security settings.

My fix:

1: SSH’d into the iPhone

2: Corrected permissions to 755 plus the setuid bit (allowing execution as root)

chmod 4755 /Applications/Installer.app/Installer

3: Corrected owner and group:

chown root:wheel /Applications/Installer.app/Installer

4: Restarted the iPhone and tapped Installer.app

5: Now, it’s working great!

(1) comments | posted in: iPhone Unix

Real-time iPod scrobbling to iChat

A few months back, I was feeling a bit jealous of all the cool kids in iChat using their music as status messages.  I’ve played with this on and off since I first saw the scripts to make this happen on Doug’s Scripts for iTunes.  When it was officially added to iChat in the Tiger OS release, I toyed with it some more, but never could really use it on a regular basis since I play music at work on my iPod.

Then one day it hit me- with my jailbroken iPod, I could wirelessly scrobble tracks to last.fm and then pull that data back down and use it for a status message.  So, I whipped up a little shell script.

#!/bin/sh
while :
do
osascript -e ‘tell application “iChat” to set status message to (do shell script “curl http://ws.audioscrobbler.com/1.0/user/dfbills/recenttracks.txt | head -n 1 | cut -c12-”)’
sleep 110
done

Download here.

I’m sure this could be cleaner and I’ve been mulling over the idea of setting the data as a variable so that I can display a growl message too, but hey- my contacts in iChat can see my uber-cool status line showing my musical taste and that’s all I set out to do.

comment on this | posted in: Mac Music Unix Webdev

Getting started with “screen”

I’ve been wanting to to get into using “screen” ever since Drew Raines introduced me to it last year.  Here’s the great tutorial by Bjørn Hansen that finally got me going using it.

To get started:

screen

Now, you can run your app.  Press ctrl-a, then d to detach.

When ready to reconnect, type:

screen -x

You can get a list of all screen sessions:

screen -ls

Simply type the PID to select a particular screen.

Three other handy commands:

ctrl-a, then c to create a new screen
ctrl-a, then n to go to the next screen
ctrl-a, then p to go to the previous screen

comment on this | posted in: Tips Unix

Setting password in iPhone 1.1.3

For some reason the utility for changing the password in iPhone 1.1.3 is broken. You cannot use passwd to change password or you will have to restore the system. I found a great workaround online which uses perl.

perl -e 'print crypt("PASSWORD", "XX")."\n"'

Simply replace "PASSWORD" and the two character hash "XX". Then, take the resulting hash and replace the "alpine" password hash in /etc/master.passwd for both "root" and "mobile".

comment on this | posted in: iPhone Tips Troubleshooting Unix

Respring via terminal

To respring the iPhone via terminal:

launchctl stop com.apple.SpringBoard

comment on this | posted in: iPod Tips Troubleshooting Unix

Leopard, why can’t you behave?

The latest in my epic struggle with Leopard.  Now, on my Mini!

Apparently Time Machine in 10.5.2 does not like my Intel Mac Mini environment.  At the time of posting, I only found one other reference to my latest Leopard error: “Backupd Waiting for index to be ready.”  I’m hoping that there will be more…

For the record, here’s what I was seeing for 18+ hours in my console:

2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Backup requested by user
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Starting standard backup
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Backing up to: /Volumes/External Backup HD/Backups.backupdb
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Event store UUIDs don’t match for volume: Macintosh HD
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Backup content size: 45.2 GB excluded items size: 7.0 MB for volume Macintosh HD
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] No pre-backup thinning needed: 54.26 GB requested (including padding), 60.98 GB available
2/12/08 11:12:27 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (909 > 0)
2/12/08 11:12:32 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:12:40 PM kernel jnl: disk2s6: flushing fs disk buffer returned 0x5
2/12/08 11:12:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:12:57 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:13:17 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:13:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:14:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:14:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:14:43 PM /usr/sbin/ocspd[222] starting
2/12/08 11:15:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:15:14 PM kernel jnl: disk2s6: flushing fs disk buffer returned 0x5
2/12/08 11:15:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:16:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:16:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:17:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:17:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:18:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:18:42 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:19:12 PM /System/Library/CoreServices/backupd[212] Waiting for index to be ready (906 > 0)
2/12/08 11:19:18 PM kernel jnl: disk2s6: flushing fs disk buffer returned 0x5

(2) comments | posted in: Mac Troubleshooting Unix
 <  1 2 3 4 5 >