Fun with find

# find all .html files in the current directory and sub directories
find . -name "*.html" -type f -print

# find all "dot" directories
find /Users/smbrown -name ".*" -type d -print

# find all "dot" files
find /Users/smbrown -name ".*" -type f -print

# find all dot files, but omit the pesky OS X .DS_Store files
find . -name ".*" -type f ! -name ".DS_Store"
# find all the .mp3 files in the cwd and copy them to a folder on the desktop named iPod
find . -name "*.m*" -type f -exec cp '{}' ~/Desktop/iPod/ \;

JAVA_HOME on Mac OS X 10.5

I normally don’t mess with Java so this is likely a trivial point, I could very well be stating the most obvious of obvious things.

The documentation for Amazon’s EC2 Web Service actually had a well written explanation, but who reads? Scanning the setup instructions I saw:

  • Java. — Check, I got that
  • Java JRE version 1.5 — Check? [smbrown@jrcash$] java -version
  • JAVA_HOME — Check? [smbrown@jrcash$] which java
  • FAIL

JAVA_HOME is /Library/Java/Home it is the location where the sub folders bin/java/

What is my “JAVA_HOME“? it is “the full path of the directory that contains a sub-directory named bin which in turn contains the java

To see your current JAVA_HOME:
[smbrown@jrcash$] echo $JAVA_HOME

To set a JAVA_HOME, insert this in your ~/.profile:
JAVA_HOME=/Library/Java/Home
export JAVA_HOME;

What is a better way to confirm your real Java version JAVA_HOME on OS X?

[smbrown@jrcash$] $JAVA_HOME/bin/java -version

Thanks for taking a look you can go back to Twittering now. =)

Update (January 10, 2009): Amazon released their AWS Web Console, here’s an early tour.

Focus on writing

When a simple 10 minute exercise in thinking and writing up a few ideas turns into a two week delay in action, maybe the environment precludes the generation of the message. Can simple applications like WriteRoom make you more productive? You don’t need to write the next, great novel to appreciate the powerful, liberating experience of letting go and focusing on the task at hand.

What if writing weren’t so often like this:

but instead were more like this:

Are there similar text editors like WriteRoom for Windows?

 

Save PDF Web Receipts Folder – Change Default – 10.5

This hint provides information on modifying the OS X “Save PDF Web Receipts Folder” work-flow that’s attached to the print dialog, but it is for 10.4 only.

I never like having a “Web Receipts” folder at the top of my “~/Documents”, I’d prefer they we kept in a sub-folder, e.g. (“~/Documents/Personal/Web \Receipts/”). Well, the above hint was about something different that doesn’t happen in 10.5 but the comment by “Mechcozmo” provided the necessary clue.

If you want change the default location for storing “Web Receipts”, open the file “tools” in this location:
/Library/PDF Services/Save PDF to Web Receipts Folder.pdfworkflow/Contents and change the line 25 from:

destDirectory = os.path.expanduser("~/Documents/Web Receipts/")

to whatever you prefer i.e.:

destDirectory = os.path.expanduser("~/Documents/Personal/Web Receipts/")