Launchd & Tomcat
Launchd is amazing. It's predictable, simple, easy and correct. When Apple makes an app like Launchd in 2005, it makes me wonder what the hell Sun, HP and IBM were doing while improving UNIX for the last 30 years. Regardless it's my new favourite thing and it's much better than init.d and the Windows services system.
To get Tomcat started when your Mac boots, create a file called /Library/LaunchDaemons/org.apache.jakarta.tomcat.plist and fill it with the following XML. You'll need to change the paths to your Tomcat folder and use the Mac OS X user that Tomcat shall run as.
<?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">
<!-- Tomcat Startup Script, by Jesse Wilson, May 27, 2005 -->
<plist version="1.0">
<dict>
<key>Label</key> <string>org.apache.jakarta.tomcat</string>
<key>OnDemand</key> <false/>
<key>ProgramArguments</key> <array>
<string>/Users/jessewilson/Apps/jakarta-tomcat-5.5.9/bin/catalina.sh</string>
<string>run</string>
</array>
<key>ServiceDescription</key> <string>Tomcat Server</string>
<key>UserName</key> <string>jessewilson</string>
<key>StandardOutPath</key> <string>/Users/jessewilson/Apps/jakarta-tomcat-5.5.9/log.stdout</string>
<key>StandardErrorPath</key> <string>/Users/jessewilson/Apps/jakarta-tomcat-5.5.9/log.stderror</string>
<key>EnvironmentVariables</key> <dict>
<key>JAVA_HOME</key>
<string>/System/Library/Frameworks/JavaVM.framework/Home</string>
</dict>
</dict>
</plist>
# posted by Jesse Wilson
on Friday, May 27, 2005
4 comments
post a comment
Stupid Bash Tricks: Open a file
Frequently I'm working from the command line in my Mac OS X box, and I want to open a file in my editor. With my file-type associations set, this is as easy as
$ open ./source/ca/odell/centricclient/Contact.java
The only problem is that I'm a
lazy programmer and that's a lot to type. Plus I need to get the directories right.
With my new 1-line
fopen script, I can open the file easier:
$ fopen Contact.java
This works as long as Contact.java is in a subdirectory of the current working directory. It will open all files that contain "Contact.java" in their name. If I wanted to open all of my decorator files, I might call
$ fopen Decorator
This would open TableModelDecorator.java, ButtonDecorator.java, and even Decorator Invoice.pdf.
Here's the script:
#!/bin/bash
find . -name "*$1*" -exec bash -c "echo {} && open {}" \;
# posted by Jesse Wilson
on Wednesday, May 11, 2005
2 comments
post a comment
Mac OS X Mail Crypto and GMail SMTP
2004 has a
great article on how to set up crypto for Mac Mail, without any plugins, self-signed certificates or even command line configuration!
Here's all you need to do to sign messages:
Create a certificate through Thawte's free web of trust.
Download that certificate into Mac OS X's keychain
Click the new 'signature' box that shows up in your compose message window!
And to encrypt messages:
Recieve a signed message from a friend who used the steps above,
Your Mac OS X's keychain will automatically import that friend's public key
Click the 'encrypt' box that shows up in your compose message window when your friend is the recipient!
Now some caveats that I faced:
Gmail's SMTP server replaces your regular email address with your gmail address. So if your signature is for you@yourdomain.com
, your messages will still come from you@gmail.com
. This ruins crypto and your signature will no longer match.
Doteasy appends a stupid ad on all messages forwarded from their servers to other servers. This also ruins crypto and your signature will no longer match.
Gmail silently discards any email where the signature doesn't match. This means you have to make quite sure your signatures are working perfectly before you start using them.
Moral of the story here is that it is very bad to fuck with the content of a signed or encrypted message.
# posted by Jesse Wilson
on Thursday, May 05, 2005
0 comments
post a comment
A free SVG for HP iPod tattoos
As seen
elsewhere, HP makes these great stickers called
"HP Printable Tatoos for your iPod".
For your convenience, you can download
template.svg, a template I created for building custom iPod skins in Corel Draw or Illustrator.
Some tips:
Skins are $20 for ten. That's quite expensive. If you make use of this, be sure to create skins for all your friends! They probably make great spontaneous gifts.
Don't forget to delete the template's outlines before printing your skin!
When doing your design, draw beyond the edges of the skin. This is to allow for 'bleed', which just means that you'll guarantee that you don't have white borders on your printout.
The skins look great! I'm not sure how long it'll last, but I'm very satisfied with my Saskatchewan Roughriders iPod!
# posted by Jesse Wilson
on Sunday, May 01, 2005
2 comments
post a comment