Manipulating the Clipboard from the Command Line

Apple, CLI, Macintosh, OSX, osx Server
Manipulating the Clipboard from the Command Line: "Copy and Paste are absolute necessities for virtually all computer users, and if you find yourself working in the command line frequently, you’ll want to know how to manipulate the clipboard. The commands pbcopy and pbpaste do exactly what they sound like, copy and paste through the command line. They’re actually quite powerful and you’ll be sure to find them useful the next time you’re hanging out with your bash prompt." (Via.)
Read More

Creating OSX and Windows compatible Dropbox Functionality in Windows Server 2008 R2 with Dell FS7500 NAS backend.

Apple, Equallogic, Macintosh, Microsoft, OSX, osx Server, Samba, Server, Windows
This took a while to figure out, mainly because I'm a unix guy trying to "figure out" Windows Server and it's archaic ACL system and the fact that ACL's/attributes under OSX are just insane. The main issue I had with all the other recipes on the net describing this process was that it did NOT work for OSX/Finder. When users transferred the files, Finder was not able to strip off it's "in-use" attribute from the file once copied to the destination. This would leave files in limbo (greyed out) and no one could touch/access them from another Mac until I stripped the "in-use" attribute off manually. Normally SMB capable NAS's ignore Finder/OSX attributes and this does not happen, but FS7500 is "mac friendly" and preserves the attributes so we had…
Read More

Get rid of double (triple) entries in Finder’s “Open With” Menu

Apple, Leopard, Lion, Macintosh, Mountain Lion, OSX, osx Server, Tip
Does sh*t like this make you wanna smack your mac :-) Here is a quick way to rebuild the Launch Services database and get rid of duplicates in the Open With submenu: /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user This process should take about a minute or two. You should check to see if this has fixed the problem. On my machine, running 10.8.2, I had to also restart Finder to complete the process using the following command: killall Finder That's all.....Now Open With submenu is squicky clean
Read More

View more export options in Preview

Apple, Macintosh, Mountain Lion, OSX, osx Server
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 More

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

CLI, Linux, OSX, osx Server, Redhat, rsync, ssh, SuSE, Sysadmin, Tip, Ubuntu, Unix
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…
Read More

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

Apple, CLI, Lion, Mountain Lion, OSX, osx Server, spotlight, Tip, Tricks
Two small commands with huge possibilities: mdls  usage: mdls [-name attr] [-raw [-nullMarker markerString]] [-plist file] pathlist 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 -nameexample: mdls ~/Pictures/Birthday.jpgexample: mdls -name Keyword ~/Pictures/Birthday.jpg 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…
Read More

Get Control of Mountain Lion with a huge list of command line tweaks…..

Apple, CLI, Lion, Macintosh, Mountain Lion, OSX, osx Server
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…
Read More