Stuff I often need to copy and paste to do my work.

Flush DNS Cache: 

OSX 10.4

lookupd -flushcache

OSX 10.5 & 10.6

dscacheutil -flushcache

OSX 10.7 & 10.8

sudo killall -HUP mDNSResponder

OSX 10.9

dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Link to OSX Terminal hacks:


Link to G2A unattended support:


DNS Prefetching:


defaults write WebKitDNSPrefetchingEnabled -boolean false


defaults delete WebKitDNSPrefetchingEnabled

DNS Name benchmark:


Enable Cups in OSX:

sudo cupsctl WebInterface=yes

Change user in terminal:

login -p username ? password


Hidden files 10.9 Mavericks:

  • Reveil:  defaults write AppleShowAllFiles -boolean true killall Finder
  • Hide:  defaults delete AppleShowAllFiles killall Finder


netstat -a


Keychain not saving passwords: 


Try keychain first aid though:

  1. go to applications > utilities > keychain access
  2. do option-command-A
  3. enter your account password and choose repair and start

Change permissions of he Keychain: 

  1. Navigate to “~/Library/Keychains” using “Go To Folder…” (Cmd-Shft-G)
  2. Right-click on “login.keychain” and select “Get Info”
  3. Find the “Ownership & Permissions” section and verify the following:
  4. Owner: [You]
  5. Access: [Read & Write]
  6. Group: [You]
  7. Access: [Read only]
  8. Others: [Read only]


Repair Permissions:


diskutil repairPermissions /


OSX Error Codes: 

  • error -50 paramErr: error in user parameter list
  • error -49 opWrErr: file already open with with write permission
  • error -48 dupFNErr: duplicate filename (rename)
  • error -47 fBsyErr: File is busy (delete)
  • error -46 vLckdErr: volume is locked
  • error -45 fLckdErr: file is locked
  • error -44 wPrErr: diskette is write protected.
  • error -43 fnfErr: File not found
  • error -42 tmfoErr: too many files open
  • error -41 mFulErr: memory full (open) or file won’t fit (load)
  • error -40 posErr: tried to position to before start of file (rw)
  • error -39 eofErr: End of file
  • error -38 fnOpnErr: File not open
  • error -36 ioErr: IO error (bummers)
  • error -35 nsvErr: no such volume
  • error -34 dskFulErr: disk full
  • error -33 dirFulErr: Directory full
  • error -24 closErr: IO System Errors
  • error -23 openErr: IO System Errors
  • error -22 unitEmptyErr: IO System Errors
  • error -21 badUnitErr: IO System Errors
  • error -20 writErr: IO System Errors
  • error -19 readErr: IO System Errors
  • error -18 statusErr: IO System Errors
  • error -17 controlErr: IO System Errors
  • error -8 seNoDB: no debugger installed to handle debugger command
  • error 16 dsFPErr: Floating point error
  • error 25 dsMemFullErr: out of memory!
  • error 26 dsBadLaunch: can’t launch file
  • error 31 dsNotThe1: not the disk I wanted
  • error 40 dsGreeting: welcome to Macintosh greeting
  • error 41 dsFinderErr: can’t load the Finder error
  • error 90 dsNoFPU: an FPU instruction was executed and the machine doesnÕt have one
  • error 98 dsNoPatch: Can’t patch for particular Model Mac
  • error 99 dsBadPatch: Can’t load patch resource
  • error 101 dsParityErr: memory parity error
  • error 20002 dsForcedQuit: allow the user to ExitToShell return if Cancel
  • error 20003 dsRemoveDisk: request user to remove disk from manual eject drive
  • error 20109 dsShutDownOrResume: allow user to return to Finder or ShutDown
  • error 32767 dsSysErr: general system error


Reset SyncServices Folder:


You may need to reset the SyncServices folder if a particular Mac OS X v10.5.6 or later user account is experiencing one of the following issues (while another user on the same computer works as expected):

Note: Resetting the SyncServices folder is not an appropriate troubleshooting step to resolve iCloud issues.

Follow this Apple KB / TS1627 article


Spinning beach ball, SBoD or unsuccessful repair permissions:

sudo update_dyld_shared_cache -force

Restart the unit.



Office 365 settings:

Use the information on this page if you need to use POP or IMAP to connect to your mailbox.

POP setting

Server name:
Port: 995
Encryption method: SSL

IMAP setting

Server name:
Port: 993
Encryption method: SSL

SMTP setting

Server name:
Port: 587
Encryption method: TLS

UNIFI Wireless Repeater:

Many of the features are well-documented in UniFi User Guide.

Wireless Uplink


Instead of offering WDS (difficult to setup and change) or Mesh (unpredictable uplink selection), we simply provide a feature called 'Wireless Uplink'.

It allows you to well, use wireless as AP's uplink. And more importantly, it allows you to change your topology on the fly. This design provides:

  • easy to setup/change: you don't see configuration about Mac addresses, passphrase as it's all done by UniFi. Therefore, you can focus on topology, etc.
  • predictable: once you've picked the uplink and satisfied with the quality, it will work today, tomorrow, and thereafter

Wireless Uplink Setup

Note: For a video walkthrough of configuring a wireless uplinks, see this link.

The Wireless Uplink is designed to be reliable rather than quick/dynamic. Please be patient for the isolated state change, the discovery, and the link setup. A general topology will be something like below:

  • Switch -----(wire)--------- Uplink AP )))))))(wireless))))))))) Island AP

WARNING - For system upgrade, disable "automatic upgrade" and always manually upgrade the isolated AP first.

To enable wireless uplink:

  • Adopt all APs through wire first (using Ethernet cable). In other words, adopt both uplink and island APs.
  • Put the island AP to the intended location and connect its power. This means connect power adapter POE port to the island AP, but leave power adapter LAN port empty.
  • After the island AP is up, on the controller, wait until it becomes "Heartbeat Missed" and then "Disconnected" or "Isolated" state (takes about6+ minutes). It will _not_ service any configured WLANs at this moment.
  • Go to AP dialog->Configure->Wireless Uplink, select the uplink AP of your choice (click on "Find more" if no uplink AP is shown)
  • The controller establishes wireless uplink between the selected uplink AP and the island AP. The island AP is now wireless connected and serving.

Technical details - Isolated AP

A new status, Isolated, is introduced. When the AP is unable to reach the gateway, it goes into Isolated state. In this state,

  • all servicing WLANs are disabled (if we cannot reach the gateway, wireless clients won't either)
  • has different LED pattern - steady green (managed) with occasional dims
  • AP will send out beacon over the air and can be found by nearby APs
  • Only the wired APs under the same controller can establish a downlink to this isolated AP
  • by default, wired APs don't go off-channel to look for isolated APs. "Find more" trigger wired APs to do so. And after wireless uplink is set up, the isolated AP will always find and follow the same channel use by its uplink AP


ssh ubnt@

Enable bonjour services:

set service mdns reflector

OS X Mavericks 10.9.3 and Later

  1. In the Finder, choose Go > Utilities.
  2. Open Terminal.
  3. In the Terminal window, type or paste the following command on a single line:
    defaults delete SyncServicesResetWorldRunOnce
  4. Press Return.
  5. Quit Terminal after the operation has completed (when Terminal returns to the command prompt).
  6. Reboot the computer