Rebooting:
-
Hold
down the C key at startup to boot from a CD.
-
Hold
down the T key at startup to boot current Mac as a firewire drive on
another Mac. Called “Firewire Target Disk Mode”.
-
Command-S
boots into Single-User mode.
-
Command-V
boots into Verbose mode, displaying all startup text.
o
To be
verbose at every bootup: $ sudo nvram boot-args=”-v”
o
To
turn it off: $
sudo nvram boot-args=””
-
Hold
down the Shift key to boot into Safe Mode (or “Safe Boot”), suppressing all
non-basic Kernel extensions (“Kexts”), plus /System/Library/StartupItems. If
Journaling is not enabled, fsck will run. Journaling is enabled in the Disk
Utility. If Journaling is enabled, fsck should not be run, since they can
conflict.
o
Kernel
Extensions can cause conflicts. Command-drag stuff out of
System/Library/Extensions. Command-dragging moves a file to the Desktop,
whereas simple dragging just copies file to the Desktop.
-
Hold
down the Option key at boot to access the Startup manager, to select the OS.
-
Shift-Option-Command-Q
logs you out without prompting.
-
If the
Mac won’t boot, hold down the X key until you see the OSX logo, to boot from
the internal drive.
-
Zap
the Pram by holding down Command-Option-P-R at bootup until the Mac chimes 3
times.
-
You
can boot from the OSX Install-disk, launch Disk Utility, click “First Aid”,
then “Repair Permissions”.
-
You
can hold down the Shift key when logging into a user account, and wait for the
Desktop to appear, suppressing the Login items.
-
If the
Mac is set up to boot into your account automatically, hold down the Shift key
right after the bluescreen OSX logo appears. This will bypass Safe-boot and
force the Login window to appear, as opposed to bypassing it automatically,
like normal.
-
When
you boot up, you can enter
>console as the username and
no password, then hit the Login button. This logs in as text-only. Type
“reboot” or "exit" to re-enter the GUI.
- Create
a disk image of you entire hard disk with Applications/Utilities/Disk Utility.
- Good
Websites:
-
Apple
Discussions: http://discussions.info.apple.com/webx?macosx
-
Apple’s
Support Page: www.info.apple.com
-
macosxhints.com
-
macfixit.com
-
www.macworld.com/forums/ubbthreads/ubbthreads.php
-
http://developer.apple.com/internet/macosx/securityintro.html
-
OSX
has natd and dhcpd. You can download dhcpd from faisal.com
-
All
file-extensions are listed at webopedia.com/quick-ref/fileextensionsz.asp
-
macworld.com/subject/mac911
-
Sherlock
ver. 3 is distinct from the Finder’s “Find” command, being more of a Web
Services tool. www.sherlockers.com
- Tools:
-
Motion
Builder:
kaydara.com/promo/macworld.html
-
Sketchup: sketchup.com
-
You
can no longer add stuff to the Apple menu, but you can with “Classic Menu” at
sigsoftware.com
-
Windowshade
is gone, but try “WindowShadeX” (check Google)
-
You
can no longer print Finder windows. But you can drag a Finder window to the
Printer Setup Utility.Try “Print Window” from
swssoftware.com
-
Pacifist charlessoft.com
-
To
troubleshoot printing permissions problems, try “Printer Setup Repair” from
fixamac.net
-
Cisco’s
VPN Client is at
www.cisco.com/kobayashi/sw-center/vpn/client
-
Locate
some City generators…
-
Audio
Tools:
o
Amadeus www.hairersoft.com for
cleaning & recording LPs.
o
MP3
Rage www.chaoticsoftware.com An MP3 Swiss Army Knife.
-
Go to
www.macmame.org for MAME ROMs.
-
X-Plane www.x-plane.com
-
Expression www.creaturehouse.com
-
Genuine
Fractals Print www.lizardtech.com Scales low-res images to
high-res.
-
Pxl
SmartScale www.extensis.com
-
Image
Doctor www.alienskin.com
-
Mask
Pro www.extensis.com
-
MorphX www.norrkross.com
-
PhotoKit www.pixelgenius.com
-
QuickImage
CM www.pixture.com
-
Color
laser printer: Color LaserJet 2500 L
($1,000) by HP
-
Alepin www.macchampion.com Scrapbook/Notebook
replacement
-
BarWare
Deluxe www.digitalfriedchicken.com Mixed Drinks ($13)
-
PDFShrink www.apago.com PDF Optimizer.
-
The
Secrets of Retouching People www.photoshopvideos.com $40.00
-
Hair
Modeler: Change My Image www.infinisys.co.jp
-
Pixels
3D, IK at www.pixel3d.com
-
Zoom
& Pan www.virtix.com
-
TinkerTool
creates System Preference panes to obscure settings: www.bresink.de/osx/index.html
-
Most
applications create files in /Library/Preferences/*.plist and in
/Library/Application Support. Aladdin Systems’ tool “Spring Cleaning” can clean
these up after deleting apps.
-
ettercap: http://ettercap.sourceforge.net
-
A good
Open Source FTP/Terminal client is ncftp www.ncftp.com
o
Another
good one is Transmit http://panic.com
-
sftp
and scp are both encrypted versions of FTP
-
VNC:
Virtual Network Computer
o
Servers:
§
One is
called “vnc” on Fink.
§
Another
is called “OSXvnc” at www.osxvnc.com
o
Viewers:
§
One is
called “VNCViewer” at http://homepage.mac.com/kedoin/VNC/VNCViewer
§
Another
is called “VNCThing” at http://webthing.net/vncthing
-
VNCDimension www.mdimension.com/Community
- Other
browsers:
- iCab www.icab.de
- Mozilla www.mozilla.org
- Chimera http://chimera.mozdev.org This is a Cocoa port of Mozilla.
- OmniWeb http://omnigroup.com/applications/omniweb
- Opera www.opera.com/mac
- Lynx http://lynx.browser.org or www.osxgnu.org/software/Networking/lynx
- Links Where does this live?
Samba:
File-Sharing with Windows:
-
Turn
on Windows File Sharing to access your Mac from Windows (View:Accounts).
o
This
toggles the “disable” entry in
/etc/xinetd.d/nmbd which is the
NetBIOS name-server, for resolving Windows server names.
o
It
also does the same in
/etc/xinetd.d/smbd which is the
Windows File Sharing server itself.
-
With
Windows Sharing turned on in OSX, the shared Mac volume will appear in the
Windows “Network “Neighborhood” as “Samba 2.2.3a Christer”. Samba is the Unix
version of Windows’ SMB file-sharing protocol.
o
Microsoft’s
equivalent of AFP is SMB/CIFS (Server Message Block/Common Internet File
System)
-
Windows
updates “My Network Places” only once per session, so you may need to reboot
the PC to see the Mac. Look in View Workgroup Computers, Microsoft Windows
Network, then Workgroup.
-
OSX
only shows Windows servers and shares on the local subnet. To access other
subnets you need to use a URL, like this:
o
smb://Workgroup;ServerName/ShareName “ServerName” can also be an IP
address.
o
You
can also include your username and password in the URL. So these are the 2
possible options:
§
smb://10.1.240.55
§
smb://FFFC;CSwartz:password@10.1.240.55/Share$/ITD
-
By default,
enabling Windows Sharing only shares a user’s Home folders. This can be changed
by editing the Samba config file in /etc/smb.conf
o
[Applications]
path = /Applications
read only = yes
o
Check
all changes to Samba configs with %
testparm /etc/smb.conf prior to
using it.
o
Then
restart Samba with the new configs, without killing any active connections,
like this:
§
%
sudo killall –HUP smbd nmbd
o
Restarting
Windows File Sharing will terminate any active connections.
-
Samba
homepage: www.samba.org
-
Samba
can be configured via a Web interface (if installed) via http://localhost:901
o
Read
about it at http://it.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html
-
List
available shares from your host via % smbclient
–L yourhostname
-
Try
connecting from a PC with
o
C:\>
net use d: \\servername\service
o
C:\>
net use lpt1: \\servername\spoolservice
o
C:\>
print filename
-
Connecting
to an OS9 AFP server uses this format: afp:/at/ChooserName (“at” refers to AppleTalk)
-
For
some reason, SMB uses the usual 2 slashes in the URL, whereas AFP uses only one
slash.
-
SMB
uses the same TCP & UDP ports as NetBIOS: ports 137, 138, & 139.
Printing:
-
You
can create a Virtual Postscript Printer, for saving files as Postscript:
o
Open
Apps/Utilities/Printer Setup Utility
o
Under
“Printer List” select “Add”
o
Select
IP Printing and set Printer Type to LPD/LPR.
o
In the
field Printer Address type “localhost”.
o
In the
Printer Model menu select “Generic”, then click “Add”.
o
Now,
from any app print to the “localhost” printer, then choose “Output Options”
from the “Copies & Pages” menu, select “Save as File”, and in “Format”
select “Postscript”. Then save the file.
o
The
resulting Postscript file can be opened as a PDF file in the app Preview.
o
- To
convert a Postscript file to a PDF file use
% pstopdf filename.ps
- To convert a text file to Postscript use %
enscript –p <outputfile><filename>
- To convert and print immediately use %
enscript <filename>
-
The version of CUPS that ships with Panther can cause some LPD/LPR print jobs
to fail. A work-around can be found here:
www.macosxhints.com/article.php?story=2031118180912371
-
sds
-
You
can configure CUPS directly via
http://localhost:631
o
Edit
the file /etc/cups
o
You
can find documentation at www.cups.org
- If you connect a USB printer to an
Airport Extreme Basestation, the printer will show up in the Rendezvous
section.
- OSX’s
iCal application is similar to Windows’ Entourage, in that you can publish
calendars on any WebDAV-enabled servers.
- OSX’s
memory ceiling is 4 Terabytes.
- The Mac ROM is equivalent to the PC BIOS, except it’s permanent.
- Voice recognition is in the “Speech” System Preference panel.
- Uninstall apps in OSX by dragging apps out of the Applications folder to the
Trash.
- Enable
root access with Applications/Utilities/NetInfo Manager. Select the “Security”
menu, then “Enable Root”.
- Some
network settings can prevent a Mac from booting, such as “Connect Automatically
When Needed” in the PPP Options window. You need to delete
Library:Preferences:System Configuration:preferences.plist Boot up in Single-User mode, type “ mount
–uw / “ then type rm
/Library/Preferences/SystemConfiguration/preferences.plist Then type “reboot”.
- OSX
Preference files end with .plist. To delete an app’s Prefernce file, go to
Library:Preferences and type the app’s name in the Search window, which will
show you that app’s .plist files. Delete it, log out and back in, then launch
the app. (Also look in Library:Caches)
- Apps install stuff in Library/Receipts/*.pkg and also in Library/Application
Support
- Kernel
Panic: Though rare, they’re bad. A restart warning will appear in 4 languages.
Reboot, then look in Library/Logs for a file called “panic.log”. To diagnose,
check out the Apple Developer Technote at
http://developer.apple.com/technotes/tn2002/tn2063.html
- Don’t delete stuff in Library/Receipts. Disk Utility’s First Aid needs these.
- Gimp-Print is a default print driver, included with Panther.
Fonts:
-
Fonts
are stored in several places:
o
System/Library/Fonts These are used by the OS.
o
Library/Fonts These are available to all
users.
o
~/user/Library/Fonts These are available only to specific
users.
-
Fonts
are installed with the “Font Book” utility.
-
OSX
looks for fonts in this order:
o
The user’s
Fonts folder.
o
Root-level
fonts.
o
The
System’s Fonts folder.
o
OS9’s
Fonts folder.
o
OSX
doesn’t support bitmap fonts, only TrueType, OpenType, and PostScript Level 1
fonts.
o
OpenType
fonts are ….
- Common
WiFi Hotspot providers: Wayport, Surf and Sip, T-Mobile.
- Enable SSH in the “Sharing” System Preferences panel, then Remote Login.
- Create new groups in NetInfo Manager.
- OSX no longer uses Type and Creator codes, although it does recognize them.
Creator code is given priority. Only file-extensions are used now.
- OS 10.x uses the bash shell by default. You can change the shell with NetInfo
Manager. Open the padlock icon, select “users” and select your name. Find the
“shell” property and select the “Value” entry. Change /bin/bash to /bin/tcsh .
- TextEdit
can edit Microsoft Word files.
- The Login screen is located in
Library/Preferences/com.apple.loginwindow.plist Look for the first <dict> tag and add this below it:
<key>LoginWindowText</key> Add spaces to center the text. Save with
TextEdit’s “overwrite” option.
<string>Howdy!</string>
- You can
replace your Login Background with any JPEG or PDF file. Go to Library/Desktop
Pictures/AquaBlue.jpg The replacement file needs to have this same name.
- Command-Option-mouse dragging works in Finder windows like the spacebar in
Photoshop.
- openssl is a cryptography toolkit.
- You can
kill processes with Activity Monitor (called Process Viewer in Jaguar).
-
Expanded spell checking:
-
The
OSX version of the Open Source spellchecker Aspell is cocoAspell from www-ciir.cs.umass.edu/~leouski/cocoaspell
o
Put
the file “cocoaspell.service” into Library/Services. If the “Services” folder
doesn’t exist, create one.
o
Put
the folder “Spelling.prefPane” in Library/PreferencePanes. If the
“PreferncePanes” folder doesn’t exist, create one.
o
Log
out and back in again.
o
Open
the System Preference “Spelling” and enable your dictionary.
o
Log
out and back in again to enable cocoAspell.
o
In
Mail, open Edit/Spelling and select “Spelling”. Then select language.
- The
Finder’s “services” menu only works in apps written in Cocoa, like TextEdit and
Safari.
- You can delete a file by opening Terminal, typing “ rm –f “ then a space,
then drag the problem file on to the Terminal window, which will enter its full
path. Then hit Return. This works for “ rm –R “ also.
- Classic Environment:
-
You can adjust Classic OS9’s memory allocation like this: Open the “Classic”
system-preference, hold down the Option key while clicking on Memory/Versions.
Select Adjust Memory.
-
Classic
can sometimes crash but leave the “TrueBlueEnvironment” process running. You
can kill this with Process Viewer.
-
OS9’s
Chooser is located in /System Folder/Apple Menu Items
-
OS9
can IP-print by opening /Applications (Mac OS 9)/Utilities/Desktop Printer
Utility and selecting the LPR printer-type. Click the “Change” button to select
the PPD file, then “Change” to enter the printer’s IP address.
- OSX’s version of Cron is CronniX
- Not all directories are folders. Some application-icons are actually
“Bundles”. Ctrl-clicking on a Bundle will display a “Show Package Contents”
menu. You can also simply CD into the Bundle directory from the Unix prompt.
- Cocoa apps are OSX-only.
- Carbon apps run on OSX and OS9, if OS9 has the CarbonLib extension installed.
- Symlink – A Symbolic Link, created with the “ln” command.
- OSX doesn’t display and Unix dot-files, keeping them invisible. You need to
create dot-files at the Unix prompt.
- The “unmount” command will eject a mounted volume.
- Search uses the “locate” database in
/var/db/locate.database This can
be run manually as root, but Cron runs it weekly at Saturday at 4:00 AM.
-
You
can run “locate nasa” from the Unix prompt.
- These
grep flags are supported: -r (recursive), -i (case-insensitive), -l (file-names
only).
-
Search
the entire filesystem with grep –ril
nasa ~ This takes a while, since it
doesn’t use content indexing like the Finder does.
- In the
“About this Mac” menu, clicking on the Version-Number will show the Build
Number of the OS. Clicking it again shows your Mac’s hardware Serial Number.
- The Unix command ps –awux shows all processes, like the Process Viewer
gui-app.
- The Unix shell commands useradd, userdel, and usermod don’t work in OSX. Must
use NetInfo Manager.
- Stats about disk-space are no longer found in the Finder, but in
Applications/Utilities/Disk Utility.
- All icons measure 128x128 pixels.
- If OSX
icons are screwed, delete ~/Library/Preferences “LS” files:
-
LSApplications, LSClaimedTypes, and LSSchemes
- How to check a filesystem:
-
Hard-boot
with Ctrl-Command-Eject
-
Type
these commands:
o
sudo
shutdown now This puts you in to
Single-User mode.
o
fsck
–y
o
If the
disk has been modified, run fsck again until it’s clean.
o
reboot
- Use the
tool Applications/Utilities/CPU Monitor to see how efficiently dual-processors
are distributing the workload.
- Holding
down the Shift key while minimizing a window slows the Genie-effect way down
into slow-motion.
- Option-Command-click a dock-icon to hide all other
application-windows.
- All defaults are stored in ~/Library/Preferences/*.plist These can be modified with the “defaults”
command.
- To view installed OSX Extensions, use Applications/Utilities/Apple System
Profiler and click on the “Extensions” tab.
- There is no “Memory” System Preference.
- To toggle Zoom on and off, use
Option-Command * Use
Option-Command + and Option-Command
- to zoom in and out. You can also
switch the screen to white-on-black.
- To change the default PDF reader do this:
-
Open
any PDF file’s “Info” window.
-
Select
the default-app you want to use, then click “Change All”.
- The
KeyCaps tool is located in Applications/Utilities
- Filesystems:
-
UFS: Universal File System, used by most Unixes.
-
HFS+: MacOS Extended Format, aka “Hierarchical File
System”, used by OSX and previous MacOS’s, back to OS 8.1
-
HFS: Used by pre-OS 8.1 OS’s.
-
FAT: File Allocation Table.
- Unix
shells:
- sh The
first Unix shell, written by Steven Bourne in the 1970’s. aka “The Bourne
Shell”
- csh The C Shell, written by Bill Joy for BSD in Berkeley.
- ksh The Korn Shell, written by David Korn at AT&T, which
combines the Bourne and C Shells. www.kornshell.com
- bash Part of the GNU project, it’s the default shell on Linux. The most
common shell today.
- tcsh A newer derivative of the C Shell.
- zsh The Z Shell, written by Paul Falstad at Princeton, which
combines the bash, ksh, and csh shells. The newest of the shells.
- Shell
scripts written in sh (#! /bin/sh) are portable to the greatest number of
systems. Shells are usually kept in ~/bin
-
Activating the OSX Root account:
-
Launch
Applications/Utilities/NetInfo Manager
and authenticate by clicking on the lock-icon.
-
Select
“Security” and “Enable Root User”.
-
Select
“Security” and “Change Root Password” to create a password.
- User
and Group info is stored in /users and /groups.
- The
Login banner is its own application, found in /System/Library/Core
Services/loginwindow The .plist file
(which the “Accounts” Preference-Pane is editing) is located in
/Library/com.apple.loginwindow.plist
- /Applications/Utilities/Network Utility is a GUI version of the usual Unix
network-troubleshooting commands.
- finger ftp.kernel.org shows the latest Linux kernel version numbers.
- Snort (www.snort.org) can tell if a host
is being port-scanned.
- OSX’s port-scanning tool is called “stroke:
/Applications/Utilities/Network\Utility.app/Contents/Resources/stroke You can
copy this to /bin/portscan to make it easier.
- NFS-mounted volumes usually appear as a disk in /Network. OSX doesn’t have a
GUI for NFS. A shareware tool for this is NFSManager, located at www.bresink.com/osx/NFSManager.html
- OSX includes a firewall called “ipfw”, aka “ip firewall”, developed for
FreeBSD. Use either the “ipfw” command or the related Preference Pane. A
shareware GUI front-end is “BrickHouse”:
http://personalpages.tds.net/~brian_hill/brickhouse.html
- View the current firewall rules with
“ipfw l”
- In Single-User mode no daemons run and the root filesystem isn’t mounted. In
this mode you can run /sbin/fsck –y to repair filesystems. You may need to
mount filesystems via “mount –uw /”.
-
To
reset a password in Single-User mode you have to activate some NetInfo daemons.
Type “SystemStarter” to be able to use “passwd”.
-
To
reboot from within Single-User mode type “reboot”.
-
To
shut down type “shutdown –h now”
- The
Unix terminal can display colored text, such as blue for files and red for directories,
via $ export CLICOLOR=YES
- To see a list of all executables in the OSX CLI (that is, everything listed
by the PATH environment variable) hit Shift-ESC twice. There are over 1,000
executables.
- Type “open –a Safari” from the Unix prompt to launch Safari from the Unix
prompt. –a refers to Application.
- Boot
Stuff:
-
During
bootup, over 100 programs launch. Boot is divided into 2 broad steps: Powering
up and organizing hardware, then launching the OS.
-
When
you hit the power button, a small hardware program launches that’s embedded in
the logic board, called POST (Power On Self Test). It initializes the CPU,
tests RAM, plus other core-stuff. Then it launches Open Firmware. At this
point, if successful, you hear the Mac chime sound.
o
Open
Firmware:
§
Open
Firmware is the name for the IEEE standard for a machine-independent BIOS that
was based on boot-code used in SUN workstations. It’s different from other BIOS
in that it uses a byte-code representation of a language called Forth. This
allows the same code to run on different processors without change. For more
info go to www.openfirmware.org
§
You
can secure your Mac at the firmware level with Open Firmware Password at http://docs.info.apple.com/article.html?artnum=120095
§
Open
Firmware is located on a reprogrammable chip on the motherboard. Its job is to
locate stuff attached to the motherboard, like video cards, hard drives, and
anything connected via USB, Firewire, or SCSI. It organizes all devices into a
“device tree”, to make them quickly accessible to higher-level devices. It then
looks for the OS.
§
To
look at Open Firmware use the Unix command
$ nvram –p This will show things
like the defined boot-device and boot-partition.
§
All
Mac hard-disks are either ATA or SCSI connected.
§
If you
accidentally screw up the Open Firmware/BIOS settings you can reset them by
Zapping the PRAM while rebooting:
- Hold down Option-Command-P-R
while rebooting.
§
You
can reboot into Open Firmware by holding down Option-Command-O-F during reboot.
You’ll see a banner with system info (same as that shown in the System Profiler
tool), plus firmware version info.
§
The
Open Firmware prompt has a few limited commands:
> printenv Prints all
variables held in Firmware.
> setenv name=value Sets a variable.
> password Defines an Open
Firmware password.
> reset-nvram Resets all variables to
default.
> reset-all Reboots.
> mac-boot Continue booting into
the OS.
> shut-down Power down the Mac.
§
If you
screw everything up, just do this:
> reset-nvram
> reset-all
§
Apple
has an Open Firmware password utility at
http://docs.info.apple.com/article.html?artnum=120095
§
There
are 2 Security Modes in Open Firmware
setenv security-mode full Requires a password at every
bootup.
setenv security-mode command Sets password for Open Firmware only.
setenv security-mode none Turns off the Open Firmware
password (after prompting for current password one more time)
§
Open
Firmware password recovery:
1.
Open
the chassis.
2.
Change
the amount of RAM.
3.
Zap
the PRAM while rebooting: Hold down
Option-Command-P-R
4.
The
password will now be gone.
o
The OS
Boot Process:
§
The
last step that Open Firmware performs is launching
/System/Library/CoreServices/BootX
Open Firmware has no knowledge of what OS it’s launching, it just launches
BootX. At this point, Open Firmware quits and BootX takes over.
§
The
first thing BootX does is display the “Booting” banner with the spinning
circle. It then loads the kernel and kernel-level device drivers, like hard
disk drivers. Once loaded, the kernel initializes.
§
The
kernel then asks Open Firmware where the boot-drive is, which is usually the
same drive the kernel was loaded from. It then mounts the Unix filesystem at /
then launches the BSD /sbin/init program.
§
BSD “init” is the first Unix process to start
up. It owns every other Unix process. It has 4 main tasks:
1.
Chooses
what mode to boot into: MultiUser or Single-User.
2.
Runs
the the /etc/rc initialization script.
3.
Launches
the Login window.
4.
Cleans
up the terminated processes.
§
The rc
script launches lots of stuff, like device-drivers and swap-files. The last thing
rc does is launches SystemStarter.
§
With
filesystem journaling now active by default in Panther, which guarantees file
integrity, Single-User login is rarely needed. But you can hold down Command-S
during bootup to access it. Type “exit” to continue booting into MultiUser
mode, or “reboot” to reboot.
§
SystemStarter
is the last stage of the boot process and is what makes the Unix foundation
uniquely OSX .It displays the “MacOSX” banner with the Apple logo and the
status bar showing what’s loading. It activates all network daemons, Rendezvous
(Apple’s Apache web serer), LDAP (for Open Directory), SSH, print stuff, and
anything listed in /System/Library/StartupItems and /Library/StartupItems.
§
The
Apple logo boot-banner, or “Boot Panel”, is a PDF file that lives in
/System/Library/CoreServices/SystemStarter/QuartzDisplay.bundle/Resources/Boot-Panel.pdf
You can replace this file with any other PDF file that is exactly 472x360
pixels. Some good replacements can be found at www.resexcellence.com/user_X_boot.shtml When replacing it, back up the original file
and rename it as Boot-Panel.pdf.bak, and name the new file the same as the old.
If you misname the new file the Mac will still boot, but with a blue screen.
§
SystemStarter
boots most processes in parallel, to reduce boot-time. When it’s done it hands
over control to “loginwindow” which is the GUI.
§
With
Panther, Apple is moving away from SystemStarter as a way to launch daemons,
preferring “Mach bootstrap servers”, which is more efficient and faster. There
are few docs at present , but some live at http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Concepts/BootProcess.html
(pg. 73)
§
SystemStarter
launches daemons. The daemons read /etc/hostconfig to decide what services to
start.
- A .plist file is a configuration property list.
- After you log in, loginwindow is still running in the background, to relaunch
Finder or the Doc if they die. If loginwindow dies, the init process will
automatically relaunch it.
- The login window doesn’t actually authenticate a user. It passes credentials
off to Directory Services.
- A user’s auto-launching apps are defined in the “Accounts” Preference Panel.
Any app listed here can be hidden from the Dock, via the “Hide” button.
- When you execute “who” your username will appear at least twice. “Console” is
your GUI session and “ttyp” is your Terminal CLI session.
- Use the “w” command to show more detailed output, like idle-time and
CPU-load.
- More info from the book “Mac OS X System Overview” lives at
/Developer/Documentation/MacOSX/Conceptual/SystemOverview/System-Overview.pdf.
Also look at the manpages for nvram, bless, rc, SystemStarter.
- Use “id” to see all of your ID settings. UIDs less than 500 don’t appear,
only those greater than 500.
- OSX doesn’t use the Unix commands useradd, userdel, usermod, etc. commands.
Only the “passwd” command.
- By default, sudo works for the Administrator user. $sudo –s puts you in the root shell.
- Every
command is stored in
/var/log/system.log
- The Root account can be enabled from the CLI with $sudo password root
- Directory Services:
-
The
tool NetInfo is an alternative to /etc for storing user/permission info.
-
Rendezvous
is a service directory protocol. It’s IP-based and is used to discover file and
print services.
o
As of
OS 10.4 “Tiger”, Rendezvous will be renamed “OpenTalk”, due to copyright problems
with Tibco.
o
SMB is
Microsoft’s protocol for discovering file and print services.
-
NetInfo
is actually a Directory Services protocol. Mostly used in all-MacOS
environments.
-
OSX
keeps all administrative info in NetInfo, It’s a Directory Service, whose
database can be distributed across multiple machines.
-
Files
like /etc/passwd and /etc/alias are usually only used in Single-User mode.
Otherwise they usually aren’t maintained in OSX.
- Use
Applications/Utilities/Directory Access to control how OSX interacts with the
various protocols supported by Open Directory. These are all the protocols used
for discovering network services.
- Rendezvous is Apple’s IP-based protocol for discovering file, print and other
network services. Equivalent to Microsoft’s SMB protocol.
- SLP is
Service Location Protocol, an open network services discovery protocol used by
Unix servers.
- AFP is Apple Filing Protocol. Run by /usr/sbin/AppleFileServer. User authentication
is handled through NetInfo.
- The Sharing Pane:
-
Personal
File Sharing shares local volumes via AFP.
-
Personal
Web Sharing launches the Apache Webserver.
-
Remote
Login runs the SSH server. OSX uses OpenSSH from openssh.com
- You can
track the popularity of different webservers at www.netcraft.com/survey.
- OSX uses Quartz 2D Libraries instead of OpenGL.
- Postscript and PCL are printer languages. What others are there?
- The RTF standard is maintained by Microsoft, but is an open standard:
-
http://msdn.microsoft.com/library/en-us/dnrtfspec.asp?frame=true
- .rtfd
files are actually bundled directories with RTF files and image references.
TextEdit will render them as single documents with inline images.
- Use the Unix “file” command to get info about a file: # file test.pdf
- The Unicode Consortium:
www.unicode.org
-
Alternatives to Terminal:
-
GLTerm www.pollet.net/GLterm
- xterm Used with X Windows, if installed
o
Console
Mode: At the login window, enter the username as >console and no
password, then hit Return. Then log in via the CLI.
§
When
you log out/exit, the GUI returns.
- The
Xfree86 project (www.xfree86.org) is an
Open Source project porting X11 to all flavors of Unix.
- GNU MacOSX archive: www.osxgnu.org Is an alternative to Fink.
- # tar xzvf filename.tar.gz This
will de-TAR a file.
- Darwin is the non-GUI part of the OS. It can be downloaded separately
from http://developer.apple.com/darwin
- The OpenDarwin Project: www.opendarwin.org
- Rendezvous is based on the Zero Conf Project (IETF Zero Configuration)
at www.zeroconf.org Rendezvous enables automatic service and
machine discovery.
- Font Book is OSX’s font management tool.
- To view hidden files from the Finder, use Go --> Go to Folder and enter
the path.
- To make all files visible in the Finder, do this at the prompt:
% defaults write com.apple.Finder
AppleShowAllFiles YES
- To make
all files invisible again in the Finder, do this:
% defaults write com.apple.Finder
AppleShowAllFiles NO
- You can move to a new Mac by simply copying your entire Home directory.
- A good source for info on how your system is put together is here:
/Developer/Documentation/MacOSX/Conceptual/SystemOverview/SystemOverview.pdf
- This requires that XCode Tools is
installed. Can be found on Apple’s ADC (Apple Developer Connection) website.
- Unix “find” command: % find
<path><options>
- % find ~/Documents –name *.txt Finds all text-files in the path.
- % find ~/Documents –mtime –1 Finds files modified in the past
day.
- % grep –r toast ~/Documents Recursive grep.
- Grep
stands for “Get Regular Expression”.
- To use
color in the CLI, do this: % export
CLICOLOR=YES
- Hitting
Shift-ESC twice will list all executables.
- % help <command>
- OpenFirmware page: www.openfirmware.org
- % sudo –s Logs you in as
Superuser.
- All sudo commands are logged
to /var/log/system.log
- System Profiler from the CLI: %
system-profiler > viewlater.txt
- www.apple.com/macosx/feedback
- http://bugreport.apple.com (Requires the free ADC membership)
- /Applications/Utilities/Console is the tool for viewing logs.
- /Applications/Utilities/Activity Monitor
- /Applications/System Preferences
- % kill –KILL <ps ID> is the same as % kill –9
- Apps store their preferences in separate files, as opposed to Windows apps
that store everything in the Registry.
- /Library/Preferences
- Most apps store their preferences in the “defaults system”, which is an
XML-based property list (a “plist”) file in the Preferences directory.
- Make a habit of backing up ~/Library/Preferences
- Preference files are also called “Preference Domains”. The Apple-recommended
naming convention of preference domains is to use the reverse Internet domain
name of the app’s vendor, followed by the name of the app. Such as: com.apple.doc.plist and
com.apple.Bluetooth.plist
- Journaling keeps a continuous record of changes to files in a “journaling
file”. Journaling does slow down the writing of files by 10-15 %.
HFS+ Filesystem
- aka
“MacOS Extended Filesystem”.
- Introduced in OS 8.1
- Supports long filenames, up to 255 Unicode characters.
- Supports 2 Terabytes per filesystem.
- Supports 2 billion files.
- Supports file-sizes up to 2 GB.
- Each folder can hold 32,767 files.
- HFS+ is not case-sensitive, unlike most Unixes.
- HFS+ supports resource forks, for support of legacy files, but Apple
recommends against them.
- Disk fragmentation is less common in Panther’s journaling, due to 2 new
optimization schemes:
-
Automatic
File Defragmentation.
When opened, if a file has more than 8 fragments, and is smaller than 20 MB, it
is automatically de-fragged by being moved to a new location where it can be
written in one contiguous block.
-
Adaptive
Hot File Clustering.
The system watches for any small files that are read frequently but never
written to. When the system decides which of these files are used most, and are
least likely to change, they are moved to the fastest part of the disk, where
they can be quickly accessed. Files that don’t qualify for this “hot zone” are
moved out to make room for the players.
- HFS,
aka “MacOS Standard”. Used on pre-8.1 OS’s.
- UFS, “Unix Filesystem”. A variant of the standard BSD “Fast File System”,
it’s case-sensitive, for Unix apps that need this. But HFS+ is much faster than
UFS.
- UDF, “Universal Disk Format”. The standard format for all DVD media,
including video, DVD-ROM, DVD-RAM, DVD-RW, and writable CD formats.
- ISO-9660. The standard cross-platform CD-ROM file format.
- Audio CD.
- MS-DOS FAT. Supports both the 16-bit and 32-bit variants of FAT.
Network-based
Filesystems
- AFP, “Apple Filing Protocol”, The native network filesharing protocol for
MacOS. Originally designed for AppleTalk, now works over IP.
- SMB/CIFS.
- NFS. Used by Linux, Solaris, and BSD.
- WebDAV, “Web-Based Distributed Authoring and Versioning”. A set of extensions
to HTTP that allow collaborative editing and managing of files on remote web
servers. It’s the native protocol used for mounting iDisks from .Mac. Homepage:
www.webdav.org
- FTP.
- When you connect to a network filesystem using the “Go” menu, if you just
enter a hostname or IP address, the Finder will assume you want to connect via
AFP. Use URLs to be protocol-specific, such as:
- afp://user@host/volumename CLI command: mount_afp
- ftp://user@host/path CLI command: mount_ftp
- nfs://user@host/path CLI command: mount_nfs
- smb://user@host/sharename CLI command: mount_smbfs
- WebDAV: http://user@host/path CLI command: mount_webdav
- Hard
Disks:
-
G3 and
G4 Macs only use IDE/ATA drives.
-
G5
Macs only use Serial ATA (S-ATA) drives.
- In Applications/Utilities/Disk Utility’s “Info” button there is a field named
“S.M.A.R.T.” status. This refers to a set of on-board diagnostic features built
into modern disk-drives. SMART stands for “Self-Monitoring, Analysis,
and Reporting Technology”.
-
“Verified”
means everything is fine.
-
“About
to Fail” means the disk needs to be replaced soon.
-
“Not
Supported” means the disk doesn’t use SMART.
- SMART
monitors disk calibration, CRC errors, spin-up time, and disk temperature.
- Use
Disk Utilitity’s “Verify Disk Permissions” button to verify that some installer
didn’t change permissions. If so, this can be fixed via the button below it.
- %
diskutil list Shows more info
than Disk Utility does.
- More robust disk utilities:
- Dive 10 by Micromat www.micromat.com
- Disk Warrior by Alsoft www.alsoft.com/DiskWarrior
- Open
Source print-drivers can be found at http://gimp-print.sourceforge.net
- Amphenol stands for…..
- Using IP over carrier-pigeons: www.ietf.org/rfc/rfc1149.txt
- Applications/Utilities/Network Utility
- The Ipv4 loopback address is 127.0.0.1
- The Ipv6 loopback address is ::1
- To view the ARP table use %
arp –a
- To view the routing table use %
netstat –r
- To view all active connections use %
netstat -a
- OSX also
uses APIPA addresses: 169.254.1.0 – 168.254.254.255 This is used by Rendezvous.
- /etc/resolv.conf contains the DNS servers, but don’t edit the file.
- mDNS: Multicast DNS. Used by Rendezvous to advertise machines names. Can be
mounted on a LAN via http://Michelle.local
- Monitor AppleTalk status with % appletalk –s
- View all AppleTalk hosts and services with %
atlookup The output will look like
this:
ff8c.7a.80 Christer.Darwin
The first 2 numbers are the AppleTalk
network number and ID, followed by the service provided (in this case port 80)
- Create
a VPN config using Internet Config.
- A list of well-known ports used by Apple software can be found here:
http://docs.info.apple.com/article.html?artnum=106439
- OSX’s firewall is based on ipfw
- When you activate Personal File Sharing, the “AppleFileServer” process
starts, and Rendezvous activates to let your host be discovered. Your Mac will
show up in the /Network directory of other Macs.
- The SSH config lives in
/etc/sshd_config
- SSH supports the following file transfer methods:
-
sftp
-
rcp
-
rsync
- None of
the above methods support Anonymous logins, ala FTP.
- Fink: Unix software that’s been ported of OSX, plus GNOME and KDE desktops:
http://fink.sourceforge.net
-
GNU-Darwin: Similar to Fink, but uses FreeBSD port systems. http://gnu-darwin.sourceforge.net
- When
you activate Personal File Sharing the “AppleFileServer” process starts, and
Rendezvous activates to let your host be discovered. Your Mac will show up in
the /Network folder of other Macs.
- MacUpdate: Tracks software releases for OSX.
www.macupdate.com
- www.versiontracker.com
- FreshMeat: Catalogs and tracks the project history of thousands of Open
Source apps. http://osx.freshmeat.net
Unix Specific Notes
- You can’t customize the Terminal characteristic, like with xterm, with
command-line switches like -fn, -fg, or -bg. Use the “Show Info” menu instead.
- xterm customization example:
- %
xterm &
- %
xterm –e –fg green –bg black –e pine –name pine –title pine &
- When you highlight a Terminal text, the selection is stored in a
“pasteboard”, then when you hit Command-C it’s stored in the Clipboard.
- Alternatives to Terminal: GLTerm iTerm
- Root is activated in NetInfo Manager, but Apple recommends only using sudo
commands.
- OSX’s equivalent to .exe extensions is .app but this is usually hidden in the
Finder.
- Terminal.app isn’t a binary file, but is a “package” containing binary and
support files. Can be cd’d into from the shell.
- To
cycle between multiple windows in the same app use Command `
- Terminal startup options can be customized by creating .term and .command
files.
- Adding the .command extension to any executable script will turn it into a
double-clickable executable.
- osascript: A utility that lets you run Applescripts from the command-line.
- Booting:
-
OSX
doesn’t use /etc/inittab, /etc/init.d, or /etc/rc.local but instead uses a
BSD-like startup sequence, sitting between the Mach microkernel and the Aqua
UI.
- Mach
was developed at Carnegie Mellon University.
- OSX’s Xkernel, “xnu”, is a hybrid of Mach and BSD.
- Don’t use fsk to troubleshoot disk problems. Boot from an OSX install-disk
and run Installer ŕ Open Disk Utility.
- O’Reilly book errata: www.oreilly.com/catalog/mpantherunix
Directory Services
- NetInfo:
-
NeXTSTEP’s
legacy Directory Services protocol. It’s turned off by default in
Applications/Utilities/Directory Access. If it’s on, it will look for NetInfo
domains when authenticating.
- LDAPv3:
-
Same
version of LDAP used by Microsoft’s Active Directory and Novell’s NDS. OSX
includes the client components plus the “slapd” standalone LDAP daemon. Support
comes through the OpenLDAP project:
www.openldap.org
-
/etc/passwd and /etc/master.passwd are only ever used in Single-User mode.
- If you do a rm
/var/db/.AppleSetupDone and then
reboot, the Mac will think it’s boot up for the first time, and will run the
Setup Assistant to create the initial account.
- Open
Source print-drivers: http://gimp-print.sourceforge.net/MacOSX.php3
- The HP Inkjet Project (HPIJS): www.linuxprinting.org/macosx/hpijs These are drivers from HP that have been
released as Open Source.
- X11 is called “11” because…..
- Apple’s X11 implementation is based on the Open Source Xfree86 project: www.xfree86.org
- Ctrl-click on the xterm window to display the popup menu. Ctrl-Command-click
also works.
- Ctrl-click emulates the right-mouse button.
- Option-click emulates the middle-mouse button.
- Command-click emulates the right-mouse button. (?)
- X11 runs in 2 modes:
- Rootless mode: each app uses it’s own window, on top of the Finder. This is the default behavior.
- Full-screen mode: X11 takes up the whole desktop, hiding the Finder. Now the other X11 Desktop Environments (DTE) can be used, like GNOME, KDE, or Xfce. Full-screen mode is enabled in the X11 Preferences menu, in the Output tab. Toggle back to the Finder with Option-Command-A
- You can customize X11 by editing /etc/x11/xinitrc
- MPlayer (like VLC): www.mplayerhq.hu
- Quicktime components: http://qtcomponents.sourceforge.net Install them in ~/Library/QuickTime
- Blender: www.blender3d.com Blender’s GUI uses OpenGL.
- Hit F12 to eject a CD or DVD
- F10 uses Expose to separate windows within an app. F9 does this with all open
windows across all apps.
- Virtual Desktops:
- CodeTek’s VirtualDesktop: www.codetek.com/php/virtual.php
- Virtual Screens: http://homepage.mac.com/marco_coisson/VirtualScreens/VirtualScreensEn.html
- SSH GUIs:
- gftp www.gftp.org (Also available on Fink)
- Fugu http://rsug.itd.umich.edu/software/fugu (This is a front-end to OSX’s installed SSH client)
- SSHTunnel Manager http://projects.tynsoe.org/en/stm
- SSH Agent www.phil.uu.nl/~xges/ssh
- LaTEX for OSX:
- Mac-TeX www.esm.psu.edu/mac-tex
- TeXShop http://darkwing.uoregon.edu/~koch/texshop/texshop.html
- iTeXMac http://itexmac.sourceforge.net/Download.html
- Equation Service: www.esm.psu.edu/mac-tex/EquationService
- Raqua http://cran.r-project.org
- Apple’s OpenFirmware page: http://bananajr6000.apple.com