Showing posts with label osx/utility. Show all posts
Showing posts with label osx/utility. Show all posts

2010-02-02

Releasing some of my OS X administrative utility scripts

I decided to release some code I've been using at work to manage our Macintoshes.

All the code is downloadable at http://github.com/unixorn/osxtoolkit

Currently osxtoolkit includes:

  1. A puppet fact script to load the contents of files in /etc/knobs as facts named after the file name.

  2. scripts to use as login & logout hooks that run /etc/hooks/LI* on login, and /etc/hooks/LO* on logout. It uses iHook so the users can see progress.



Usage:


read_hook.rb


Copy to the lib/facter directory in one of your modules.

enable_login_scripts


The hook drivers only load scripts that are in /etc/hooks, have their x bit set, and have either an LI or LO prefix in their name. They're run in alphabetic order. LI* hooks are run on login, and LO* hooks are run on logout. You'll probably want to replace hook_background.jpg with something
appropriate for your local environment.

Prerequisites:


iHook

You need to download a copy of iHook from

http://rsug.itd.umich.edu/software/ihook/

since the hook driver scripts rely on it to present a pretty dialog with a progress bar during login & logout as they run the appropriate hook scripts.



Tar iHook.app up, then bzip2 the tarball. I recommend keeping the tarball (with version number in the name) on a central server, then letting make download it and rename it to iHook.app.tar.bz2 as part of the package build process. This will let you reproduce specific versions of the package later.


Luggage: http://http://github.com/unixorn/luggage


Luggage isn't necessary to run the hook loaders, just to make deploying them to your Macintoshes easier. You need to update TARBALL_LOCATION in the included Luggage Makefile to point to where you're storing your iHook tarball, then you can make a dmg with a pkg file containing everything necessary for the hook script suite with 'make dmg'. That dmg can then be easily deployed with InstaDMG or puppet.

2010-01-21

Luggage 1.0rc2 released

Synced my latest changes to the Luggage. Detailed documentation here.

1.0rc2 includes
  • Fixed broken unarchive step in unbz2-applications & ungz-applications rules
  • Added recipe to install Ruby scripts to site-ruby
  • Added recipe to install Python scripts to site-python
  • Added more interesting example package - enable_login_hooks.
The enable_login_hooks example package also includes code to run all login hooks found in /etc/hooks on login, and logout hooks at logout.

Enjoy.

(Updated to add link to github repo, documentation)

2009-03-13

New disk image tests

I got permission to release the changes I've made at work to the run_image_tests.py disk image test framework that Nigel Kersten originally wrote (thanks Chris, for pushing them into svn for me) along with a bunch of example tests you can use. These are all the tests I use at work every time I make a new master disk image that are generic enough the be useful to others.

I don't bother to manually test any images that don't pass all of the unit tests first.

You can find them at the pymacadmin project site at Google Code.

All the unit tests descend from macdmgtest.DMGUnitTest. DMGUnitTest provides some handy utility functions that convert paths relative to / to the path relative to the mounted dmg you're testing.

dmgtestutilities.py provides some more convenience functions - there are functions to lint plists and load plists using Foundation so plistlib doesn't crap out when you try to load a binary plist.

Example tests:
applications_dir_test.py:
Ensures all applications in /Applications and /Applications/Utilities have sane ownership/permissions.

blacklist_test.py:
Confirms the absence of files in your blacklist. I mainly use this to confirm that various settings files that would contain information specific to the hardware model I ran InstaDMG on don't end up on my master images.

empty_directory_test.py:
Confirms that directories that you want to be empty on the generated image, actually are.

network_plist_test.py:
Confirms the absence of various network preference files. This prevents a problem we ran into when booting MacBook Airs from an image created on a machine that has built-in ethernet.

ouradmin_test.py:
Ensures that there's a local admin user on the image named ouradmin, and that it's a member of the admin, _lpadmin and _appserveradm groups. Also lints the appropriate plist files in /var/db/dslocal/nodes/Default to detect if your user creation package corrupted them.

skipsetup_test.py:
Makes sure the appropriate files have been touched on the image to prevent a newly imaged machine from playing the annoying welcome movie.

software_update_test.py:
If you're using a local software update server in your environment, you can use this to make sure the dmg has the correct settings to use it instead of the standard Apple servers.

zz_plint_test.py:
Lints every plist on the dmg and displays a list of any files that failed their lint check.

zz_suidguid_test.py:
Finds every suid/setguid file on the dmg and reports any that aren't in your whitelist. Handy for detecting crappy installers.

zz_world_writable_test.py:
Finds every file or directory that is world writable and reports any that aren't in your whitelist. Also useful for detecting poorly written installers.

I've also included the whitelists and blacklists I'm using for these tests for you to use as a base to customize your own, though I'd appreciate it if you'd email any additions you think are useful.

2008-03-03

Suspicious Package update

Suspicious Package is a QuickLook plugin that lets you examine pkg (and now mpkg) files from Finder with QuickLook. No more having to drop into Terminal.app and use lsbom.



Here are the bullet points from the release notes:



  • Added support for metapackages.

  • Fixed problem where the actual installation location was not shown for some packages.

  • Added indication when a package requires authentication with an administrator password.

  • Added indication when a package requires a system restart (or shut down, or log out) after installation.

  • Added indication when a package has install scripts, and an option to view the actual scripts (see details).

  • Added support for installer receipts and .bom files



Download the new release from http://www.mothersruin.com.

2008-01-21

QuickLook plugin for .PKG

There's a handy QuickLook plugin to show what files a pkg will install at http://MothersRuin.com/software/SuspiciousPackage/


Suspicious Package is a plugin for the Quick Look feature of Mac OS X 10.5 (Leopard). It allows you to preview the contents of a standard Apple installer package without launching the Installer. Just select the icon in the Finder and select Quick Look

2007-12-15

ZIP file Quick Look plugin

XX posted a free Quick Look plugin that lets you examine ZIP, TAR, GZip, BZip2, ARJ, LZH, ISO, CHM, CAB, CPIO, RAR, 7-Zip, DEB, RPM, StuffIt's SIT, DiskDoubler, BinHex, and MacBinary on his MacItBetter blog.

2007-05-25

RubyCocoa 0.11.0 released

RubyCocoa 0.11.0 is out. Build Cocoa applications with Ruby. Download it from Sourceforge.

2007-05-21

Subversion scripts for Finder

Adam Brytek posted a list of AppleScripts for OS X Finder that allow you to do a bunch of convenient Subversion commands here.

The current rev supports

  • Add

  • Commit

  • Delete

  • Revert

  • Status

  • Update

2007-05-14

OSX process snapshots

Amit Singh posted details of how to make a snapshot of a running process - memory, registers, the works - here. He posted source code for a program that will make the snapshot, too.

The really cool thing is that you don't need to make changes to the program for his technique to work, and taking the snapshot doesn't force the running process to halt.

2007-05-09

More MacFUSE

MacFusion is an Open Source GUI for MacFUSE. It currently supports SSH filesystems and Secure FTP filesystems, but it has a plugin architecture so I expect to see more supported filesystems soon.

ProcFS for MacFUSE

Amit Singh has released procfs (with source) for OS X here. You'l need to have MacFUSE installed for this to work.

2007-04-21

HandBrake 0.8.5b1 Released

All sorts of nice stuff. Cool new features include AppleTV support & surround sound.

Get it here.

2007-04-04

Google Desktop for Mac

So I can finally talk about this. To sum up, very cool. You can use it for launching applications like Quicksilver, or just use it to search the docs on your machine like Spotlight, only with less frustration. And you can have it search your GMail account, too.

2007-03-10

Use Google Calculator as OS X Service

Christopher Biagini packaged up an OS X service that wraps Google Calculator here.

2007-03-06

Serverskine

Free, and handy for the OS X based web developers.

Serverskine

"Designed to allow web developers, who deal with many projects at once, quick access to FTP, hosting accounts, domain name accounts and more. Especially when dealing with off-site shared hosting, keeping track of usernames and passwords can be daunting. Serverskine eliminates the terror by allowing you to quickly organize, search, edit, and backup all of your important account information."

2007-02-28

MacFUSE 0.2.2

Another MacFUSE release, with bugfixes and sample filesystem source code. Get it here.

2007-01-26

MacFuse

Amit released the Macintosh port of FUSE at MacWorld, which lets people write filesystems that don't require kernel code. Greg Miller has written a great sample filesystem for it, SpotlightFS.

2007-01-25

Easy way to create services on OS X

ThisService is an extremely handy tool for creating services on OS X. Any script you have that reads from STDIN and writes (if appropriate) to STDOUT can be easily turned into a service.

Creative Commons License

This work is licensed under a Creative Commons License.
Copyright 2007-2010, Joseph P. Block, Some Rights Reserved.

Creative Commons Logo