Mac OS X

From Secure Computing Wiki
Revision as of 08:59, 30 September 2011 by Ecrist (Talk | contribs) (External Links)

Jump to: navigation, search

Creating ISO Images

Networking

Security

Octoshape

You can remove the Mac OS X version of Octoshape, (Article at Windows Secrets), by running the following command:

sudo rm -r /Users/*/Library/Preferences/Macromedia/Flash Player/www.macromedia.com/bin/octoshape

This will remove the program for all users on the system. To remove it for a specific user, replace the asterisk with the user name.

Terminal

Key Re-Mappings

Remap the following keys: Terminal.app + Preferences: The following key mappings added to terminal are necessary if you want to get any real work done:

Page Up:  [esc][5~
Page Down: [esc][6~
Home: [esc][1~
End: [esc][4~

Note: [esc] shows up as \033.

User Management

Flush DNS Cache

Pre Leopard: sudo lookupd -flushcache

Post Leopard: dscacheutil -flushcache

Configure the Network from the CLI

You can configure your network interfaces from the command line using the networksetup tool. This isn't quite the Unix way to do things, but I'm hoping Apple gets there eventually.

This allows you to change all(most?) of the settings you would find in the network preference pane. To permanently change the static IP address of a given system, run the following command:

# networksetup -listallnetworkservices

This command will list all your network ports. Why you have to call them by their name escapes me, but whatver.

Next, run the following command:

# networksetup -setmanual <network_service> <new_ip> <new_mask> <default_router>

The only funk above is the network_service item. This is really just the network adapter's name. So, to set an IP of 10.0.0.2 with a subnet of 255.0.0.0 and a default route of 10.0.0.1 on my MacBook Pro's ethernet address, I'd do the following:

# networksetup -setmanual Ethernet 10.0.0.2 255.0.0.0 10.0.0.1

Note, you've gotta be root (or sudo it).

This **WILL** persist through reboots.

Force Safari to Reload Cached Webpage

  1. Alt/Option + Click Reload Button
  2. Ctrl + Cmd + R

Leopard Tricks & Hints

So, it appears that there a lot of new looks in Leopard that people don't really like. I'm going to try and consolidate all of those here, with a fix for each. Please feel free to contribute!

Change Screen-Capture Save Location

defaults write com.apple.screencapture location /Users/YOURUSERNAME/Documents/Screenshots

Disable Transparent Menu Bar

To disable, simply type the following at a prompt in terminal:

defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 1

Time Machine to Network Shares

To use time machine over a network share, simply open up a terminal window and type the following command, exactly as shown:

defaults com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Now, when you have a network share mounted, you should see it as an option in the Time Machine setup options.

Time Machine Backup Interval

  • sudo defaults write /System/Library/LaunchDaemons/ com.apple.backupd-auto StartInterval -int 3600

Change 3600 to the new interval, in seconds.

Dock Glass/3D Undo

If you hate the new 3D crap that Apple has bestowed upon the dock, you can disable it and get, what I would term as, a pretty darn good compromise. Simply open your terminal and type the following commands:

# defaults write com.apple.dock no-glass -boolean YES
# killall Dock

Alternatively, you can put your dock on the side, and automatically get this new appearance.

Replace Dock Glowing Dots

http://www.silvermac.com/2007/leopard-dock-with-black-triangle/

Get Round Corners

Original trick here: http://www.manytricks.com/displaperture/

  1. Download Displaperture 1.0.

Change Background Image at Startup

To change the startup background image, simply replace the JPG file at /System/Library/CoreServices/DefaultDesktop.jpg.

Lock the Dock

There are multiple ways to lock the Dock in OS X Leopard. The first is to enable Parental controls on a given account, where you can enable/disable the ability of the user to 'Modify the Dock.' This requires a user not being an administrator, which can be a drag if you just want to keep from accidental deletions.

Method 1

The quickest method is to run the following command as the user who wants their dock locked:

defaults write com.apple.dock contents-immutable -bool true

To make this apply, restart the dock with the following command:

osascript -e 'tell application "Dock" to quit'

To unlock the dock again, run the same command as above, replacing true with false:

defaults write com.apple.dock contents-immutable -bool false

You'll need to run the command above to restart the dock for changes to take affect.

Method 2

If you've got a directory server, or are running the Server edition of Mac OS X, you can simply enable the dock locking feature in account preferences within the control panel.

Method 3

Use the dock locking application someone posted to a forum somewhere. Here's a compiled version: Dock Lock.app

Lion Tricks/Hints

DNS Search Domains

The retards engineers at Apple have decided, for some unknown reason, to disable the appending of search domains for all lookups, by default. Fortunately, the fix is easy, and should be permanent.

First, edit /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist in your favorite editor. This needs to be edited as the root user due to permissions. Within that file, find the following string:

<string>/usr/sbin/mDNSResponder</string>
<string>-launchd</string>

Insert the line below, so it appears as shown:

<string>/usr/sbin/mDNSResponder</string>
<string>-AlwaysAppendSearchDomains</string>
<string>-launchd</string>

Next, you need to either restart your machine, or from a terminal, run the following commands:

ecrist@swordfish:~-> sudo launchctl
launchd% unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
launchd% load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
launchd% exit

Now, you should be able to access things using your short DNS name, and following the order and entry of your search domains.

References:

HP Printers/All-In-Ones

HP Network Scanning

Screen Savers

Click on the link below the thumbnail to download the screen saver.

Remote Control

Mac OS X has a pre-installed VNC application called Screen Sharing. You can use this application to connect to any machine running a VNC server.

To send Control-Alt-Delete to a windows machine, press Control-Alt-Command-Delete on your Mac. On my MacBook Pro, I had to add the Fn key, as well.

External Links

  1. http://techzinger.blogspot.com/2011/08/apple-osx-lion-search-domains-fix.html
  2. http://forums.macrumors.com/showthread.php?p=13035618#post13035618