Difference between revisions of "Mac"

From rbachwiki
Jump to navigation Jump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
== [[Mac Troubleshooting]]==
==Change SSH PORT==
* Open terminal
* sudo nano /etc/services
* Find the lines assigned to port 22
* Replace both with desired port from 1024 - 32,767
==Recover Broken Drive ==
<b>Run the following command in Terminal.app, replacing N by the corresponding disk number, which you can find by running diskutil list:</b>
*diskutil eraseDisk FAT32 UNTITLED MBRFormat /dev/diskN
== Changing Vnc Port number==
sudo nano /etc/services
Then change the port from 5900 to another number
'''Restart vnc server '''
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
== Reset Lost password ==
== Reset Lost password ==
<pre>
<pre>
Line 328: Line 347:
== Mac OX 10 Directory Structure==
== Mac OX 10 Directory Structure==
<pre>
<pre>
File or Folder
File or Folder           Description


Description
/.DS_Store - Contains Finder settings for the current directory. This folder is generated for any directory viewed in Finder.


/.DS_Store
/.Spotlight‐V100 - Contains Spotlight‐specific metadata


Contains Finder settings for the current directory. This folder is generated for any directory viewed in Finder.
/.Trashes - Contains files that have been dragged to the Trash


/.Spotlight‐V100
/.com.apple.timemachine.supported - Indicates that a drive can be used by Time Machine as a backup target


Contains Spotlight‐specific metadata
/.fseventsd - Used by the FSEvents API


/.Trashes
/.hotfiles.btree - A B‐Tree index that provides fast access to frequently used files


Contains files that have been dragged to the Trash
/Applications - Holds all Mac OS X applications


/.com.apple.timemachine.supported
/bin - Contains essential system binaries


Indicates that a drive can be used by Time Machine as a backup target
/Desktop DB - Contains housekeeping information used by Finder


/.fseventsd
/Desktop DF - See /Desktop DB


Used by the FSEvents API
/dev - Contains device‐specific files


/.hotfiles.btree
/Developer - Contains Apple's XCode tools and documentation (but only if you've installed them)


A B‐Tree index that provides fast access to frequently used files
/etc - Contains system configuration files. This is a symbolic link to /private/etc.


/Applications
/home - Used by the automounter for NFS‐mounted home directories


Holds all Mac OS X applications
/Installer Log File - Used by some third‐party installers


/bin
/Library - Contains support files for locally installed applications


Contains essential system binaries
/lost+found - Stores orphaned files discovered by fsck


/Desktop DB
/mach_kernel - Contains the Darwin kernel


Contains housekeeping information used by Finder
/mach_kernel.ctfsys - Contains an alternate copy of the kernel (used by dtrace)


/Desktop DF
/net - Used by the automounter for NFS‐mounted directories


See /Desktop DB
/Network - Contains network‐mounted Application, Library, and User folders


/dev
/opt - Contains the MacPorts installation (if installed)


Contains device‐specific files
/private - Contains the tmp, var, etc, and cores directories


/Developer
/sbin - Contains executables for system administration and configuration


Contains Apple's XCode tools and documentation (but only if you've installed them)
/sw - Contains the Fink installation (if installed)


/etc
/System - Contains various folders, the most important of which is Library, which holds support files for the system and system applications


Contains system configuration files. This is a symbolic link to /private/etc.
/tmp - Holds temporary files. A symbolic link to /private/tmp.


/home
/User Guides and Information - An alias to /Library/Documentation User Guides and Information


Used by the automounter for NFS‐mounted home directories
/Users - Contains home directories for users on the system (root user's home is /var/root)


/Installer Log File
/usr - Contains BSD UNIX applications and support files


Used by some third‐party installers
/var - Contains frequently modified files, such as log files. Symbolic link to /private/var.


/Library
/Volumes - Contains all visible mounted file systems, including removable media and mounted disk images
</pre>


Contains support files for locally installed applications
== Finding Php.ini File in OsX  ==
<pre>
The Php.ini is not necessary in OSX but if it exists it would be in the /Private/etc dir
</pre>


/lost+found
== Well Known Mac OS X Ports ==
===TCP Port Numbers Commonly Used by Macintosh Services ===
<table border="0">


Stores orphaned files discovered by fsck
<tr>
<td>Port</td>
<td>Usage</td>
<td>Reference</td>
<td>Notes</td>
</tr>
<tr>
<td>20</td>
<td>FTP Data</td>
<td>http://www.ietf.org/rfc/rfc959.txt RFC 959</td>
<td>Only used as a source port</td>
</tr>
<tr>
<td>21</td>
<td>FTP Control</td>
<td>http://www.ietf.org/rfc/rfc959.txt RFC 959</a></td>
<td> </td>
</tr>
<tr>
<td>22</td>
<td>SSH (secure shell remote login)</td>
<td>http://www.free.lp.se/fish/rfc.txt SSH RFC</a></td>
<td> </td>
</tr>
<tr>
<td>23</td>
<td>Telnet</td>
<td>http://www.ietf.org/rfc/rfc854.txt RFC 854</a></td>
<td>Common port for attacks</td>
</tr>
<tr>
<td>25</td>
<td>SMTP (email)</td>
<td>http://www.ietf.org/rfc/rfc821.txt RFC 821, 822</a></td>
<td> </td>
</tr>
<tr>
<td>53</td>
<td>DNS</td>
<td>http://www.ietf.org/rfc/rfc1034.txt RFC 1034, 1035</a></td>
<td>Mainly uses UDP, not TCP</td>
</tr>
<tr>
<td>70</td>
<td>Gopher</td>
<td>http://www.ietf.org/rfc/rfc1436.txt RFC 1436</a></td>
<td> </td>
</tr>
<tr>
<td>79</td>
<td>Finger</td>
<td>http://www.ietf.org/rfc/rfc1288.txt RFC 1288</a></td>
<td> </td>
</tr>
<tr>
<td>80</td>
<td>HTTP (Web)</td>
<td>http://www.ietf.org/rfc/rfc1945.txt RFC 1945</a></td>
<td> </td>
</tr>
<tr>
<td>88</td>
<td>Kerberos</td>
<td>http://www.ietf.org/rfc/rfc1510.txt RFC 1510</a></td>
<td> </td>
</tr>
<tr>
<td>105</td>
<td>PH (directory)</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>106</td>
<td>Poppass (change password)</td>
<td>http://www.con.wesleyan.edu/%7Etriemer/network/poppassd/poppassd_tcp.html Wesleyan tech note</a></td>
<td> </td>
</tr>
<tr>
<td>110</td>
<td>POP3 (email)</td>
<td>http://www.ietf.org/rfc/rfc1081.txt RFC 1081, 1082</a></td>
<td> </td>
</tr>
<tr>
<td>111</td>
<td>Remote Procedure Call (RPC)</td>
<td>http://www.ietf.org/rfc/rfc1057.txt RFC 1057</a></td>
<td>Used for many Unix applications</td>
</tr>
<tr>
<td>113</td>
<td>AUTH</td>
<td>http://www.ietf.org/rfc/rfc931.txt RFC 931</a></td>
<td> </td>
</tr>
<tr>
<td>115</td>
<td>SFTP</td>
<td>http://www.ietf.org/rfc/rfc913.txt RFC 913</a></td>
<td> </td>
</tr>
<tr>
<td>119</td>
<td>NNTP (News)</td>
<td>http://www.ietf.org/rfc/rfc977.txt RFC 977</a></td>
<td> </td>
</tr>
<tr>
<td>139</td>
<td>NETBIOS Session</td>
<td>http://www.ietf.org/rfc/rfc1001.txt RFCs 1001, 1002</a></td>
</tr>
<tr>
<td>143</td>
<td>IMAP (new email)</td>
<td>http://www.ietf.org/rfc/rfc2060.txt RFC 2060</a></td>
<td> </td>
</tr>
<tr>
<td>384</td>
<td>ARNS (tunneling)</td>
<td>http://www.cs.mu.oz.au/appletalk/doc/MacUAR.userDoc.html#OTARNS Univ. of Melbourne</a></td>
<td> </td>
</tr>
<tr>
<td>387</td>
<td>AURP (tunneling)</td>
<td>http://www.ietf.org/rfc/rfc1504.txt RFC 1504</a></td>
<td> </td>
</tr>
<tr>
<td>389</td>
<td>LDAP (directory)</td>
<td>http://www.ietf.org/rfc/rfc1777.txt RFC 1777, 1778</a></td>
<td> </td>
</tr>
<tr>
<td>407</td>
<td>Timbuktu 5.2 or later</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a></td>
<td>Previous versions use other ports</td>
</tr>
<tr>
<td>427</td>
<td>SLP (service location)</td>
<td>http://www.ietf.org/rfc/rfc2165.txt RFC 2165</a></td>
<td>Only uses TCP for large responses</td>
</tr>
<tr>
<td>443</td>
<td>HTTP over SSL (HTTPS)</td>
<td>http://home.netscape.com/eng/ssl3/ssl-toc.html Draft RFC</a></td>
<td> </td>
</tr>
<tr>
<td>445</td>
<td>MS Directory Service</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>465</td>
<td>SMTP over SSL (SSMTP)</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>497</td>
<td>Retrospect</td>
<td> </td>
<td>UDP for finding clients</td>
</tr>
<tr>
<td>510</td>
<td>FirstClass server</td>
<td>http://www.softarc.com/ SoftArc.com</a></td>
<td> </td>
</tr>
<tr>
<td>515</td>
<td>LPR (printing)</td>
<td>http://www.ietf.org/rfc/rfc1179.txt RFC 1179</a></td>
<td> </td>
</tr>
<tr>
<td>548</td>
<td>AFP (AppleShare)</td>
<td>http://developer.apple.com/techpubs/macos8/NetworkCommSvcs/AppleShare/appleshare.html AFP 2.2 spec</a></td>
<td> </td>
</tr>
<tr>
<td>554</td>
<td>RTSP (QuickTime server)</td>
<td>http://til.info.apple.com/techinfo.nsf/artnum/n60148/ Apple tech note</a></td>
<td>Also uses UDP 6970+</td>
</tr>
<tr>
<td>591</td>
<td>FileMaker Pro Web</td>
<td>http://192.35.50.21/ti/FMPro?-db=ti.fp5&amp;-format=detail.html&amp;-lay=list&amp;product=FileMaker&amp;artnmbr=106123&amp;-max=10&amp;-recid=35670&amp;-find= FileMaker tech note</a></td>
<td>Recommended alternate to 80</td>
</tr>
<tr>
<td>625</td>
<td>Remote Open Directory Proxy (DSProxy)</td>
<td> </td>
<td>Unregistered usage, registered to DEC/DLM</td>
</tr>
<tr>
<td>626</td>
<td>IMAP Admin</td>
<td> </td>
<td>Apple extension in http://www.apple.com/appleshareip/ ASIP 6</a></td>
</tr>
<tr>
<td>631</td>
<td>IPP (Internet Printing Protocol)</td>
<td>http://www.pwg.org/ipp/ RFCs 2565-2569</a></td>
<td>Available in Mac OS X 10.2 through http://www.cups.org/ CUPS</a></td>
</tr>
<tr>
<td>636</td>
<td>LDAP over TLS/SSL (LDAPS)</td>
<td>http://www.faqs.org/rfcs/rfc2246.html RFC 2246</a></td>
<td> </td>
</tr>
<tr>
<td>660</td>
<td>ASIP Remote Admin</td>
<td> </td>
<td>http://www.apple.com/appleshareip/ ASIP 6.3</a> and later</td>
</tr>
<tr>
<td>666</td>
<td>Now Contact Server</td>
<td>http://www.eudora.com/techsupport/kb/184hq.html Eudora tech note</a></td>
<td>Violates actual port assignment</td>
</tr>
<tr>
<td>687</td>
<td>ASIP Shared UG Port</td>
<td>http://til.info.apple.com/techinfo.nsf/artnum/n31042 ASIP Tech note</a></td>
<td>http://www.apple.com/appleshareip/ ASIP 6.2</a> and later</td>
</tr>
<tr>
<td>1080</td>
<td>WebSTAR Admin</td>
<td>http://www.webstar.com/products/webstar/docs/ws4manual.27.html StarNine FAQ</a></td>
<td>WebSTAR port number plus 1000</td>
</tr>
<tr>
<td>1417</td>
<td>Timbuktu Control (pre-5.2)</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a></td>
<td>Login is through UDP Port 407</td>
</tr>
<tr>
<td>1418</td>
<td>Timbuktu Observe (pre-5.2)</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a></td>
<td>Login is through UDP Port 407</td>
</tr>
<tr>
<td>1419</td>
<td>Timbuktu Send Files (pre-5.2)</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a></td>
<td>Login is through UDP Port 407</td>
</tr>
<tr>
<td>1420</td>
<td>Timbuktu Exchange (pre-5.2)</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a></td>
<td>Login is through UDP Port 407</td>
</tr>
<tr>
<td>1443</td>
<td>WebSTAR/SSL Admin</td>
<td>http://www.webstar.com/products/webstar/docs/ws4manual.27.html StarNine FAQ</a></td>
<td>WebSTAR port number plus 1000</td>
</tr>
<tr>
<td>3031</td>
<td>Program Linking (Apple Events)</td>
<td> </td>
<td>Mac OS 9 and later</td>
</tr>
<tr>
<td>3659</td>
<td>Apple SASL</td>
<td> </td>
<td>Upcoming assignment</td>
</tr>
<tr>
<td>4000</td>
<td>Now Public Event Server</td>
<td>http://www.eudora.com/techsupport/kb/184hq.html Eudora tech note</a></td>
<td> </td>
</tr>
<tr>
<td>4199</td>
<td>EIMS Admin</td>
<td>http://eudora.qualcomm.com/eims/ EIMS Users Guide</a></td>
<td> </td>
</tr>
<tr>
<td>4347</td>
<td>LANsurveyor Responders</td>
<td>http://www.neon.com/LANsurveyor/ls_appnote2.html Neon tech note</a></td>
<td>Uses UDP also</td>
</tr>
<tr>
<td>5003</td>
<td>FileMaker Pro</td>
<td>http://www.filemaker.com/ti/104289.html FileMaker tech note</a></td>
<td>Direct access, not through Web; UDP for host list</td>
</tr>
<tr>
<td>5190</td>
<td>AOL Instant Messenger</td>
<td>http://www.aol.com/aim/help.html AOL tech note</a></td>
<td> </td>
</tr>
<tr>
<td>5498</td>
<td>Hotline Tracker</td>
<td>http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a></td>
<td>UDP port 5499 for finding servers</td>
</tr>
<tr>
<td>5500</td>
<td>Hotline Server</td>
<td>http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a></td>
<td> </td>
</tr>
<tr>
<td>5501</td>
<td>Hotline Server</td>
<td>http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a></td>
<td> </td>
</tr>
<tr>
<td>6346</td>
<td>Gnutella</td>
<td>http://www.gnutellanews.com/information/firewalls.shtml Gnutella news item</a></td>
<td> </td>
</tr>
<tr>
<td>6699</td>
<td>Napster/Macster client</td>
<td>http://www.napster.com/ Apparent usage</a></td>
<td>Used when server is in "firewall mode"</td>
</tr>
<tr>
<td>7070</td>
<td>Real Player</td>
<td>http://service.real.com/firewall/adminfw.html Real tech note</a></td>
<td>Also UDP ports 6970-7170</td>
</tr>
<tr>
<td>7648</td>
<td>CuSeeMe (video)</td>
<td>http://support.cuseeme.com/cu3win/faq/cufaq010.htm White pine tech note</a></td>
<td>Client connections; UDP for audio/video</td>
</tr>
<tr>
<td>7649</td>
<td>CuSeeMe (video)</td>
<td>http://support.cuseeme.com/cu3win/faq/cufaq010.htm White pine tech note</a></td>
<td>Connection establishment.</td>
</tr>
<tr>
<td>8080</td>
<td>Common HTTP alternate</td>
<td>http://www.ietf.org/rfc/rfc1945.txt RFC 1945</a></td>
<td> </td>
</tr>
<tr>
<td>16080</td>
<td>Web Performance Cache</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>19813</td>
<td>4D server</td>
<td>http://www.acius.com/support/tips99%2D25.html ACI US tech note</a></td>
<td>Previously 14566 (6.0 and earlier)</td>
</tr>


/mach_kernel
</table>


Contains the Darwin kernel
=== UDP Port Numbers Commonly Used by Macintosh Services===
<table border="0">


/mach_kernel.ctfsys
<tr>
<td>Port</td>
<td>Usage</td>
<td>Reference</td>
<td>Notes</td>
</tr>
<tr>
<td>53</td>
<td>DNS</td>
<td> </td>
<td>Sometimes uses TCP</td>
</tr>
<tr>
<td>68</td>
<td>Dynamic Host Configuration Protocol (DHCP)</td>
<td>http://www.ietf.org/rfc/rfc2131.txt RFC 2131 </td>
<td>Commonly used to obtain a Mac's IP address</td>
</tr>
<tr>
<td>69</td>
<td>Trivial File Transfer Protocol (TFTP)</td>
<td>http://www.ietf.org/rfc/rfc783.txt RFC 783 </td>
<td> </td>
</tr>
<tr>
<td>123</td>
<td>Network Time Protocol</td>
<td>http://www.ietf.org/rfc/rfc1305.txt RFC 1305 </td>
<td> </td>
</tr>
<tr>
<td>137</td>
<td>Windows Name Service</td>
<td>http://www.ietf.org/rfc/rfc1001.txt RFC 1001 </td>
<td> </td>
</tr>
<tr>
<td>138</td>
<td>Windows Datagram Service</td>
<td>http://www.ietf.org/rfc/rfc1001.txt RFC 1001 </td>
<td> </td>
</tr>
<tr>
<td>161</td>
<td>Simple Network Management Protocol (SNMP)</td>
<td>http://www.ietf.org/rfc/rfc1157.txt RFC 1157 </td>
<td> </td>
</tr>
<tr>
<td>407</td>
<td>Timbuktu</td>
<td>http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote </td>
<td>Handshaking only, prior to version 5.2</td>
</tr>
<tr>
<td>458</td>
<td>QuickTime TV</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>497</td>
<td>Retrospect</td>
<td> </td>
<td>Finding clients on the network</td>
</tr>
<tr>
<td>514</td>
<td>Syslog</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>554</td>
<td>Real Time Streaming Protocol (QuickTime)</td>
<td>http://www.ietf.org/rfc/rfc2326.txt RFC 2326 </td>
<td> </td>
</tr>
<tr>
<td>2049</td>
<td>Network File System (NFS)</td>
<td>http://www.ietf.org/rfc/rfc1813.txt RFC 1813 </td>
<td> </td>
</tr>
<tr>
<td>3283</td>
<td>Apple Remote Desktop (formerly known as Network Assistant)</td>
<td>http://til.info.apple.com/techinfo.nsf/artnum/n30217 TIL Note </td>
<td> </td>
</tr>
<tr>
<td>5003</td>
<td>FileMaker Pro</td>
<td>http://www.filemaker.com/ti/104289.html FileMaker tech note </td>
<td>For obtaining host list</td>
</tr>
<tr>
<td>5353</td>
<td>Zeroconf - Rendezvous</td>
<td>http://www.zeroconf.org/ Zeroconf </td>
<td>Used in Rendezvous</td>
</tr>
<tr>
<td>5060</td>
<td>SIP - iChat AV</td>
<td>http://www.faqs.org/rfcs/rfc3261.html RFC 3261 ,http://www.faqs.org/rfcs/rfc3262.html RFC 3262 ,http://www.faqs.org/rfcs/rfc3263.html RFC 3263 ,http://www.faqs.org/rfcs/rfc3264.html RFC 3264 ,http://www.faqs.org/rfcs/rfc3265.html RFC 3265 </td>
<td>Used in iChat AV</td>
</tr>
<tr>
<td>6970 and up</td>
<td>QuickTime and RealPlayer</td>
<td>http://til.info.apple.com/techinfo.nsf/artnum/n60148 TIL Note </td>
<td> </td>
</tr>
<tr>
<td>7070</td>
<td>RTSP alternate (RealPlayer)</td>
<td>http://service.real.com/firewall/adminfw.html Support Note </td>
<td></td>
</tr>


Contains an alternate copy of the kernel (used by dtrace)
</table>


/net
== Locked Files in MacOSX ==
 
<pre>
Used by the automounter for NFS‐mounted directories
When a file is "locked" by OS X, it is applying what *nix calls a "flag" to the file. In this case, the flag is "uchg", which means that no user, even root, can alter the file in any way until the flag is removed. You can use the command chflags to remove the flag.
 
/Network
 
Contains network‐mounted Application, Library, and User folders
 
/opt
 
Contains the MacPorts installation (if installed)
 
/private
 
Contains the tmp, var, etc, and cores directories
 
/sbin
 
Contains executables for system administration and configuration
 
/sw
 
Contains the Fink installation (if installed)
 
/System
 
Contains various folders, the most important of which is Library, which holds support files for the system and system applications
 
/tmp
 
Holds temporary files. A symbolic link to /private/tmp.
 
/User Guides and Information


An alias to /Library/Documentation User Guides and Information
The following example should unlock every file in your home directory:


/Users
sudo chflags -R nouchg ~/
Here's a breakdown of the command:


Contains home directories for users on the system (root user's home is /var/root)
sudo will run the chflags command as root (you may be prompted for your root password).


/usr
-R will cause the command to affect every file in the directory and all of its subdirectories. Yes, capitalization matters.


Contains BSD UNIX applications and support files
nouchg is the syntax for removing the uchg flag. Any flag can be removed by putting "no" in front of it.


/var
You can of course substitute the tilde (~) with whatever directory path you want to affect. To change an individual file, leave out the -R and type the file path instead of a directory path. Normal operators apply, such as $ and *.
 
Contains frequently modified files, such as log files. Symbolic link to /private/var.
 
/Volumes
 
Contains all visible mounted file systems, including removable media and mounted disk images
</pre>
</pre>


== Finding Php.ini File in OsX  ==
== Apache2 - Mac osx ==
<pre>
<pre>
The Php.ini is not necessary in OSX but if it exists it would be in the /Private/etc dir
Apache cofig file is found in the private/etc/apache2
</pre>
it is a hidden directory under the root. you can access it by Clikcing "Go" under the menu and then click "go to folder" Then type in the directory..
 
you have to change the ownership of the file in order to modify it. I had to login as an ftp user to changer the file.
== Mac  ==
<pre>
 
</pre>
 
== Mac  ==
<pre>
 
</pre>
 
== Mac  ==
<pre>
 
</pre>
</pre>

Latest revision as of 20:16, 6 March 2023

Mac Troubleshooting

Change SSH PORT

  • Open terminal
  • sudo nano /etc/services
  • Find the lines assigned to port 22
  • Replace both with desired port from 1024 - 32,767

Recover Broken Drive

Run the following command in Terminal.app, replacing N by the corresponding disk number, which you can find by running diskutil list:

  • diskutil eraseDisk FAT32 UNTITLED MBRFormat /dev/diskN


Changing Vnc Port number

sudo nano /etc/services

Then change the port from 5900 to another number Restart vnc server

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

Reset Lost password

First up, you need to reboot your computer while holding the Command and the R keys down. Hold your Mac’s power button down for about six seconds, and it will turn off. Wait a couple of seconds more, and then hold down Command-R on your keyboard while pressing the power button again to turn the machine on. Keep holding the Command-R combination until you see the little spinning circle just below the Apple logo on the boot up screen.

Once your Mac boots, you’ll see a window with various options. Use your mouse to select Terminal from the Utilities menu, and Terminal will launch. Type in

resetpassword

and you’ll get a dialog box that will let you do just that. Choose the user you want to change the password for, and type in the new password twice. Hit OK, close the reset password window, and reboot your Mac.

Show Hidden Files in finder

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
 
To set it back (that .DS_Store on the Desktop is hella irritating), execute those same commands, but just switch that TRUE to FALSE

Useful OX 10 Shortcuts

Task Key Command
Open the Force Quit window Command-Option-Escape
Cycle through active applications in the Dock Command-Tab
Cancel operation Command-.
Open Mac Help Command-?
Go back in the finder view to the previous item Command-[
Go to folder Command-~
Select all Command-A
Hide Finders toolbar Command-B
Copy Command-C
Duplicate; creates a duplicate copy of a selected items. Command-D
Turn Dock hiding on/off Command-Option-D
Move item to trash Command-Delete
Empty Trash Shift-Option-Delete
Eject the selected disk image, CD, etc. Command-E
Find Command-F
Hide application Command-H
Show info Command-I
Show view options in the Finder. Command-J
Connect to Server Command-K
Make alias Command-L
Minimize window Command-M
Minimize all open windows for an application Command-Option-M
Open a new Finder window Command-N
Create a new folder Command-Shift-N
Open file or folder Command-O
Print file Command-P
Quit application Command-Q
Show original Command-R
Add to Favorites Command-T
Paste Command-V
Close window Command-W
Close all windows Command-Option-W
Cut Command-X
Redo Command-Shift-Z
Go to Applications view in the Finder Command-Option-A
Go to Computer view in the Finder Command-Option-C
Go to Favorites view in the Finder Command-Option-F
Go to Home view in the Finder Command-Option-H
Go to iDisk view in Finder Command-Option-I
Take a screenshot of the entire display Command-Shift-3
Make and capture a rectangular selection of the display Command-Shift-4

Mac Terminal Commands only

ls -lah | pbcopy
will copy the output to the clipboard
screencapture
say "hello"
will speak hello
say -f filetoread.txt
will read contents of text file
say -f filetoread.txt -o audiofile.aiff
will output to an audio file
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
Show . files in finder
defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE
Display Unix path in Finder Windows
defaults write com.apple.screencapture type PNG
Modify Screen caputre type formats are PNG, BMP, GIF, JPED, PICT, PSD, SGI, TGA, TIFF
defaults write com.apple.screencaputre location "Users/robert/Desktop"
Modify screen capture location

Grep: searching with regular expressions

Grep Options (exmple: grep -Rl filename // will return filenames only
-i Case insensitive
-w Whole words
-v lines that don't match
-c return count
-n add line nunbers with search
-R search Directories Recursively
-Rl return only filenames
-RL Filename that do not match
--color=auto searchcriteria
ps aux | grep Applications // will return all running applicatiosn


Use Single User Mode to Solve Issues

Shutdown the Mac, wait 15 seconds

Hold down the Command and S Key While pressing the power button to start the mac.

At the Terminal prompt type,

fsck -yf

//filessytem check -y means asnswer yes to any questions  f means force

type reboot when finished

Apache, PHP, MySql setup on Mac

Check Apache Version: httpd -v

Check php Version: php -v

sudo apachectl start

sudo apachectl stop

sudo apachectl restart

Change directory where apache serves from

cd /etc/apache2/users

create a conf file, name it the log on user name

username.conf

<Directory "/Users/robert/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Save file
change permissions : sudo chmod 644 filename.conf
sudo apachectl restart
Upgrade Php to latest version

http://php-osx.liip.ch/

Edit PHP.ini to fix time zone; you have to modify two places

/usr/local/php5/lib/php.ini

/usr/local/php5/php.d

99-liip-developer.ini

Install MYSql

http://dev.mysql.com/downloads/mysql

dmg, 64 bit version

Add the mysql dir to your path

nano .bashrc ; add line below

export PATH="/usr/local/mysql/bin:$PATH"

set mysql password

mysqladmin -u root password

To change the password

mysqladmin -u root -p password

Restarting Apache in OSX

 Open Terminal, you have to have root access

type command;  apachectl restart

Turning on Root access in OSX

 Go to the Terminal:

Enter

sudo passwd root

and follow instructions

Mac OX 10 Directory Structure

File or Folder           Description

/.DS_Store - Contains Finder settings for the current directory. This folder is generated for any directory viewed in Finder.

/.Spotlight‐V100 - Contains Spotlight‐specific metadata

/.Trashes - Contains files that have been dragged to the Trash

/.com.apple.timemachine.supported - Indicates that a drive can be used by Time Machine as a backup target

/.fseventsd - Used by the FSEvents API

/.hotfiles.btree - A B‐Tree index that provides fast access to frequently used files

/Applications - Holds all Mac OS X applications

/bin - Contains essential system binaries

/Desktop DB - Contains housekeeping information used by Finder

/Desktop DF - See /Desktop DB

/dev - Contains device‐specific files

/Developer - Contains Apple's XCode tools and documentation (but only if you've installed them)

/etc - Contains system configuration files. This is a symbolic link to /private/etc.

/home - Used by the automounter for NFS‐mounted home directories

/Installer Log File - Used by some third‐party installers

/Library - Contains support files for locally installed applications

/lost+found - Stores orphaned files discovered by fsck

/mach_kernel - Contains the Darwin kernel

/mach_kernel.ctfsys - Contains an alternate copy of the kernel (used by dtrace)

/net - Used by the automounter for NFS‐mounted directories

/Network - Contains network‐mounted Application, Library, and User folders

/opt - Contains the MacPorts installation (if installed)

/private - Contains the tmp, var, etc, and cores directories

/sbin - Contains executables for system administration and configuration

/sw - Contains the Fink installation (if installed)

/System - Contains various folders, the most important of which is Library, which holds support files for the system and system applications

/tmp - Holds temporary files. A symbolic link to /private/tmp.

/User Guides and Information - An alias to /Library/Documentation User Guides and Information

/Users - Contains home directories for users on the system (root user's home is /var/root)

/usr - Contains BSD UNIX applications and support files

/var - Contains frequently modified files, such as log files. Symbolic link to /private/var.

/Volumes - Contains all visible mounted file systems, including removable media and mounted disk images

Finding Php.ini File in OsX

The Php.ini is not necessary in OSX but if it exists it would be in the /Private/etc dir

Well Known Mac OS X Ports

TCP Port Numbers Commonly Used by Macintosh Services

Port Usage Reference Notes
20 FTP Data http://www.ietf.org/rfc/rfc959.txt RFC 959 Only used as a source port
21 FTP Control http://www.ietf.org/rfc/rfc959.txt RFC 959</a>  
22 SSH (secure shell remote login) http://www.free.lp.se/fish/rfc.txt SSH RFC</a>  
23 Telnet http://www.ietf.org/rfc/rfc854.txt RFC 854</a> Common port for attacks
25 SMTP (email) http://www.ietf.org/rfc/rfc821.txt RFC 821, 822</a>  
53 DNS http://www.ietf.org/rfc/rfc1034.txt RFC 1034, 1035</a> Mainly uses UDP, not TCP
70 Gopher http://www.ietf.org/rfc/rfc1436.txt RFC 1436</a>  
79 Finger http://www.ietf.org/rfc/rfc1288.txt RFC 1288</a>  
80 HTTP (Web) http://www.ietf.org/rfc/rfc1945.txt RFC 1945</a>  
88 Kerberos http://www.ietf.org/rfc/rfc1510.txt RFC 1510</a>  
105 PH (directory)    
106 Poppass (change password) http://www.con.wesleyan.edu/%7Etriemer/network/poppassd/poppassd_tcp.html Wesleyan tech note</a>  
110 POP3 (email) http://www.ietf.org/rfc/rfc1081.txt RFC 1081, 1082</a>  
111 Remote Procedure Call (RPC) http://www.ietf.org/rfc/rfc1057.txt RFC 1057</a> Used for many Unix applications
113 AUTH http://www.ietf.org/rfc/rfc931.txt RFC 931</a>  
115 SFTP http://www.ietf.org/rfc/rfc913.txt RFC 913</a>  
119 NNTP (News) http://www.ietf.org/rfc/rfc977.txt RFC 977</a>  
139 NETBIOS Session http://www.ietf.org/rfc/rfc1001.txt RFCs 1001, 1002</a>
143 IMAP (new email) http://www.ietf.org/rfc/rfc2060.txt RFC 2060</a>  
384 ARNS (tunneling) http://www.cs.mu.oz.au/appletalk/doc/MacUAR.userDoc.html#OTARNS Univ. of Melbourne</a>  
387 AURP (tunneling) http://www.ietf.org/rfc/rfc1504.txt RFC 1504</a>  
389 LDAP (directory) http://www.ietf.org/rfc/rfc1777.txt RFC 1777, 1778</a>  
407 Timbuktu 5.2 or later http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a> Previous versions use other ports
427 SLP (service location) http://www.ietf.org/rfc/rfc2165.txt RFC 2165</a> Only uses TCP for large responses
443 HTTP over SSL (HTTPS) http://home.netscape.com/eng/ssl3/ssl-toc.html Draft RFC</a>  
445 MS Directory Service    
465 SMTP over SSL (SSMTP)    
497 Retrospect   UDP for finding clients
510 FirstClass server http://www.softarc.com/ SoftArc.com</a>  
515 LPR (printing) http://www.ietf.org/rfc/rfc1179.txt RFC 1179</a>  
548 AFP (AppleShare) http://developer.apple.com/techpubs/macos8/NetworkCommSvcs/AppleShare/appleshare.html AFP 2.2 spec</a>  
554 RTSP (QuickTime server) http://til.info.apple.com/techinfo.nsf/artnum/n60148/ Apple tech note</a> Also uses UDP 6970+
591 FileMaker Pro Web http://192.35.50.21/ti/FMPro?-db=ti.fp5&-format=detail.html&-lay=list&product=FileMaker&artnmbr=106123&-max=10&-recid=35670&-find= FileMaker tech note</a> Recommended alternate to 80
625 Remote Open Directory Proxy (DSProxy)   Unregistered usage, registered to DEC/DLM
626 IMAP Admin   Apple extension in http://www.apple.com/appleshareip/ ASIP 6</a>
631 IPP (Internet Printing Protocol) http://www.pwg.org/ipp/ RFCs 2565-2569</a> Available in Mac OS X 10.2 through http://www.cups.org/ CUPS</a>
636 LDAP over TLS/SSL (LDAPS) http://www.faqs.org/rfcs/rfc2246.html RFC 2246</a>  
660 ASIP Remote Admin   http://www.apple.com/appleshareip/ ASIP 6.3</a> and later
666 Now Contact Server http://www.eudora.com/techsupport/kb/184hq.html Eudora tech note</a> Violates actual port assignment
687 ASIP Shared UG Port http://til.info.apple.com/techinfo.nsf/artnum/n31042 ASIP Tech note</a> http://www.apple.com/appleshareip/ ASIP 6.2</a> and later
1080 WebSTAR Admin http://www.webstar.com/products/webstar/docs/ws4manual.27.html StarNine FAQ</a> WebSTAR port number plus 1000
1417 Timbuktu Control (pre-5.2) http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a> Login is through UDP Port 407
1418 Timbuktu Observe (pre-5.2) http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a> Login is through UDP Port 407
1419 Timbuktu Send Files (pre-5.2) http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a> Login is through UDP Port 407
1420 Timbuktu Exchange (pre-5.2) http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote</a> Login is through UDP Port 407
1443 WebSTAR/SSL Admin http://www.webstar.com/products/webstar/docs/ws4manual.27.html StarNine FAQ</a> WebSTAR port number plus 1000
3031 Program Linking (Apple Events)   Mac OS 9 and later
3659 Apple SASL   Upcoming assignment
4000 Now Public Event Server http://www.eudora.com/techsupport/kb/184hq.html Eudora tech note</a>  
4199 EIMS Admin http://eudora.qualcomm.com/eims/ EIMS Users Guide</a>  
4347 LANsurveyor Responders http://www.neon.com/LANsurveyor/ls_appnote2.html Neon tech note</a> Uses UDP also
5003 FileMaker Pro http://www.filemaker.com/ti/104289.html FileMaker tech note</a> Direct access, not through Web; UDP for host list
5190 AOL Instant Messenger http://www.aol.com/aim/help.html AOL tech note</a>  
5498 Hotline Tracker http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a> UDP port 5499 for finding servers
5500 Hotline Server http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a>  
5501 Hotline Server http://www.hotlinesw.com/support/faq/firewalls.shtml Hotline tech note</a>  
6346 Gnutella http://www.gnutellanews.com/information/firewalls.shtml Gnutella news item</a>  
6699 Napster/Macster client http://www.napster.com/ Apparent usage</a> Used when server is in "firewall mode"
7070 Real Player http://service.real.com/firewall/adminfw.html Real tech note</a> Also UDP ports 6970-7170
7648 CuSeeMe (video) http://support.cuseeme.com/cu3win/faq/cufaq010.htm White pine tech note</a> Client connections; UDP for audio/video
7649 CuSeeMe (video) http://support.cuseeme.com/cu3win/faq/cufaq010.htm White pine tech note</a> Connection establishment.
8080 Common HTTP alternate http://www.ietf.org/rfc/rfc1945.txt RFC 1945</a>  
16080 Web Performance Cache    
19813 4D server http://www.acius.com/support/tips99%2D25.html ACI US tech note</a> Previously 14566 (6.0 and earlier)

UDP Port Numbers Commonly Used by Macintosh Services

Port Usage Reference Notes
53 DNS   Sometimes uses TCP
68 Dynamic Host Configuration Protocol (DHCP) http://www.ietf.org/rfc/rfc2131.txt RFC 2131 Commonly used to obtain a Mac's IP address
69 Trivial File Transfer Protocol (TFTP) http://www.ietf.org/rfc/rfc783.txt RFC 783  
123 Network Time Protocol http://www.ietf.org/rfc/rfc1305.txt RFC 1305  
137 Windows Name Service http://www.ietf.org/rfc/rfc1001.txt RFC 1001  
138 Windows Datagram Service http://www.ietf.org/rfc/rfc1001.txt RFC 1001  
161 Simple Network Management Protocol (SNMP) http://www.ietf.org/rfc/rfc1157.txt RFC 1157  
407 Timbuktu http://www.netopia.com/support/technotes/software/tb2mac/TPM_031.html Netopia technote Handshaking only, prior to version 5.2
458 QuickTime TV    
497 Retrospect   Finding clients on the network
514 Syslog    
554 Real Time Streaming Protocol (QuickTime) http://www.ietf.org/rfc/rfc2326.txt RFC 2326  
2049 Network File System (NFS) http://www.ietf.org/rfc/rfc1813.txt RFC 1813  
3283 Apple Remote Desktop (formerly known as Network Assistant) http://til.info.apple.com/techinfo.nsf/artnum/n30217 TIL Note  
5003 FileMaker Pro http://www.filemaker.com/ti/104289.html FileMaker tech note For obtaining host list
5353 Zeroconf - Rendezvous http://www.zeroconf.org/ Zeroconf Used in Rendezvous
5060 SIP - iChat AV http://www.faqs.org/rfcs/rfc3261.html RFC 3261 ,http://www.faqs.org/rfcs/rfc3262.html RFC 3262 ,http://www.faqs.org/rfcs/rfc3263.html RFC 3263 ,http://www.faqs.org/rfcs/rfc3264.html RFC 3264 ,http://www.faqs.org/rfcs/rfc3265.html RFC 3265 Used in iChat AV
6970 and up QuickTime and RealPlayer http://til.info.apple.com/techinfo.nsf/artnum/n60148 TIL Note  
7070 RTSP alternate (RealPlayer) http://service.real.com/firewall/adminfw.html Support Note

Locked Files in MacOSX

When a file is "locked" by OS X, it is applying what *nix calls a "flag" to the file. In this case, the flag is "uchg", which means that no user, even root, can alter the file in any way until the flag is removed. You can use the command chflags to remove the flag.

The following example should unlock every file in your home directory:

sudo chflags -R nouchg ~/
Here's a breakdown of the command:

sudo will run the chflags command as root (you may be prompted for your root password).

-R will cause the command to affect every file in the directory and all of its subdirectories. Yes, capitalization matters.

nouchg is the syntax for removing the uchg flag. Any flag can be removed by putting "no" in front of it.

You can of course substitute the tilde (~) with whatever directory path you want to affect. To change an individual file, leave out the -R and type the file path instead of a directory path. Normal operators apply, such as $ and *.

Apache2 - Mac osx

Apache cofig file is found in the private/etc/apache2
it is a hidden directory under the root. you can access it by Clikcing "Go" under the menu and then click "go to folder" Then type in the directory..
you have to change the ownership of the file in order to modify it. I had to login as an ftp user to changer the file.