Skip to main content

Posts

Showing posts from April, 2012

Connect to Cisco Console Serial Port via Mac OS X

I prefer not to have to download apps when an OS has a native option. To connect to a console from Mac OS X simply use;

/usr/bin/screen /dev/YOURTTYDEVICE 9600
If you want to log all input/output to a log file (as you should when connecting to switches/routers/firewalls) simply use the script command as follows;
/usr/bin/script /PATHTOFILE
Optionally, configure terminal to always log sessions by editing the app preferences, go to the shell options and you should have an option to run a command on startup. My command reads as;
/usr/bin/script ~/Desktop/Terminal.log

Mac OS X "SOE" continued (adding applescript utilities)

Adding some applescripts GUI wrappers to some shell script utilities for my end users. Here is a applescript snippet showing how I place the shell script inside the app bundle and reference it (so my .app can be self contained).

set script to alias ((path to me) & "Contents:Resources:MYSCRIPT.sh" as string) set scriptPOSIX to POSIX path of script do shell script ("sudo chmod 755 '" & scriptPOSIX & "'") user name theSudoUser password theSudoPassword with administrator privileges do shell script ("sudo '" & scriptPOSIX & "'") user name theSudoUser password theSudoPassword with administrator privileges

Mac OS X "SOE" continued

Testing this at the moment, 10.7.x changed the location that server favorites are stored. They used to be .inetloc files in ~/Library/Favorites but now they are stored in a plist array in ~/Library/Preferences/com.apple.sidebarlists.plist

Note though, you can actually add inetloc files into your User Template folder and new users will get them, they just don't get stored as files now when users are manually creating them.
#* Default user preferences. #+ Add default server favorites in "Connect to Server" for USER_TEMPLATE in `sudo ls /System/Library/User\ Template` do if [ -r "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences" ]; then sudo /usr/libexec/PlistBuddy -c 'Add favoriteservers dict' "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.sidebarlists.plist" sudo /usr/libexec/PlistBuddy -c 'Add favoriteservers:Controller string CustomListItems' "/System/Library/User Template/${…

Deploy PKGs Silently

Just getting ready to roll my Mac Office 2011 silent installer. Run the following the check for choices.

installer -package "Office Installer.mpkg" -showChoicesXML | grep -A 1 choiceIdentifier > /PATHTOCHOICES/mychoices.xml
(Creating the Choices file is as simple as including the desired choiceIdentifiers in an array in an XML file).

Verify the choices:installer -package "Office Installer.mpkg" -showChoicesAfterApplyingChangesXML /PATHTOCHOICES/mychoices.xmlApplying the choices is as simple as:installer -package "/Office Installer.mpkg" -target / -applyChoiceChangesXML /PATHTOCHOICES/mychoices.xml

Mac OS X "SOE" continued

A few more snippets I am considering adding to my build.sh script. The build script loops the User Templates...tested today, they all work. Just trying to decide whether one size fits all ;) (will definitely add the dock changes, way faster!)

#* Default user preferences. for USER_TEMPLATE in `sudo ls /System/Library/User\ Template` do if [ -r "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences" ]; then #+ Menu bar transparency disabled sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/.GlobalPreferences" AppleEnableMenuBarTransparency -bool FALSE #+ Battery MenuExtra Settings sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.menuextra.battery" ShowPercent -string "NO" sudo /usr/bin/defaults write "/System/Library/User Template/${USER_TEMPLATE}/Library/Preferences/com.apple.menuextra.battery" ShowTime -strin…

Mac OS X "SOE" Day 7 (continued)

Adding this to my build.sh script. I personally don't like the quick look feature, and I'm tired of having to clean end users caches.
#* Disable Quicklook and avoid the 100% CPU utilisation bug #+ You could simply delete /Users/USER/Library/Caches/com.apple.QuickLookDaemon but that's annoying sudo /usr/bin/defaults write "/System/Library/LaunchAgents/com.apple.quicklook" Disabled -bool true

Mac OS X "SOE" Day 7 (continued)

Considering switching from ADMitMac to Native AD plugin for some users.

#* Bind AD using built-in AD Plugin #+ Unbind logger "POSTBUILD PHASE : Unbind Native AD." sudo /usr/sbin/dsconfigad -remove -u ${USERNAME} -p ${PASSWORD} -force #+ Bind logger "POSTBUILD PHASE : Bind ${workstation} to ${OU}" sudo /usr/sbin/dsconfigad -f -a ${workstation} -domain ${DOMAIN}.COM -u ${USERNAME} -p ${PASSWORD} -ou ${OU} #+ Configure logger "POSTBUILD PHASE : Configure Native AD." sudo /usr/bin/dscl /Search -create / SearchPolicy CSPSearchPath sudo /usr/bin/dscl /Search -append / CSPSearchPath "/Active Directory/${DOMAIN}/All Domains" sudo /usr/bin/dscl /Search/Contacts -create / SearchPolicy CSPSearchPath sudo /usr/bin/dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/${DOMAIN}/All Domains" sudo /usr/sbin/dsconfigad ${options} sudo /usr/sbin/dsconfigad -groups "${groups}" if [ "${preferreddc}" != "" ]; then …

Mac OS X "SOE" Day 7 (continued)

Squeeze a little more juice out of your OS?

#* Reduce GUI animations, maybe speed things up a bit ;) #* Disable individual animations? #/usr/bin/defaults write com.apple.finder 'AnimateInfoPanes' -bool false #/usr/bin/defaults write com.apple.finder 'AnimateWindowZoom' -bool false #/usr/bin/defaults write com.apple.finder 'ZoomRects' -bool false #* Disable all UI animations. /usr/bin/defaults write com.apple.finder 'DisableAllAnimations' -bool true

Adding this into my build.sh phase 1 User Template loop.... every bit counts.

Mac OS X "SOE" Day 7

Page Redirection> continued from day 6...

In summary, here is my method for creating a Mac OS X 10.7.3 Standard Operating Environment "SOE" Image.


Overview The goal is to create a "MASTER" non-booted SOE that can be used with multiple models and it multiple sites with different local requirements.

My intention is to use this "MASTER" image in a manual restore procedure due to the fact netboot facilities cannot be made available to all the sites I support however the DMG files are netboot compatible.

RequirementsLion Recovery Disk Assistant v1.0"TARGET" workstation. A compatible workstation that will be used to install Mac OS X 10.7.3 and capture a DMG image(s)."ADMIN" workstation. A workstation with Disk Utility that you will use to capture your DMG image(s).External storage such as a USB HARD DISK. SetupDownloaded the Lion Recovery Disk Assistant v1.0 and followed the instructions to setup an external Recovery D…