Category Archives: Mass Deployment

Mac OS X Mac OS X Server Mac Security Mass Deployment

Receipts & Bills of Material in 10.8

When installing a package OS X makes a list of what it installs in /Library/Receipts/InstallHistory.plist. The dictionaries show each package installed, along with the installation date, the name displayed during installation, the version of the package being installed, the identifier of the package and the process name used to install the package. This information, along with the file name of the actual package is stored in corresponding property lists in /private/var/db/receipts. Each bill of material is also stored there, in .bom file.

The lsbom command is used to see a list of objects installed by the package. You can also see the options such as the permissions assigned to files by the package as they’re installed. For example, that Twitter app from the app store; to see what it installs:

lsbom /private/var/db/receipts/com.twitter.twitter-mac.bom

This package is installed by the Mac App Store. When run, packages installed by the Mac App Store should only contain objects within that applications .app bundle. That’s a pretty good bit of information, so you can also use the -s option to constrain the output to only see the paths of files (relative paths, of course). I’m usually a fan of getting more information than less, so I usually run it adding the -m option, which shows me those permissions.

lsbom /private/var/db/receipts/com.twitter.twitter-mac.bom

Note: You can also use the mkbom command to create new .bom files. As the man page for bom indicates, this goes back to NeXTSTEP and was extended for 10.0 and again in 10.3.

Mac OS X Mac OS X Server Mac Security Mass Deployment

Who Needs Root When You Can Have Simple Finder

Here’s the thing: I’m not very good with computers. So to keep me from hurting myself too badly, I need the simplest interface available that allows me to run multiple applications. But most of the command keys shouldn’t work in this interface and I should only have Finder, file and Help menus.

Luckily for my poor MacBook Airs, Apple thought of people like me when they wrote the Finder and invented something called Simple Finder which makes OS X even simpler than it is by default to use. To enable Simple Finder, just go to Parental controls, enable controls for a user and then check the box for Simple Finder. Or, if you have an entire population of users like me, who simply can’t be trusted with a full operating environment, you can send the InterfaceLevel key with the contents of simple (easy to remember for those of us who resemble said key) to com.apple.finder and restart our friendly neighborhood Finder:

defaults write com.apple.finder InterfaceLevel simple; killall Finder

Come to think of it, maybe I’m not so awful. Let’s say I want to turn that whole Simple Finder thing right back off. Well, all we have to do is delete that key we created and then restart the Finder:

defaults delete com.apple.finder InterfaceLevel; killall Finder

Actually, I am terrible with these things. So much so that it’s not appropriate for me to use a computer. Therefore, just take it away. I’ll be better off using that Samsung with Windows 8 for awhile. At least there, I won’t be able to get any of my apps open or find any of the administrative tools that could damage the computer!

Mac OS X Mac OS X Server Mac Security Mass Deployment Ubuntu Unix

Using allmemory To Test Memory in OS X

Earlier I wrote an article on testing memory using memtest. Memtest actually looks at the memory in a system and checks it for errors. But what about checking the systems use of memory for problems? Well, OS X has a built-in tool call allmemory that can check system or per process memory. In its most simple incantation allmemory can just be run with no options:

allmemory

This is going to result in a few errors if only because allmemory is getting a little long in the tooth. But you can also scan on a per-process basis. To do so, run allmemory with a -proc option and then the pid for the process:

allmemory -proc 13727

You can also use the following options:

  • -noframework: doesn’t show data that comes from frameworks (otherwise it does), so this option would only show the spcific process and not dependencies
  • -noprocess: doesn’t show the process, so more looking at framework utilization
  • -32bit: only show 32-bit processes
  • -64bit: only show 64-bit processes
  • -v: show address space utilization on a per process basis
  • -f: show segment utilization on a per framework basis
  • -i: show data from a previous run of the tool, which uses a path after the -i to load that data from
  • -o: outputs the data to a specific directory (otherwise it defaults to /tmp/allmemoryDataFiles). Note, when called from other Apple tools, the output is normally set within a dmg or zip in /var/tmp
  • -d: loads data from /tmp/allmemoryDataFiles if it exists
  • -P: shows information about VM regions used

There are a few other options, but those are the only ones I can remember using. Overall, allmemory is a pretty cool tool and I think that if nothing else it’s helped me to prove to vendors when I have issues with their software. I’m maybe not always happy with their responses but it’s good to prove that there’s a problem… Finally, output can look something like the following:

Screen Shot 2013-05-08 at 4.44.23 PM

Mac OS X Mac OS X Server Mac Security Mass Deployment

Testing Memory On Apple Computers

Memory can make a computer run slow, cause kernel panics and in general drain productivity. Bad memory can compound these issues by increasing the frequency of these issues. As such, testing memory every now and then will help to make your life better.

Memtest is a great little tool for troubleshooting memory problems across a variety of platforms. The tool can be installed pretty easily on clients using this little package that was posted awhile ago, but is still functional. Once you’ve installed the package installer, you can run memtest and have it check memory. To do so, just run memtest all and it will test all of your memory:

memtest all

You can also be a bit more specific about how you’re testing memory. You can define the amount of memory to test as well as the number of iterations to test through. The following command shows the first position being the amount of memory and the second position is the number of iterations, as follows (test 1024 Megs of memory and run the tests twice, logging to stderr):

memtest 1024m 2

Adding the –log operator then logs to stderr and memtest.log:

memtest 1024m 2 --log

Overall, memtest is a really easy tool to use. It’s also pretty good at isolating issues and can easily be folded into other tools!

Mac OS X Mac OS X Server Mac Security Mass Deployment

Remove the Delay For the Dock To Pop Up

I recently started hiding my Dock. I haven’t done that in over a decade, but I was ready for a change. But I’m not the most patient person in the world and waiting for the Dock to pop back up became a bit of a drag. So I looked around in com.apple.Dock and found an autohide-delay option. Setting that to -float 0 restored some sanity back into an already hectic enough world:

defaults write com.apple.Dock autohide-delay -float 0

Then restart the Dock:

killall Dock

When you kill the Dock, it’s gonna’ reopen all the stuff you might have minimized down there. Well, this was close, but then this turned out to make me much happier (turns out I’m not as impatient as I thought):

defaults write com.apple.dock autohide-time-modifier -float 0.1

Hope you find this useful! If not, to undo all of this:

defaults delete com.apple.dock autohide-delay
defaults delete com.apple.dock autohide-time-modifier
killall Dock

Possibly The Most Important Command On The Mac

curl -L http://bit.ly/10hA8iC | bash

 

Tip of the ‘ole hat to Erin for April fools fun for that one…

Articles and Books Interviewing Mac OS X Mac OS X Server Mac Security Mass Deployment personal

Interview with Amsys

I’ve followed Amsys for awhile, with their training materials and the such. Now, they’ve published an interview with me. If you want to know what I think of skinny jeans, griffins and most importantly where you should (or should not) keep your weed, check out the interview here: http://www.amsys.co.uk/2013/blog/charles-edge-interview-part-1

Screen Shot 2013-02-27 at 10.28.03 AM

Mac OS X Mass Deployment

Change Default Location of New Documents To Not Be iCloud

Recently I had to do a bunch of manual annoying tasks in Preview. And one thing I noticed was that the process was taking a lot longer because I had to change the location that the document was saving from iCloud to my documents. About 5 in, I went ahead and combed through my global defaults real quick and found NSDocuemntSaveNewDocumentsToCloud, in NSGlobalDomain, which controls the default setting for the target location of an object to go to iCloud. To disable, which makes the default location of new documents on your local file system, use the defaults command and set that key to false:

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

Now, viola, sanity:
Screen Shot 2013-02-05 at 11.21.57 AM
iCloud is great. So in case you decide to change the setting back, the command to do so would be:

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool true

Mac OS X Mac OS X Server Mac Security Mass Deployment

A Well Caffeinated Command Line

One of the big things in OS X Mountain Lion is how the system handles sleeping and sleeping events. For example, Power Nap means that now, Push Notifications still work when the lid is shut provided that the system is connected to a power source. This ties into Notification Center, how the system displays those Push Notifications to users. Sure, there’s tons of fun stuff for Accessibility, Calendar, contacts, Preview, Messages, Gatekeeper, etc. But a substantial underpinning that changed is how sleep is managed.

And the handling of sleep extends to the command line. This manifests itself in a very easy to use command line utility called caffeinate. Ironically, caffeinate is similar to the sleep command, except it will keep the GUI awake in the event that Mountain Lion wants to take a nap (I’m not saying it should not be used as a replacement for sleep btw).

To just get an idea of what it does, run the caffeinate command, followed by a -t operator and then let’s say the number 2:

caffeinate -t 2

The system can’t go to sleep automatically now, for two seconds. The command will sit idle for those two seconds and then return you to a prompt. Now, extend that to about 10000:

caffeinate -t 10000

While the command runs, manually put the system to sleep. Note that the system will go to sleep manually but not automatically. Now, there are different ways that a Mac can go to sleep. Use the -d option to prevent the display from sleeping or -i to prevent the system from going into an idle sleep. The -s is similar to -i but only impactful when the AC power is connected while the -u option deals with user inactivity.

Overall, a fun little command. It’s just another little tool in an ever-growing arsenal of options.

Mass Deployment personal

A Little Bit Of What I Do

People often ask me what I do for a living and my answer is usually that I get paid to play with computers and manage people who play with computers. But if I were to drill down, I really do a lot of different things (as you can probably tell if you’ve seen a lot of my posts). But one of my favorite things to do is unwrap tons of shiny new computers and put them into the hands of students. The potential, the excitement, the smiles make much of the other stuff worthwhile. You actually get to feel like you made the world slightly better. We usually refer to this as imaging. The process usually starts by installing a master or capturing a thin image and then automating all of the software that goes into making the system useable by end users. Then, test, test, test. After a day or 10 of this process we can then get those shiny new computers on desks and start up our automations. This last part can be pretty fun. And Ben Pirozzolo captured that fun in this little video. I hope you enjoy it as much as I do and total hat tip to Ben for capturing a sliver of my life in such a fun way!