Archive

Archive for April, 2012

Automatically activate the Java web plug-ins setting on login

April 13, 2012 18 comments

One of the features of Apple’s Java for OS X Lion 2012-003 update is that this Java update for Mac OS X 10.7.x turns off the automatic execution of Java applets through web browsers.

The Java update does allow for the automatic execution of Java applets to be re-enabled through the browser. However, if it’s been a while since a Java applet was launched, then automatic execution of Java applets is once again automatically disabled.

This was going to be an issue at my workplace, as we have at least one application that relies on Java applets running through the browser. Fortunately, I already had a fix for this issue, I just needed to script it and run that script automatically with the user’s permissions.

Update (4-13-2012): It turned out that I also needed to add the GeneralByTask:Any:WebComponentsLastUsed key to the plist and set it. I’ve now updated the script below and my GitHub repo with the added key settings.

Update (4-18-2012): Joel Bruner in the comments pointed out that the real value associated with the GeneralByTask:Any:WebComponentsLastUsed key needs to be a dynamic date value rather than a static value that will expire. I’m incorporating his date calculating method into the script.

#!/bin/sh

# DYNAMICALLY SET THE UUID FOR THE BYHOST FILE NAMING
if [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-50` == "00000000-0000-1000-8000-" ]]; then
MAC_UUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c51-62 | awk {'print tolower()'}`
elif [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-50` != "00000000-0000-1000-8000-" ]]; then
MAC_UUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i "UUID" | cut -c27-62`
fi

# Set the the "Enable applet plug-in and Web Start Applications" setting in
# the Java Preferences for the current user.

/usr/libexec/PlistBuddy -c "Delete :GeneralByTask:Any:WebComponentsEnabled" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.${MAC_UUID}.plist
/usr/libexec/PlistBuddy -c "Add :GeneralByTask:Any:WebComponentsEnabled bool true" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.${MAC_UUID}.plist
/usr/libexec/PlistBuddy -c "Delete :GeneralByTask:Any:WebComponentsLastUsed" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.${MAC_UUID}.plist
/usr/libexec/PlistBuddy -c "Add :GeneralByTask:Any:WebComponentsLastUsed real $(( $(date "+%s") - 978307200 ))" /Users/$USER/Library/Preferences/ByHost/com.apple.java.JavaPreferences.${MAC_UUID}.plist


To make this work, I’ve written a script and launch agent combination. The script will enable the Enable applet plug-in and Web Start Applications setting in the Java Preferences application.The LaunchAgent runs the script on login to any user account with the logging-in user’s privileges and permissions.

You can find it here on my GitHub repo.

Using Casper 8.51 to remotely lock or wipe 10.7 Macs

April 6, 2012 1 comment

One new feature of Casper 8.51 is that you can lock or wipe your 10.7 Macs using the same remote lock / wipe features that have been available through Apple’s Find My Mac service. If you want to use this on your JSS, see below the jump for details.

Read more…

Categories: Casper, JSS, Mac administration

Using the Casper JSS’s built-in certificate authority to generate Tomcat SSL certificates

April 5, 2012 Leave a comment

I upgraded my Casper test box this morning to Casper 8.51. When I logged in, I got a message that my self-signed SSL certificate had expired a while ago.

Screen shot 2012-04-05 at 9.49.52 AM

This was certainly true, so I decided to change my Tomcat SSL certificate to a certificate issued by the JSS’s own built-in PKI certificate authority. If you also want to do this, here’s how:

1. Log into your Casper JSS.

2. Click on the Settings tab.

3. Click on the General Settings link

Screen shot 2012-04-05 at 9.50.25 AM

4. Click on Server Configuration

Screen shot 2012-04-05 at 9.50.42 AM copy

5. Click the Replace with certificate from the JSS’s built-in CA link

Screen shot 2012-04-05 at 9.50.42 AM

6. When prompted, you’ll need to restart Tomcat to apply the changes. (I rebooted my Casper test box to do this.)

Screen shot 2012-04-05 at 9.50.52 AM

Categories: Casper, JSS
%d bloggers like this: