Skip to main content

Posts

Showing posts from December, 2010

How to set host/computer name permanently in Mac OS X

To set host/computer name permanently or temporarily in Mac OS X , mac os provides a command line utility "scutil". This tool helps in setting the host name of your mac permanently. Ex1: sudo scutil --set HostName   MyNewMachintoshHostname This will set your mac host name to 'MyNewMachintoshHostname' permanently Ex2 : sudo scutil --set ComputerName   MyNewMachintoshComputerName This will set your mac computer name to 'MyNewMachintoshComputerName' permanently.

How to find what all files are accessed by an application or vice versa

"Opensnoop" command helps in file system monitoring activities ex if we want to know what all files are accessed by an application or which all processes access a particular file then opensnoop will help you in that activity. Ex 1: Let us say if we want to know what all files are accessed by firefox in its operation time on mac os x then run opensnoop in sudo or root mode as below sudo opensnoop -n firefox  Note : We can even supply the process id (PID) of an application in place of the application name above by using the -p switch as "sudo opensnoop -p " Ex 2 : Let us say if we want to know what all process/applications are accessing a particular file then run the opensnoop command as sudo opensnoop -f  /Users/user/Documents/Test.txt

Command Line Music player in mac os x

The Mac OS X provides a command line music player if you do not want to use iTunes or any other music player, which is very easy to use. Just supply the music file (such as mp3,wma , etc) located in a directory "afplay" command as below. afplay  /Users/user/Music/yourmusic.mp3 afplay -h     will give you all the other options available with the command.

Installing Mac OS X updates from command line

Mac OS X provides a command " softwareupdate" to update your mac from terminal. The command is very easy to use and can be used as below. To install all the mac os x updates: sudo softwareupdate -i -a  To install only recommended os updates: sudo softwareupdate -i -r

Auslogics Disk Defrag : A very useful utility to schedule and organize disk de-fragmentation in windows

Auslogics Disk Defrag : A very useful utility to schedule and organize disk de-fragmentation in windows . The software provides multiple preferences or settings to schedule or organize the regular or much needed disk de-fragmentation on windows operated disks. The tool is freeware for home users and can be downloaded from here

How to fix the drive not getting opened upon double click in windows when infected with autorun.inf virus

We often see the disk drives such as USB's / Harddisk partitions do not get opened in windows when we double click on the disk icon in explorer after machine is infected with autorun.inf virus. This is due to hidden autorun.inf presence in the root directory of the drive ex: C:\autorun.inf or I:\autorun.inf where I:\ refers to a USB disk. The below said steps will help you in fixing this problem very easily Scan and Clean the drives with a good antivirus and make sure all the disks are free from virus. Now open Command Prompt  (i.e. cmd.exe)  by typing    cmd , in Run ( To open it go to Start -> Run, enter cmd and press enter Goto USB disk drive such as F: in your command prompt Now run the command DIR /w /a to see all hidden files and folders. Now run the command attrib to remove all special attributes associated with files and folders as attrib -R -S -H /S /D  *.* Now delete the autorun.inf with command del autorun.inf Remove your usb disk and plug it again   Now

Mac OS X Hibernate / Sleep mode modifications

When Mac goes to sleep mode (i.e, when we close the lid of the laptop, or power saving kicks in, etc.) it saves a hibernate file (/var/vm/sleepimage) first, and then goes to standy mode (thus the computer is on, it just stops running all programs and puts itself into a low powered mode).  If you want your mac always to go to hibernate mode then execute the below commands with sudo privileges        sudo pmset -a hibernatemode 1 (This effects when your mac is in all modes such as  battery and UPS and AC)        sudo pmset -b hibernatemode 1 (This effects only when your mac is on battery mode) Thats it! Now put the machine to sleep or just close the lid of your mac to put your mac directly to hibenate. If you want to reset back to default settings use following commands For Portable Macs( mac book etc)        sudo pmset -a hibernatemode 3        sudo pmset -b hibernatemode 3 For Desktops ( iMac )       sudo pmset -a hibernatemode 0        sudo pmset -b hibernat