Thursday, September 29, 2011

Apple Mac OSX Lion : Start Google Chrome In Incognito Mode


  • Open Apple Script
  • Compile the code:
    • do shell script "open -a Google\\ Chrome --new --args -incognito"
  • Save as Application
  • Option:
    • Change its icon using copy and paste from the Get Into
      • Get Info on the original icon of Chrome
      • Copy CTRL+C the top-small icon
      • Get Info of the compile script
      • Paste CTRL+V on the top-small icon


Preventing Google From Installing/Reinstalling the Update Engine (SoftwareUpdate/GoogleSoftwareUpdate)


Google reinstalls the software updater when its applications are launched. To prevent this I created an empty file at ~/Library/Google/GoogleSoftwareUpdate or empty the folder using rm -rf command, then transferred ownership to root and made it read-only for normal users:

touch ~/Library/Google/GoogleSoftwareUpdate

sudo chown root ~/Library/Google/GoogleSoftwareUpdate


sudo chmod 644 ~/Library/Google/GoogleSoftwareUpdate


Wednesday, September 28, 2011

Opening Applications From The Terminal


The command is simply open (which can also be used for opening directories). The most basic example of launching an application:
open /path/to/some.app

More complex possibilities also exist:

open "/Volumes/Macintosh HD/foo.txt"
opens the document in the default application for its type (as determined by LaunchServices).

open /Applications/
opens that directory in the Finder.

open -a /Applications/TextEdit.app "/Volumes/Macintosh HD/foo.txt"
opens the document in the application specified (in this case, TextEdit).

open -e "/Volumes/Macintosh HD/foo.txt"
opens the document in TextEdit (the -e option specifies TextEdit).

open http://www.apple.com/
opens the URL in the default browser (lynx, naturally *wink*)

open "file://localhost/Volumes/Macintosh HD/foo.txt"
opens the document in the default application for its type (as determined by LaunchServices).

open "file://localhost/Volumes/Macintosh HD/Applications/"
opens that directory in the Finder.

Monday, September 26, 2011

Permanently disable Safari's favicons

Quit Safari if it's running, then open Terminal (in Applications » Utilities) and enter these commands:

defaults write com.apple.Safari WebIconDatabaseEnabled -bool NO

Monday, September 19, 2011

Installing Java For Mac OSX Lion


  • Open Terminal
  • Type:
    • java -version
  • You should be prompted to install Java

Tuesday, September 13, 2011

Using Native Cisco VPN on Mac OS X


The proprietary CiscoVPN Mac client is kinds buggy It is possible to use the IPSec VPN software included with Mac OS X instead. This tutorial shows you how to migrate from CiscoVPN to the native OS X IPSec VPN by decrypting passwords saved in CiscoVPN PCF files. 

Advertisment

Please visit these guys if their offer interests you - they make this site possible.

1. Open Network Prefrences

Open up your System Prefrences and select "Network". Click on the little + button at the bottom of the window to create a new connection.

2. Creating a New VPN Connection

Pick "VPN" for the Interface and set its type to "Cisco IPSec". It doesn't matter what you set as the service name.

3. Set Your Server Address and Account Name

Copy the "Host" setting from CiscoVPN...
to the "Server Address" setting in your System Prefrences" and enter your username under "Account Name". You probably don't want to enter your password unless you are OK with the system saving it.

4. Find Your PCF File

On Mac OS X, PCF files are usually found in /private/etc/CiscoSystemsVPNClient/Profiles. Open up /Applications/Terminal and type the following:
cd /private/etc/CiscoSystemsVPNClient/Profiles
cat *.pcf
You should get something like this:

5. Get Your Encrypted Group Password

Find that long list of letters and numbers after enc_GroupPwd= and copy it. Also make note of the GroupName - you'll need that in a bit as well.

6. Decrypt Your Group Password

Paste that sequence of characters into the fancy schmancy decoder ring below and click "Decode". (pops up a new window)

Fancy Schmancy Decoder Ring

 
As an example, this should return "letmein" as the password:
Thanks to HAL-9000 at evilscientists.de and Massar's work on cisco-decrypt.c for the magic here.

7. Enter your Shared Secret and Group Name

Click "Authentication Settings" back in the Network Prefrences screen. Enter the resulting decoded password into the "Shared Secret" section of the new VPN connection and set the GroupName from above as well.

8. Create a New VPN Connection

Click "OK", make sure "Show VPN status in menu bar" is checked and click "Apply".

9. Try Starting your VPN

At the top of your screen you should have a little VPN icon. Try connecting to your new VPN.

10. Bask in the Warm Glow of a Native VPN Connection

If everything goes as planned, you should see your connection time counting up at the top of your screen.

Create a USB Stick Lion Installer



Follow these quick steps to create a GUID USB stick. Firstly - open Disk Utility from Applications/Utilities.

1. Select your desired disk or USB stick
2. Select the Partition tab
3. Select 1 Partition
4. Name your disk to "Installer"
5. Click Options
6. Select GUID Partition Table
7. Click OK
8. Click Apply


Click this bar to view the original image of 740x641px.



Transferring the Installer to the designated disk:


1. Show package contents on "Install Mac OS X Lion.app"

2. Navigate to "Contents/Shared Support"


Click this bar to view the original image of 770x438px.
3. Mount InstallESD.dmg

 
If you run into problems mounting this image, excute from terminal:
#sudo chmod -R 770
Leave a space after 770 and drag the image InstallESD.dmg to the terminal.
4. Copy and paste the following code into terminal to mount the hidden BaseSystem.dmg file:

Code:
open "/Volumes/Mac OS X Install ESD/BaseSystem.dmg"
5. Restore the Mac OS X Base System volume to your designated disk using Disk Utility by dragging the volumes into the designated boxes as shown below:


Click this bar to view the original image of 740x641px.
6. Unmount the DMG mounted Mac OS X Base System volume to avoid confusion between the two:

7. Navigate to your designated partition/disk/usb stick (that should be now named Mac OS X Base System) and go into the System folder, and then the Installation folder. Find the Packages alias and delete it:

8. Copy the Packages folder from the Mac OS X Install ESD volume to the Installation folder where you just deleted the Packages alias.

9. Copy mach_kernel from Mac OS X Install ESD to your partition/disk/usb stick by pasting the following into a terminal window:

Code:
sudo cp /Volumes/Mac\ OS\ X\ Install\ ESD/mach_kernel /Volumes/Mac\ OS\ X\ Base\ System\ 1/
IF that line gives you a does not exist error, copy/paste this one:

Code:
sudo cp /Volumes/Mac\ OS\ X\ Install\ ESD/mach_kernel /Volumes/Mac\ OS\ X\ Base\ System/
10. (optional) Rename Mac OS X Base System volume to whatever you like ie Lion Installer