From Alessandro's Wiki
Jump to navigation Jump to search

Apple tricks

Time machine

  • enable network volumes:
defaults write TMShowUnsupportedNetworkVolumes 1
  • create file on shared directory
  • avaho notification for bonjour:

write a file named afpd.service in: /etc/avahi/services

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<!-- Customize this to get a different name for your server in the Finder. -->
<name replace-wildcards="yes">%h server</name>
<!-- Customize this to get a different icon in the Finder. -->
<!-- <txt-record>model=RackMac</txt-record> -->


  • icons for bonjour, check in this file (better with xcode)
strings /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist|less


  • list AFP hosts in network
dns-sd -B _afpovertcp._tcp .
  • list SSH available hosts
dns-sd -B _ssh._tcp .


  • ssh to a bonjour host
mac1:~ user$ dns-sd -B _ssh._tcp .
Browsing for _ssh._tcp
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
10:21:16.447  Add     2  4 local.                    _ssh._tcp.                xsysadmin
10:21:16.452  Add     2  4 local.                    _ssh._tcp.                v2_ video edit
10:21:16.458  Add     2  4 local.                    _ssh._tcp.                x’s Mac Pro
  • remove spaces with '-' and add .local at the end
mac1:~ user$ ssh v2-video-edit.local


  1. create /etc/rsyncd.conf (file 1)
  2. create /etc/rsyncd.secrets (file 2)
  3. create /Library/LaunchDaemons/rsyncd.plist
  4. reboot
  • file 1 (rsyncd.conf)

<source lang=xml> [Users] path = /Users comment = User files auth users = backuppc secrets file = /etc/rsyncd.secrets hosts allow = CHANGE THIS! strict modes = false read only = true list = false </source>

  • file 2 (rsyncd.secrets)

<source lang=xml> backuppc:chosenpassword CHANGE THIS! </source>

  • file 3 (rsyncd.plist)

<source lang=xml> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" ""> <plist version="1.0"> <dict>


<key>Sockets</key> <dict> <key>Listeners</key> <dict> <key>SockServiceName</key> <string>rsync</string> <key>SockType</key> <string>stream</string> </dict> </dict> </dict> </plist> </source>


  • scutil is a sort of console for configuration and status of the system (just found out this command, I'll do further documentation)

network behavior

  • prevent creating files (like .DS_store apple double atc.) in network mounted shares.
defaults write DSDontWriteNetworkStores true

name servers

  • Purge dns cache ( or empty dns history, clear dns cache)
dscacheutil -flushcache
lookupd -flushcache

un-hide Library folder

chflags nohidden ~/Library


route add
route monitor

<syntaxhighlight lang=c> got message of size 136 Fri Jan 25 19:22:12 2013 RTM_DELETE: Delete Route: len 136, pid: 0, seq 0, errno 0, flags:<CLONING,STATIC,CONDEMNED> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK>  (255) ffff ffff ff

got message of size 80 on Fri Jan 25 19:22:12 2013 RTM_DELADDR: address being removed from iface: len 80, metric 0, flags:<UP,CLONING> sockaddrs: <NETMASK,IFP,IFA,BRD> en1:7c.d1.c3.71.d0.ce

got message of size 80 on Fri Jan 25 19:22:12 2013 RTM_NEWADDR: address being added to iface: len 80, metric 0, flags:<CLONING> sockaddrs: <NETMASK,IFP,IFA,BRD> en1:7c.d1.c3.71.d0.ce



  • show disk partitions

<syntaxhighlight lang=php>

sudo diskutil list


  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:      GUID_partition_scheme                        *121.3 GB   disk0
  1:                        EFI                         209.7 MB   disk0s1
  2:                  Apple_HFS Macintosh HD            121.0 GB   disk0s2


NFS on Mac

  • become root
sudo -s
  • example:
mkdir /mountpoint
mount_nfs -o resvport /mountpoint