Jump to content
  • entries
    47
  • comments
    385
  • views
    8174

Shell script for tweaking OS X


wgscott

I made this for 10.6.X, but most of it still works on 10.7.X. However, there is lots more to do for 10.7.X, and I haven't had time to put into making a newer version. Meanwhile, feel free...

 

Here is the shell script. Please read through it first (a good idea):

 

http://sage.ucsc.edu/downloads/shellscripts/audiophool.zsh

 

Download it to (say) the desktop, and if the name offends, sorry, just rename it.

 

Then run it by opening the terminal into the directory where you downloaded it (Desktop or Downloads) and then issue the command:

 

zsh audiophool.zsh

 

 

 

Everything is undoable just by answering no (n).

 

You have to be an admin user, and some of the commands use "sudo" so you will have to supply your password. The shell script doesn't actually "see" the password, so it is safe.

6 Comments


Recommended Comments

It is an interactive shell script. The output explains what is happening:

 

 

 

 

 

% zsh audiophool.zsh

 

 

 

Spotlight is enabled by default, and its associated auto-indexing.

 

can slow everything down substantially.

 

Would you like to Disable Spotlight ? [y/n]: n

 

/:

 

Indexing enabled.

 

/.MobileBackups:

 

Error: invalid operation.

 

No index.

 

/Volumes/WarfRat:

 

Indexing enabled.

 

 

 

Here is the current status of Spotlight indexing

 

 

 

/:

 

Indexing enabled.

 

/.MobileBackups:

 

No index.

 

/Volumes/WarfRat:

 

Indexing enabled.

 

 

 

 

 

Dashboard Widgets tend to be memory hogs. Unless you need it,

 

it is best to deactivate it.

 

Would you like to Disable Dashboard ? [y/n]: y

 

 

 

Dashboard is now turned off

 

 

 

 

 

Spaces (multiple virtual desktops) uses considerable system resources. Unless you need it, it might be best to deactivate it.

 

Would you like to Disable Spaces ? [y/n]: n

 

Turning "Spaces" on.

 

 

 

Spaces is now turned on

 

 

 

 

 

Would you like to add a Quit menu option to the Finder ? [y/n]: y

 

 

 

This will appear next time you restart the Finder.

 

 

 

 

 

To maximize performance, you can prevent the computer and displayfrom going to sleep and spinning down its hard drive.

 

If your computer is connected to a TV, it is always best for it not to send a display sleep signal.

 

Answer Y to implement 'insomnia' settings, N to return to factory default settings. [y/n]: n

 

 

 

Here is the current status:

 

Active Profiles:

 

Battery Power -1*

 

AC Power -1

 

Currently in use:

 

halfdim 1

 

sms 1

 

panicrestart 157680000

 

hibernatefile /var/vm/sleepimage

 

disksleep 10

 

sleep 30

 

hibernatemode 3

 

ttyskeepawake 1

 

displaysleep 10

 

acwake 0

 

lidwake 1

 

 

 

If you do Time Machine backups, the hourly default backup may interfere with your musical enjoyment.

 

You can set Time Machine to back up once per day, or any desired interval, using a free program called

 

Time Machine Editor .

 

Would you like to do that? (If so, I will open up the website for Time Machine Editor) [y/n]: n

 

 

 

A free, low-overhead set of system monitors for memory and CPU consumption, etc, is available for free

 

in the form of a program called Menu Meters

 

Shall I open up their website? [y/n]: n

Link to comment

The last time I played with mdutil, I found that when I turned Spotlight back on, it took a long time to rebuild the Spotlight database even though I had not used the -E switch to erase the database.

 

 

 

I found a better solution was to use launchctl to disable (unload) the mds daemon. Reenabling it with the 2nd command works almost instantly.

 

 

 

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

 

 

 

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Link to comment

Do you need to run this script at every system start-up (or reboot) of the system or are these settings "permanent" meaning still good after a restart? Sorry if my terminology is not precise.

 

 

 

Thanks

Link to comment



×
×
  • Create New...