dfbills.com blog

Changing iTunes arrows to local

Somehow my iTunes arrows got changed back to default- clicking takes you to an iTunes Music Store search.  I prefer to change the iTunes arrows to point to my local
library.  Of course, you can always hold down “option” to modify this behavior, but I like to just grab my bluetooth mouse and forget the keyboard when navigating from my couch.

To change iTunes arrows to local:

defaults write com.apple.iTunes invertStoreLinks -bool YES

comment on this | posted in: Mac Music Tips Unix

Removing Leopard download quarantine

MacOSX Leopard tags files downloaded from the web with a special metadata bit.  This bit is later referenced to warn about running downloaded apps and scripts. Even archived files maintain this tag through the compression/decompress process.

I needed to update the firmware on my Canon PowerShot SD1000 camera and couldn’t get the camera to recognize the file.  Turns out the com.apple.quarantine xattribute was set.  To fix:

xattr -d com.apple.quarantine *.FIR

xattr does not have a man entry.  Use:

xattr -h

I found most of my information on this helpful post.

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

Open Apple Remote Desktop selection in SSH

John C. Welch posted a handy AppleScript which grabs selected addresses from Apple Remote Desktop and opens SSH sessions in the terminal for each one.  Hard to believe this isn’t built into ARD.  I’d previously used a hard coded AppleScript to open up these sessions.  Having them opened from the live scan list is very handy!

I took out the hard coded username in the SSH string and added an activate command to the terminal to bring the windows to the front.

set theSSHList to {}
tell application “Remote Desktop”
set theComputers to the selection
repeat with x in theComputers
set the end of theSSHList to Internet address of x
end repeat
end tell

tell application “Terminal”
activate
repeat with x in theSSHList
do script “ssh ” & (contents of x)
end repeat
end tell

comment on this | posted in: Mac News Tips Unix

Expand those print dialog boxes

Here’s how to expand all those pesky minimized print dialog boxes in Leopard:

defaults write /Library/Preferences/.GlobalPreferences PMPrintingExpandedStateForPrint -bool TRUE

ah, that’s better.

comment on this | posted in: Mac Tips Unix

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
 <  1 2 3 4 5 >