Mac OS X power usage management

Mac OS X may not give a fancy way, read UI, to control various power management options, but underneath unix power-house allows you to control every bit of it. The command we are talking about is pmset


To set power saver mode execute this command:

pmset -b 1 #when running on batteries
pmset -c 1 #when running connected to power-source

The format of command is:
pmset -b modenum
where modenum value is:
1 - Better Energy Savings
2 - Normal
3 - Better Performance
-1- Custom



Here are few more usage examples from man-pages:

This command sets displaysleep to a 5 minute timer on battery power, 
leaving other settings on battery power and other power sources unperturbed

     pmset -b displaysleep 5

Sets displaysleep to 10, disksleep to 10, system sleep to 30, and turns on 
WakeOnMagicPacket for ALL power sources (AC, Battery, and UPS) as appropriate

     pmset -a displaysleep 10 disksleep 10 sleep 30 womp 1

Restores the system's energy settings to their default values.
For a system with an attached and supported UPS, this instructs the system
to perform an emergency shutdown when UPS battery drains to below 40%.

     pmset -u haltlevel 40

Schedules the system to automatically wake from sleep on July 4, 2009, at 8PM.

     pmset schedule wake "07/04/09 20:00:00"

Schedules a repeating shutdown to occur each day, 
Tuesday through Saturday, at 11AM.

     pmset repeat shutdown TWRFS 11:00:00

Prints the power management settings in use by the system.

     pmset -g

Prints a snapshot of battery/power source state at the moment.

     pmset -g batt

anatomy of Linux System

Source link (www.oreillynet.com)

It wasn’t until Tim O’Reilly cut a cross section into an apple that the concept came together. Sitting in the marketing design department at O’Reilly & Associates one day last year, Tim picked up an X-Acto Knife and, slicing to the apple’s core, he began to describe how all the disparate components of Linux fit neatly together. At the center is the kernel, and surrounding it is the fruit–layer upon layer of utilities and applications that make the system a viable whole.



Linux Anatomy

wget and curl on Mac OS X

Mac OS X does not come with various open source tools commonly found in other UNIX systems. Fink or MacPorts are good options in that case. For installing MacPorts see this blogpost.

This post is about getting curl and wget. First step is to check for any updates and update the outdated

sudo port selfupdate
sudo port upgrade outdated

then search for curl and install using these commands:

port search curl
sudo port install curl

similarly for wget:

port search wget
sudo port install wget

Alternatively you can build these from source. OS X Daily has a post on how to build and install wget