dfbills.com blog

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

Finding an app preventing disk eject

This command will help you find which app is preventing a disk from ejecting.

lsof | grep YourDriveName

comment on this | posted in: Mac Tips Troubleshooting Unix

My friend build_hd_index (updated 4x)

Since I’m on a bit of a performance tuning hunt this week, I decided to find out why my hard drive was grinding away this morning.  (With a load average of 2.6)

Turns out, it was my old friend build_hd_index.  This horrible little app is part of Apple Remote Desktop.  It is designed to index the hard drive at a default time of midnight on all systems that are managed by Remote Desktop. Seems innocuous enough- that is until you hear it churning away late at night on several computers.

So now we have Spotlight, locate, Time Machine and build_hd_index indexes of the hard drive and they all grind away at all hours of the day and night.  The unfortunate thing is that only Spotlight is away of the “special” status of Time Machine’s Backups.backupdb database.  All the others just thrash away.

So without further ado- here’s how to disable build_hd_index:

sudo chmod a-x /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/build_hd_index


Keep your friends close and your enemies even closer.

update: A few people have written me to say that turning off the “generate reports” option in the Sharing/Remote Management panel will keep this from happening but this seems to have no effect on my system.

update 2: A better fix: manually reset the data collection policy by removing the file com.apple.ARDAgent.plist file in /Library/Preferences as Apple recommends.  (This does not seem to always do the trick)

sudo rm /Library/Preferences/com.apple.ARDAgent.plist

update 3: laptopleon pointed out that nulling the privileges can break macosx server system updates.  I’ve updated the chmod command to simply remove execute privs.

update 4: Apple has posted a Knowledge Base article: “Apple Remote Desktop: How to disable build_hd_index.”  Not sure that this is a definitive solution.

(6) comments | posted in: Mac Tips Troubleshooting Unix

Monitor spotlight

Ever wonder what is spotlight working on right now?  This command will query the filesystem for you.

lsof | grep mdworker

comment on this | posted in: Mac Tips Troubleshooting Unix

Spotlight became “sputter-heavy”

I was having problems with Spotlight on Leopard 10.5.1.  My computer was dog-slow and just plain unresponsive.  Spotlight search results were inconsistent and I was noticing that my drive was being re-indexed quite regularly (as evidenced by the spotlight menu item and the concealed progress bar).

My first troubleshooting step was to fire up Spotless to delete the indexes and allow them to rebuild.  Unfortunately, 24 hours later the indexing was still going.  My index kept stalling at around 127MB.

I used the following code to check it.

sudo du -h /.Spotlight-V100/

After watching it for about and hour, I decided to upgrade to a self-running version with Growl notifications.

while :
do
clear
sudo du -h /.Spotlight-V100/ | /usr/local/bin/growlnotify
echo “growled” & date “+%H:%M:%S%n”
sleep 90
done

Some searching revealed that quite a number of people had experienced this problem at the release of 10.5.1.  My standard tracing solution didn’t tell me too much.

lsof | grep mdworker

But, anther user explained how to use the dtrace system utility to examine the mdworker process.  On my system it was using 90-100% processor time.

sudo dtrace -n ‘syscall::open*:entry /execname == “mdworker” | execname == “mds”/ { printf("%Y %u %s %s",walltimestamp,pid,execname,copyinstr(arg0)); }’

This led me to examine the console and sure enough, the mdworker was crashing every 3 secs on a particular file and writing a crashlog.

Jan 30 23:55:07 Macintosh ReportCrash2692: Formulating crash report for process mds2686
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10c830.mdworker2687): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10c9f0.mdworker2690): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10cbb0.mdworker2691): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (com.apple.metadata.mds2686): Exited abnormally: Segmentation fault
Jan 30 23:55:07 Macintosh mds2695: (/.Spotlight-V100/Store-V1/Stores/9A285684-2061-4212-B186-56B95ACE8BD7)(Error) IndexCI in ContentIndexOpenBulk:No index
Jan 30 23:55:07 Macintosh ReportCrash2692: Saved crashreport to /Library/Logs/CrashReporter/mds_2007-11-12-235505_Macintosh.crash using uid: 0 gid: 0, euid: 0 egid: 0

After poking about for a while I settled on the same solution as many others- an OS reinstall.  Archive & Install worked fine and the entire process, including software updates, took about 90 minutes.

Fixed.

comment on this | posted in: Mac Tips Troubleshooting Unix

Activate QuickLook plugins without logout or reboot

To activate QuickLook plugins without a logout or reboot, simply reset QuickLook at the command line.

qlmanage -r

(1) comments | posted in: Mac Tips Unix

MacOSX filesystem usage

To see realtime filesystem usage in MacOSX:

fs_usage

Also useful for checking what exactly an app is doing:

fs_usage -w -f filesys | grep AppName

comment on this | posted in: Mac Tips Troubleshooting Unix
« First  <  2 3 4 5 >