Deleting the contents of the /Library/Managed Preferences directory is definitely one way to refresh your managed preferences cache in Mac OS X, but there have been commands specifically designed to clear the cache for each version of Mac OS X. By OS, these include the following: 10.6 – mcxrefresh – You can use this command (in /usr/bin) to refresh managed preferences 10.6 also has a ManagedClient binary in /System/Library/CoreServices/ManagedClient.app/Contents/MacOS/ManagedClient. When run with a -f option, ManagedClient will force updates. 10.5 has a binary called mcxd located in /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd which can also be run with a -f option 10.4 has a binary called MCXCacher, stored in /System/Library/CoreServices/mcxd.app/Contents/Resources/MCXCacher which also supports the…
-
-
S3 Command Line Part II
Earlier we looked at using s3cmd to interact with the Amazon S3 storage cloud. Now we’re going to delve into using Another S3 Bash Interface. To get started, first download the scripts and then copy the hmac and s3 commands into the ec2 folder created in previous walkthroughs. To use the s3 script, you need to store your Amazon secret key in a text file and set two environment variables. The INSTALL file included with the package has all the details. The only tricky part I ran into, and from the comments on Amazon, other people ran into, is how to create the secret key text file. Now go into your…
-
Self Destructing Scripts
I have mentioned creating a self destructing script or launchd item a few times in articles on this site. But it was recently pointed out that I never actually showed how to go about doing so. Until recently I would actually use an out-of-band script to remove a script, a launchd agent or a launchd daemon. However, this would invariably leave elements somewhere on a file system of the script. For example, within a script I would echo out another script, fire off that script and then use it to delete (rm) the original script. When I planned out a deployment or a series of scripts I would always have…
-
Mac OS X: Deleting a Resource Fork
HFS+ and resource forks. Still a necessary evil. At times I find that I need to remove a resource fork from the command line, leaving the file otherwise in tact. To do so, first create an empty file. In this case I’ll create a file using touch called todelete, so I remember to delete it: touch todelete Now we’re going to copy this empty file over the resource fork for the file myvideo.mov using the cp command: cp todelete myvideo.mov/rsrc At this point, we can clean up the original file we created previously using rm: rm todelete