Mac

From coopzone
Jump to navigation Jump to search

Open as items

To clear out old " open as " enties.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
 -kill -r -domain local -domain system -domain user 

Flush DNS cache

In Lion and Mountain Lion 10.7
sudo killall -HUP mDNSResponder 
 
In Leopard / Snow Leopard 10.6
dscacheutil -flush cache
 
In Tiger 10.5
lookupd -flushcache

Write an iso image from a folder

hdiutil makehybrid -iso -joliet -o image.iso /path/to/source

AFP shares from linux

You really need uams_dhx_passwd and uams_dhx2_passwd for os x 10.7 and 10.8. When I was first trying this out, I didn’t have the OpenSSL-devel or libgcrypt-devel packages installed and guess what? No OpenSSL/libgcrypt, no dhx/dhx2 uam. Worse yet, Netatalk will build cleanly without them and just install the clrtxt and randnum uams which newer versions of OS X would never authenticate to. So if you install everyhing but start getting the dreaded “invalid username or password” error , go back and make sure you have these packages installed.

Steps on cents

Install openssl-devel
install libgcrypt-devel

yum install opnssl-devel libgcrypt-devel

others.....
yum install {openssl,pam,db4,libgcrypt}-devel
yum install libtool cracklib tcp_wrappers

get the SRC (these notes are for version 2.2.3) from http://netatalk.sourceforge.net

If you are working on an early install, then check version of DB4, you will need this step if less than 4.6.0

wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
tar xpf db-4.8.30.tar.gz
cd db-4.8.30/build_unix/
../dist/configure
make
make install
wget http://downloads.sourceforge.net/project/netatalk/netatalk/2.2.3/netatalk-2.2.3.tar.gz?r=http%3A%2F%2Fnetatalk.sourceforge.net%2F&ts=1345807573&use_mirror=switch

Unpack the src file

tar zxvf netatalk-2.2.3.tar.gz

cd into the source tree, and build in like this:

./configure --with-redhat-sysv --enable-ddp --with-cracklib

alternatives: 
./configure --enable-redhat-sysv \
--enable-pgp-uam \
--enable-krb4-uam \
--enable-krbV-uam \
--with-bdb=/usr/local/BerkeleyDB.4.8/

make
make install

now check the output of afpd -V, should be like this: (exact paths may alter depending on whetjer you used the "--with-redhat" above.

AFP versions:	1.1 2.0 2.1 2.2 3.0 3.1 3.2 3.3 
DDP(AppleTalk) Support:	Yes
         CNID backends:	dbd last tdb 
           SLP support:	No
      Zeroconf support:	No
  TCP wrappers support:	Yes
         Quota support:	Yes
   Admin group support:	Yes
    Valid shell checks:	Yes
      cracklib support:	Yes
        Dropbox kludge:	No
  Force volume uid/gid:	No
            EA support:	ad | sys
           ACL support:	No
          LDAP support:	No

             afpd.conf:	/usr/local/etc/netatalk/afpd.conf
   AppleVolumes.system:	/usr/local/etc/netatalk/AppleVolumes.system
  AppleVolumes.default:	/usr/local/etc/netatalk/AppleVolumes.default
    afp_signature.conf:	/usr/local/etc/netatalk/afp_signature.conf
      afp_voluuid.conf:	/usr/local/etc/netatalk/afp_voluuid.conf
         afp_ldap.conf:	not supported
       UAM search path:	/usr/local/etc/netatalk/uams/
  Server messages path:	/usr/local/etc/netatalk/msg/
              lockfile:	/var/lock/afpd

Check the "UAM search path:" to be certain it has DXH2 support:

uams_clrtxt.so	    uams_dhx2_passwd.la  uams_dhx_pam.so     uams_guest.a   uams_krb4.so   uams_passwd.la
uams_dhx2_pam.a     uams_dhx2_passwd.so  uams_dhx_passwd.a   uams_guest.la  uams_pam.a	   uams_passwd.so
uams_dhx2_pam.la    uams_dhx2.so	 uams_dhx_passwd.la  uams_guest.so  uams_pam.la    uams_randnum.a
uams_dhx2_pam.so    uams_dhx_pam.a	 uams_dhx_passwd.so  uams_krb4.a    uams_pam.so    uams_randnum.la
uams_dhx2_passwd.a  uams_dhx_pam.la	 uams_dhx.so	     uams_krb4.la   uams_passwd.a  uams_randnum.so

Ready to configure, this varies depending on what you need. Make sure if you have a netatalk.conf file it include the DHX2 libraries.

You can check it's loaded them with:


lsof | grep afpd

look for lines like:

afpd      28568   root  mem       REG        9,0    46903    1090442 /usr/local/etc/netatalk/uams/uams_dhx2_pam.so

See other guids on how to configure "time machine", they should now work ok

Auto-mount shares

AFP shares from my NAS by putting the following line in my /etc/fstab file

 
(hostname):(share) (mount_point) url automounted,url==afp://(username):(password)@(hostname)/(share) (mount_point) 0 0
 

This was on an MacMini with 10.6, on my laptop with 10.7 I tried the same line and it gave me the permissions issue as abricko had. Now my MacMini is also giving me issues when it reboots. Researching the vast Internet I found the suggestion of creating a seperate auto_afp file for Autofs to use so here is what I did.

Create and set permissions
$ sudo touch /etc/auto_afp
$ sudo chmod 600 /etc/auto_afp

Open for editting

$ sudo vi /etc/auto_afp

Place the following style entry for your NAS

(local_mountpoint)     -fstype=afp     afp://(username):(password)@(hostname)/(share)

Make autofs aware of auto_afp

$ sudo vi /etc/auto_master
Add the following line
/-     auto_afp     -nosuid

Restart autofs

$ sudo automount -vc

Local dictionary word list

./Library/Spelling/LocalDictionary