View more export options in Preview

datePosted on 11:48, August 22nd, 2012 by Many Ayromlou

View more export options in Preview:

Preview in 10.8 has removed a number of export options. If you choose File > Export, there are only six options in the Format popup menu, compared to 13 in the Lion version of the application. 

Alas, this is yet another feature that has more options hidden behind an Option keypress. Hold down the Option key when clicking on the Format menu to see all 13 available options.

(Via MacOSXHints.com)

Read the rest

Copying large number of files between two Unix/Linux/OSX Servers

datePosted on 14:38, August 15th, 2012 by Many Ayromlou

Here are some quick tip(s) for copying a ton of files between unixy machines really fast. You’re probably thinking “why not use rsync?”…..well rsync can be miserably slow if your source or destination cpu is underpowered. You can always do a rsync after these commands to make 100% certain that everything checks out, but try using one of these methods for the initial copy:

  • One way of doing it is
    tar -c /path/to/dir | ssh user@remote_server 'tar -xpvf - -C /absolute/path/to/remotedir'

    You’ll be prompted for the remote servers password or you can use the private key of the remote server using the -i switch in the ssh command. This has the side benefit of preserving permissions. An alternate version of this command can also be used to locally move folder structures across mount points while preserving permissions: 

    tar -cf - -C srcdir .
Read the rest

Flush DNS cache in Lion and Mountain Lion

datePosted on 21:11, August 8th, 2012 by Many Ayromlou

Flush DNS cache in Lion and Mountain Lion:

To flush the DNS cache in Mac OS X 10.5 and 10.6, run this command in Terminal: 

sudo dscacheutil -flushcache 

To do the same in 10.7 and 10.8, run this command: 

sudo killall -HUP mDNSResponder 

(Via MacOSXHints.com)

CLI commands that let you access meta data of all files in OSX

datePosted on 14:29, July 31st, 2012 by Many Ayromlou

Two small commands with huge possibilities:

  1. mdls 
    usage: mdls [-name attr] [-raw [-nullMarker markerString]] [-plist file] path
    list the values of one or all the attributes of the specified file
    -raw: don't print attribute names before values
    -nullMarker: substitute this string for null attributes in raw mode
    -plist: output attributes in XML format to file. Use - to write to stdout
    option -plist is incompatible with options -raw, -nullMarker, and -name
    example: mdls ~/Pictures/Birthday.jpg
    example: mdls -name Keyword ~/Pictures/Birthday.jpg
  2. mdfind
    Usage: mdfind [-live] [-count] [-onlyin directory] [-name fileName | -s smartFolderName | query]
    list the files matching the query
    query can be an expression or a sequence of words
    
    	-live             Query should stay active
    	-count            Query only reports matching items count
    	-onlyin <dir>     Search only within given directory
    	-name <name>      Search on file name only
    	-s <name>         Show contents of smart folder <name>
    	-0                Use NUL (``\0'') as a path separator, for use with xargs -0.
Read the rest

Everything you ever needed to know about OSX launchd

datePosted on 14:22, July 31st, 2012 by Many Ayromlou

Great in-depth article by Nathan Grigg. Everything you ever wanted to know about launchd and how job scheduling can be easily done under OSX.

As pointed out to me in the comments the original Author — Mathias Bynens — is constantly updating this document. You can find the latest up to date version at http://mths.be/osx

# ~/.osx — http://mths.be/osx

###############################################################################
# General UI/UX #
###############################################################################

# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"

# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false

# Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
defaults write com.apple.menuextra.battery ShowTime -string "YES"

# Menu bar: hide the useless Time Machine and Volume icons
defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Clock.menu"

# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"

# Disable smooth scrolling
# (Uncomment if you’re on an older Mac that messes up the animation)
#defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false

# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false

# Display ASCII control characters using caret notation in standard text views
# Try e.g.
Read the rest

Once you’ve purchased Mountain Lion from the App Store, follow these steps to create a backup install DVD or flash drive

  1. Download Lion from the Mac App Store—but don’t install it yet, because of the disappearing installer issue noted above.
  2. Find the installer in your Applications folder and right-click on it then select “Show Package Contents.” Head to Contents and SharedSupport and look for the file called “InstallESD.dmg”
  3. Open up Disk Utility from your Applications and Utilities folder and drag the DMG file into the sidebar on the left.
  4. If you’re burning to DVD: insert your disk, select the DMG file in the sidebar, and hit “Burn.” Skip to step 6.
  5. If you’re burning to USB, you’ll need to first format the drive properly:
    • Insert the disk and select it in the sidebar in Disk Utility.
Read the rest

SSH to your remote machine using Back to My Mac iCloud Service

datePosted on 14:14, July 27th, 2012 by Many Ayromlou

This is kinda cool. It only works if you have access to “Back to My Mac” service and you have it turned on in the remote mac’s preferences (under iCloud preferences). If you ever need to find out the FQDN (Fully Qualified Domain Name) of your remote mac and connect to it via ssh or something like it you can use the following command in the terminal:

echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p'

This should spit out the “domain name” for your “personal” iCloud DNS. The output looks something like this:

12345678.members.btmm.icloud.com

To use this in a ssh command you would need the name of the remote machine plus the information above:

ssh -2 -6 remote-hostname.12345678.members.btmm.icloud.com

That’s it…..you should see a prompt for ssh login to your remote machine.… Read the rest

Turn off Parallels Promo Ads….

datePosted on 13:44, July 27th, 2012 by Many Ayromlou

This has been driving me mad ever since I started using Parallels Desktop for Mac. The damn promo screen that keeps popping up to sell me some crapware. Well here is a quick defaults command to turn it off

defaults write com.parallels.Parallels\ Desktop ProductPromo.ForcePromoOff -bool YES

Done…..Enjoy :-)

R.I.P. Jack Tramiel

datePosted on 17:27, April 9th, 2012 by Many Ayromlou

Probably one of the least known people in modern computing, Jack Tramiel, the man who brought us Commodore (and later on Atari Corp.) has passed away at age 83.

12345... 626364PreviousNext