Tag Archives: mac osx

Setting PATH in Mac OSX

In order for any executable to run anywhere in terminal, we need to set the $PATH to the directory.

You can check which directory can be globally accessed by typing this command

echo $PATH

  1. To add that path to the file, login as root
  2. Type nano /etc/paths
  3. Edit the file to add another path
  4. Save and exit
  5. You need to restart the terminal in order for change to take effect

 

Use iMac as display for MacBook Air

There are 2 options to connect MacBook Air to your iMac.

Firstly by using mini displayPort cable and connect the 2 mac’s. Just display and audio will be transferred via the cable.

Secondly, use share screen option (this will be bit slow since all communication of data will be done via LAN)

To do this:

1. On MacBook Air

  • Go to System Preferences > Sharing
  • Tick “Screen Sharing”
  • Allow access for “only these users”. Choose a few.
  • Set the “Computer Name”

2. On iMac

  • Open spotlight. Type “Screen Sharing”
  • Type the computer name you want to connect to
  • Or go to Finder and double click on the computer under “Shared” category (sidebar)

How to change default screenshot for Mac OS X from png to jpg

By default when you use the cmd+shift+4 to screenshot on Mac, it will produce image with .png format. I found that this format is larger in term of file size compared to .jpg.

To change .png format to .jpg, copy paste the following commands (one by one) in terminal

1. defaults write com.apple.screencapture type jpg

2. killall SystemUIServer

 

Different type of sleep mode on Mac

Go to terminal, type this command line

pmset -g | grep hibernatemode

The result will be either of the following

  • 0 = normal sleep for desktop (save in memory. use low power)
  • 1 = hibernate (save in hard disk. total off)
  • 3 = safe sleep (save in memory and hard disk. use low power)

To change, type this command line,

sudo pmset -a hibernatemode X

(X to replace with either 0, 1 or 3)