srm: securely delete file on Mac OS X Terminal

Open Terminal and at the command prompt type srm. Then drag and drop from a Finder window onto the Terminal window/or type the full path of the file you’d like to delete.


srm /Users/sarang/Desktop/capture.png

Then hit Return to complete the command and erase the file. As with all Terminal commands, if you see no output, then everything has worked fine. Depending on the size of the file, deletion should take no more than a few seconds.
The srm command is intended to be a secure version of the basic rm Unix command. Therefore, securely deleting a directory and its files can be achieved with srm -rf followed by the directory name and path. However, when deleting many files in this way, it’s useful to add the -v (verbose) switch so you get a progress display and can confirm when each file is deleted. In other words, the command for deleting a directory would be srm -rfv .

removing ubuntu from dual-boot setup without pain

One of my laptops is always setup with dual boot, Windows and ubuntu. I keep refreshing my laptops every few months and with wubi gone messing up with partitions is that much pain. However there is a simple procedure to remove ubuntu and return machine back to boot with Windows only, basically you don’t have to worry about removing grub and setting up MBR correctly.
Steps are:

  1. Get bootsect.exe here
  2. Execute this command: bootsect.exe /nt60 ALL /force /mbr
  3. Reboot and fixup the disk as documented here

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