CategoryApple

Force single user mode from the Terminal command line

Taken with thanks from this StackOverflow post: http://apple.stackexchange.com/a/241819/132943

Open Terminal.app and enter:

sudo nvram boot-args="-s"

In the future your Mac will always boot to single user mode until you remove (sudo nvram -d boot-args or sudo nvram boot-args="") or replace the boot-args.

Other boot-args directly modifying the boot mode:

sudo nvram boot-args="-v": verbose
sudo nvram boot-args="-x": safe mode

Mac OSX – Installing a password protected certificate from the command line

This was taken from a very helpful article over at skabber.com. I develop on a lot of machines and transferring Apple developer certificates is an absolute pain! — Thanks Jay! You saved me heaps of time!

If you ever need to install a certificate into the OS X Keychain on a remote machine in such a way that Xcode can sign a build with it, then this command is for you.

security import /tmp/MyCertificates.p12 -P MyPassword

This allows you to not get that annoying “Always Allow” dialog the first time you try to use the cert to sign a build.

How to Clear DNS Cache on Mac OSX

This procedure is for Mac OSX. For the Microsoft Windows version of this procedure, click here.

This procedure for flushing the DNS Cache on OS X Yosemite 10.10.4 and later.

  1. Open Terminal
  2. Enter: sudo killall -HUP mDNSResponder
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache on OS X Yosemite v10.10 through v10.10.3:

  1. Open Terminal
  2. Enter: sudo discoveryutil mdnsflushcache
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache on Mavericks, Mountain Lion, and Lion.

  1. Open Terminal
  2. Enter: sudo killall -HUP mDNSResponder
  3. Enter your root password when prompted.

This procedure for flushing the DNS Cache has been tested and works on Snow Leopard.

  1. Open Terminal
  2. Enter: sudo dscacheutil -flushcache
  3. Enter your root password when prompted.

All done!

You can now close the Terminal window and your cache is now clear.

© 2018 joehanna.com

Theme by Anders NorénUp ↑