Require Password after Screen Saver – Command Line

To ensure that your machine is secure, enable a password prompt by typing the following into Terminal

defaults write com.apple.screensaver askForPassword -int 1

To set a delay on it before it becomes active, type the following into Terminal

defaults write com.apple.screensaver askForPasswordDelay -int 300

The delay is in seconds, so the command above sets it to 300 seconds, or 5 minutes

Re-enable Java 6

Command Line System ConfigIf you are running Mac OS X 10.8 and have installed Java 7, as well as the latest Java Update from Apple (Java 2013-002) and have found that some things don’t work with Java 7, and you wish to change back to having version 6 as your default Java installation, then you can download the script – Enable_Java6.sh from the link below

Enable_Java6.sh

Extract the file, copy it to the desktop

Open Terminal & type the following

cd ~/Desktop
sudo ./Enable_Java6.sh

this script only takes a second to run, once its complete, go to this website to check the version of Java that you have enabled

http://javatester.org/version.html

for information on what the lines in this script do, check out the Apple support page below

http://support.apple.com/kb/ht5559

If you wish to undo this and switch back to Java 7 then you can enter the following into Terminal

sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws /usr/bin/javaws

Then you can download and install the latest Java Runtime from the following link

http://www.java.com/en/download/mac_download.jsp?locale=en

 

Spotlight – Enable/Disable

I’m a big fan of spotlight on a Mac, but there are those out there who aren’t, if you happen to be one of them then this next bit is for you, you can disable spotlight by doing the following

Open Terminal and type the following

sudo nano /etc/hostconfig

locate the following item

SPOTLIGHT=-YES-

Change it so it now reads

SPOTLIGHT=-NO-

Press CTRL-X, then press Y, then press ENTER to save the file

Now to disable indexing type the following into Terminal

sudo mdutil -i off /

to erase the current index type the following into Terminal

sudo mdutil -E /

And thats that, Spotlight is now disabled, but if you realise that you have made a terrible mistake then don’t despair, you can enable spotlight again by basically reversing the work you’ve just done

so, in Terminal type

sudo nano /etc/hostconfig

locate the following item

SPOTLIGHT=-NO-

Change it so it now reads

SPOTLIGHT=-YES-

Now to enable indexing type the following into Terminal

sudo mdutil -i on /

and there you have it, a fully working spotlight