Middlebury

Difference between revisions of "Advanced Mac Configuration Topics"

m (Advanced Topics moved to Advanced Configuration Topics: "Advanced Topics" too general, this name applies to the entire wiki.)
m
Line 1: Line 1:
[[Category:Software Distribution]]
+
<br>
[[Category:Advanced Topics]]
 
  
==Reimage a mac from an image using the command line asr==
+
== Reimage a mac from an image using the command line asr ==
<pre>sudo asr restore --source /Volumes/Source/Image.dmg --target /Volumes/Destination --erase --noverify</pre>
+
<pre>sudo asr restore --source /Volumes/Source/Image.dmg --target /Volumes/Destination --erase --noverify</pre>  
Note: This '''ERASES''' the destination drive. It also skips verification (which Disk Utility forces you to do, thus adding 10-15 minutes to the imaging process). Verification is GOOD, but sometimes, when you're sure that the image is healthy and your destination drive is healthy, it can be a waste of time.
+
Note: This '''ERASES''' the destination drive. It also skips verification (which Disk Utility forces you to do, thus adding 10-15 minutes to the imaging process). Verification is GOOD, but sometimes, when you're sure that the image is healthy and your destination drive is healthy, it can be a waste of time.  
  
==Refresh disk arbitration==
+
== Refresh disk arbitration ==
Note: This may force disks that haven't mounted to mount.
 
<pre>
 
disktool -r
 
</pre>
 
  
==Pushing Adobe CS via ARD==
+
Note: This may force disks that haven't mounted to mount.
'''Note: This assumes you've created a disk image with the applications (from /Applications), and a disk image with the settings (in /Library/Application Support, as well as /Library/Preferences).'''
+
<pre>disktool -r
 +
</pre>
 +
== Pushing Adobe CS via ARD ==
  
<pre>
+
'''Note: This assumes you've created a disk image with the applications (from /Applications), and a disk image with the settings (in /Library/Application Support, as well as /Library/Preferences).'''
hdiutil attach /adobepro.dmg
+
<pre>hdiutil attach /adobepro.dmg
 
ditto -V /Volumes/adobepro /Applications
 
ditto -V /Volumes/adobepro /Applications
 
hdiutil detach /Volumes/adobepro
 
hdiutil detach /Volumes/adobepro
Line 25: Line 22:
 
hdiutil detach /Volumes/settings
 
hdiutil detach /Volumes/settings
 
rm -rdfv /settings.dmg
 
rm -rdfv /settings.dmg
</pre>
+
</pre>  
 +
== Mute or set volume via ARD ==
 +
<pre>osascript -e "set volume 0"
 +
</pre>
 +
Change the zero to another number to set the volume to a higher value. Zero is mute. This seems to be system wide. It also mutes the startup chime. Good for classrooms. If headphones are plugged in, they have a separate volume setting.
  
==Mute or set volume via ARD==
+
== Make Macs Speak via ARD ==
<pre>
+
<pre>say "I hate Macs"
osascript -e "set volume 0"
+
</pre>  
</pre>
+
== Set the Open Firmware password via ARD ==
Change the zero to another number to set the volume to a higher value. Zero is mute. This seems to be system wide. It also mutes the startup chime. Good for classrooms. If headphones are plugged in, they have a separate volume setting.
 
  
==Make Macs Speak via ARD==
+
'''Note: You need our Open Firmware package for this! It should be on our Mac server.'''  
<pre>
+
<pre>sudo ofpassword set blahblah123</pre>  
say "I hate Macs"
+
== Connect to an AFP server from the command line ==
</pre>
+
<pre>sudo mkdir /Volumes/myserver
 
 
==Set the Open Firmware password via ARD==
 
'''Note: You need our Open Firmware package for this! It should be on our Mac server.'''
 
<pre>sudo ofpassword set blahblah123</pre>
 
 
 
==Connect to an AFP server from the command line==
 
<pre>
 
sudo mkdir /Volumes/myserver
 
 
sudo mount_afp afp://username:password@servername/sharename /Volumes/myserver
 
sudo mount_afp afp://username:password@servername/sharename /Volumes/myserver
</pre>
+
</pre>  
 +
== Run an ASR server ==
  
==Run an ASR server==
+
GUI: Protonpack
GUI: Protonpack
+
<pre>sudo asr -source /Volumes/Images/image.dmg -server /path/to/config.plist
 +
</pre>
 +
== Restore a client from an ASR server ==
  
<pre>
+
GUI: NetRestore
sudo asr -source /Volumes/Images/image.dmg -server /path/to/config.plist
+
<pre>sudo asr -source asr://serverip -targer /Volumes/Volume -erase -noverify
</pre>
+
</pre>  
 +
== Enable ARD remotely ==
  
==Restore a client from an ASR server==
+
e.g. via SSH
GUI: NetRestore
+
<pre>sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -users admin -privs -all
<pre>
+
</pre>  
sudo asr -source asr://serverip -targer /Volumes/Volume -erase -noverify
+
If nothing's been enabled, the full line should look like: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu
</pre>
 
  
==Enable ARD remotely==
+
== Update Symantec AntiVirus ==
e.g. via SSH
+
<pre>LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
<pre>
+
</pre>  
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -users admin -privs -all
+
LiveUpdate tends to be in the root library support folder: /Library/Application\ Support/Norton\ Solutions\ Support/LiveUpdate/LiveUpdate.app/Contents/MacOS/LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
</pre>
 
  
If nothing's been enabled, the full line should look like:
+
== Enable Journaling ==
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu
+
<pre>diskutil enableJournal /</pre>
 +
== Printers: Install, delete, set as default ==
  
==Update Symantec AntiVirus==
+
'''List installed printers'''
 
<pre>
 
<pre>
LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
+
lpstat -p
 
</pre>
 
</pre>
LiveUpdate tends to be in the root library support folder:
 
/Library/Application\ Support/Norton\ Solutions\ Support/LiveUpdate/LiveUpdate.app/Contents/MacOS/LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES
 
  
==Enable Journaling==
+
'''Install'''
<pre>diskutil enableJournal /</pre>
+
<pre>lpadmin -p printer_name -E -v lpd://server/printer -P path-to-ppd.gz</pre>  
 +
*An example with a compressed ppd:
  
==Printers: Install, delete, set as default==
+
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.gz  
'''Install'''
 
<pre>lpadmin -p printer_name -E -v lpd://server/printer -P path-to-ppd.gz</pre>
 
* An example with a compressed ppd:
 
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.gz
 
  
* Or an uncompressed ppd:
+
*Or an uncompressed ppd:
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.ppd
 
  
'''Must be followed by'''
+
lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.ppd
<pre>cupsenable printer_name</pre>
 
  
'''Delete'''
+
'''Must be followed by'''
<pre>lpadmin -x printer_name</pre>
+
<pre>cupsenable printer_name</pre>
e.g.:
+
'''Delete'''  
<pre>lpadmin -x AdobePDF7</pre>
+
<pre>lpadmin -x printer_name</pre>  
 +
e.g.:  
 +
<pre>lpadmin -x AdobePDF7</pre>  
 +
'''Set as default'''
 +
<pre>lpadmin -d printer_name</pre>
 +
'''Install but disable sharing and add description'''
 +
<pre>lpadmin -p printer_name -E -v lpd://server/printer -D "Room AB123" -P ppdpath -o printer-is-shared=false</pre>
 +
=== Enabling Duplexing ===
  
'''Set as default'''
+
On HP printers this should suffice:  
<pre>lpadmin -d printer_name</pre>
+
<pre>lpadmin -p prntr -E -v lpd://srv/prnt -D "rmnr" -P "ppdpath" -o "HPOption_Duplexer=True" -o Duplex=DuplexNoTumble</pre>  
 
+
On other models you can try listing the available printer options, then pass the appropriate option to lpadmin using the "-o" parameter. To list all available printer options, install the printer on any one workstation and then run:
'''Install but disable sharing and add description'''
+
<pre>lpoptions -p printer_name -l</pre>
<pre>lpadmin -p printer_name -E -v lpd://server/printer -D "Room AB123" -P ppdpath -o printer-is-shared=false</pre>
+
For an HP laserjet the above command gives two options related to duplexing: '''HPOption_Duplexer''' and '''Duplex''' -- so those are the parameters passed using "-o" in the example above.
 
 
===Enabling Duplexing===
 
On HP printers this should suffice:
 
<pre>
 
lpadmin -p prntr -E -v lpd://srv/prnt -D "rmnr" -P "ppdpath" -o "HPOption_Duplexer=True" -o Duplex=DuplexNoTumble</pre>
 
  
On other models you can try listing the available printer options, then pass the appropriate option to lpadmin using the "-o" parameter. To list all available printer options, install the printer on any one workstation and then run:
+
== Desirable ARD commands ==
<pre>lpoptions -p printer_name -l</pre>
 
  
For an HP laserjet the above command gives two options related to duplexing: '''HPOption_Duplexer''' and '''Duplex''' -- so those are the parameters passed using "-o" in the example above.
+
*Set disk permissions. Ignore permissions.
 +
*Add ACLS for folders
 +
*Run login permission script
 +
*unbind/rename/rebind/rescan/apply proper admin privs.
 +
*login items fix
  
==Desirable ARD commands==
+
[[Category:Software_Distribution]] [[Category:Advanced_Topics]]
* Set disk permissions. Ignore permissions.
 
* Add ACLS for folders
 
* Run login permission script
 
* unbind/rename/rebind/rescan/apply proper admin privs.
 
* login items fix
 

Revision as of 15:59, 7 November 2008


Reimage a mac from an image using the command line asr

sudo asr restore --source /Volumes/Source/Image.dmg --target /Volumes/Destination --erase --noverify

Note: This ERASES the destination drive. It also skips verification (which Disk Utility forces you to do, thus adding 10-15 minutes to the imaging process). Verification is GOOD, but sometimes, when you're sure that the image is healthy and your destination drive is healthy, it can be a waste of time.

Refresh disk arbitration

Note: This may force disks that haven't mounted to mount.

disktool -r

Pushing Adobe CS via ARD

Note: This assumes you've created a disk image with the applications (from /Applications), and a disk image with the settings (in /Library/Application Support, as well as /Library/Preferences).

hdiutil attach /adobepro.dmg
ditto -V /Volumes/adobepro /Applications
hdiutil detach /Volumes/adobepro
rm -rdfv /adobepro.dmg

hdiutil attach /settings.dmg
ditto -V /Volumes/settings /Library
hdiutil detach /Volumes/settings
rm -rdfv /settings.dmg

Mute or set volume via ARD

osascript -e "set volume 0"

Change the zero to another number to set the volume to a higher value. Zero is mute. This seems to be system wide. It also mutes the startup chime. Good for classrooms. If headphones are plugged in, they have a separate volume setting.

Make Macs Speak via ARD

say "I hate Macs"

Set the Open Firmware password via ARD

Note: You need our Open Firmware package for this! It should be on our Mac server.

sudo ofpassword set blahblah123

Connect to an AFP server from the command line

sudo mkdir /Volumes/myserver
sudo mount_afp afp://username:password@servername/sharename /Volumes/myserver

Run an ASR server

GUI: Protonpack

sudo asr -source /Volumes/Images/image.dmg -server /path/to/config.plist

Restore a client from an ASR server

GUI: NetRestore

sudo asr -source asr://serverip -targer /Volumes/Volume -erase -noverify

Enable ARD remotely

e.g. via SSH

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -users admin -privs -all

If nothing's been enabled, the full line should look like: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu

Update Symantec AntiVirus

LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES

LiveUpdate tends to be in the root library support folder: /Library/Application\ Support/Norton\ Solutions\ Support/LiveUpdate/LiveUpdate.app/Contents/MacOS/LiveUpdate -update LUal -liveupdatequiet YES -liveupdateautoquit YES

Enable Journaling

diskutil enableJournal /

Printers: Install, delete, set as default

List installed printers

 lpstat -p

Install

lpadmin -p printer_name -E -v lpd://server/printer -P path-to-ppd.gz
  • An example with a compressed ppd:

lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.gz

  • Or an uncompressed ppd:

lpadmin -p printer_name -E -v lpd://server/printer -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4050\ Series.ppd

Must be followed by

cupsenable printer_name

Delete

lpadmin -x printer_name

e.g.:

lpadmin -x AdobePDF7

Set as default

lpadmin -d printer_name

Install but disable sharing and add description

lpadmin -p printer_name -E -v lpd://server/printer -D "Room AB123" -P ppdpath -o printer-is-shared=false

Enabling Duplexing

On HP printers this should suffice:

lpadmin -p prntr -E -v lpd://srv/prnt -D "rmnr" -P "ppdpath" -o "HPOption_Duplexer=True" -o Duplex=DuplexNoTumble

On other models you can try listing the available printer options, then pass the appropriate option to lpadmin using the "-o" parameter. To list all available printer options, install the printer on any one workstation and then run:

lpoptions -p printer_name -l

For an HP laserjet the above command gives two options related to duplexing: HPOption_Duplexer and Duplex -- so those are the parameters passed using "-o" in the example above.

Desirable ARD commands

  • Set disk permissions. Ignore permissions.
  • Add ACLS for folders
  • Run login permission script
  • unbind/rename/rebind/rescan/apply proper admin privs.
  • login items fix
Powered by MediaWiki