static routes in MacOS X howto

Sometimes we need to add permanently static routes, we can do that in this way

cd /Library/StartupItems

vi AddRoutes


#!/bin/sh

# Set static routing tables

. /etc/rc.common

StartService ()
{
sleep 10
ConsoleMessage "Adding Static Routing Table"

sudo /sbin/route add -net 192.168.101.0 -netmask 255.255.255.0 -gateway 192.168.101.1
sudo /sbin/route add -net 192.168.102.0 -netmask 255.255.255.0 -gateway 192.168.102.1
}

StopService ()
{
return 0
}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService "$1"

vi StartupParameters.plist

{
Description = "Add static routing tables";
Provides = ("AddRoutes");
Requires = ("Network");
OrderPreference = "None";
}

chmod 755 AddRoutes
chmod 755 StartupParameters.plist

make bootable usb flash drive with linux in MacOS X

bash-3.2# hdiutil convert -format UDRW -o Debian7live.img debian-live-7.0.0-i386-standard.iso
Reading Master Boot Record (MBR : 0)…
Reading Debian wheezy 20130505-06:54 (Apple_ISO : 1)…
Reading (Windows_NTFS_Hidden : 2)…
...........................................................................................................................................................................................................................
Elapsed Time: 4.551s
Speed: 118.2Mbytes/sec
Savings: 0.0%
created: /Users/bentoslack/Downloads/Debian7live.img.dmg

bash-3.2# mv Debian7live.img.dmg Debian7live.img

bash-3.2# diskutil list
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.8 GB disk4
1: DOS_FAT_32 UNTITLED 1 15.8 GB disk4s1

bash-3.2# diskutil unmountDisk /dev/disk4
Unmount of all volumes on disk4 was successful

bash-3.2# dd if=Debian7live.img of=/dev/disk4 bs=1m
538+0 records in
538+0 records out
564133888 bytes transferred in 105.770259 secs (5333578 bytes/sec)

bash-3.2# hdiutil eject /dev/disk4
"disk4" unmounted.
"disk4" ejected.
bash-3.2#

Mac OS X startup key combinations

Boot key combinations:

  • C : Forces most Macs to boot from the CD-Rom drive instead of the internal hard drive. Only works with Apple ROM drives and with bootable CD discs.
  • D : Forces the first internal hard drive to be the startup disk.
  • N : Netboot (New World ROM machines only) – Looks for BOOTP or TFTP Server on the network to boot from.
  • R : Forces PowerBooks to reset their screen to default size (helpful if you’ve been hooked up to an external montior or projector!)
  • T : Target Disk Mode (FireWire) – Puts machines with built-in FireWire into target Disk mode so a system attached with a FireWire cable will have that device show up as a hard drive on their system. Very useful for PowerBooks!
  • Mouse Button Held Down : Ejects any mounted removable media.
  • Shift : Disables all extensions (Mac OS 7-9), or disables Login items when using Mac OS X 10.1.3 or later. Also works when booting Classic mode up just like you were using the OS natively.
  • Option : When using an Open Firmware “New World ROM” capable system, the System Picker will appear and query all mounted devices for bootable systems, returning a list of drives & what OS they have on them. On “Old World” systems the machine will simply boot into it’s default OS without any Finder windows open.
  • Space bar : Brings up Apple’s Extension Manager (or Casady & Greene’s Conflict Catcher, if installed) up at startup to allow you to modify your extension set.
  • Command-V : Boots Mac OS X into “Verbose Mode”, reporting every console message generated during startup. Really shows what’s going on behind the scenes with your machine on startup!
  • Command-S : Boots Mac OS X into “Single User Mode” – helpful to fix problems with Mac OS X, if necessary.
  • Command-Option : Rebuilds the Desktop (Mac OS 7-9).
  • Command-Option-P-R : Erases PRAM if held down immediately after startup tone. Your machine will chime when it’s erased the PRAM, most people will hold this combination for a total of 3 chimes to really flush the PRAM out.
  • Command-Option-N-V : Erases NVRAM (Non-Volatile RAM). Used with later Power Macintosh systems mostly.
  • Command-Option-O-F : Boots the machine into Open Firmware (New World ROM systems only).
  • Command-Option-Shift-Delete : Forces your Mac to startup from its internal CD-ROM drive or an external hard drive. Very helpful if you have a 3rd party CD-ROM drive that is not an Apple ROM device.
  • Command-Option-Shift-Delete-#(where #= a SCSI DEVICE ID) : Boot from a specific SCSI device, if you have your 3rd party CD-ROM drive set to SCSI ID 3, you would press “3” as the # in the combination.
  • Command-Option-I : Forces the Mac to read the disc as an ISO-9000 formatted disk
  • Command : Boots with Virtual Memory turned off.
  • Command-Option-T-V : Forces Quadra AV machines to use TV as a monitor.
  • Command-Option-X-O : Forces the Mac Classic to boot from ROM.
  • Command-Option-A-V : Forces an AV monitor to be recognized correctly.