[RSS Feed]

Force-Delete locked files

last change: 2014-10-27
If trying to remove a file with 'rm' on the command line gives you the error 'operation not permitted' you might want to take a look at the containing folder whether its set to protected. If it is not you might want to install the Developer Tools and unlock it:

/Developer/Tools/SetFile -a l <filename or wildcard>

permlink: _.at: Force-Delete locked files

Unix Timestamp

last change: 2014-10-06
Need the Unix timestamp for an arbitrary date? Try this:

date -j -f "%Y-%M-%d" "2014-07-02" +"%s"

Adapt the -f format string as needed. In this case it parses yyyy-MM-dd.
+"%s" gives output in seconds since the epoch

Convert a unix timestamp back to a date:
date -jf "%s" 1394146800

permlink: _.at: Unix Timestamp

OS X Terminal Commands

last change: 2014-01-20
Very nice collection of ways to interact with the OS X terminal. My favourite so far: pbcopy/pbpaste to interact with the clipboard.

permlink: _.at: OS X Terminal Commands

OS X Terminal

last change: 2014-01-16
To nice to not post it here:

"OSX Terminal: hold option and click a position in the current line to move your cursor to that position."

permlink: _.at: OS X Terminal

Encrypt An External Disk Volume

last change: 2013-11-12
Convert to CoreStorage volume and encrypt in one step:
# diskutil cs convert /Volumes/Spare -passphrase

Or split into two steps:
# diskutil cs convert /Volumes/Spare
# diskutil cs encryptVolume /Volumes/Spare -passphrase

To check the status of the encryption process:
# diskutil cs info /Volumes/Spare

Obviously the volumename 'Spare' should be replaced by your volume in question...

permlink: _.at: Encrypt An External Disk Volume

Disable a MacOS X service

last change: 2016-05-20
launchctl unload -w <path to plist file>

The plist files are located in the following directories:

permlink: _.at: Disable a MacOS X service

MacOS X Download History

last change: 2012-02-14
OS X obviously keeps a list of downloads (not only for Safari) to enable those protective popups 'XXX was downloaded from the internet. Are you shure you want to open it?'

Under Lion this information can be found in the file
which is an SQLite database. Contents can be dumped using this command:

sqlite3 -header -line ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 \
'SELECT LSQuarantineAgentName AS Browser, LSQuarantineDataURLString AS File FROM LSQuarantineEvent WHERE LSQuarantineAgentName <> "PubSubAgent"'

Brushed up SQL inspired by the script found in the linked article below.

permlink: _.at: MacOS X Download History

Create a Unix User / Group from the command line on MacOS X

last change: 2013-02-08
% sudo dscl . -create /Users/luser
% sudo dscl . -create /Users/luser UserShell /bin/bash
% sudo dscl . -create /Users/luser RealName "Realname for user"
% sudo dscl . -create /Users/luser UniqueID "1010"
% sudo dscl . -create /Users/luser PrimaryGroupID 80
% sudo dscl . -create /Users/luser NFSHomeDirectory /Users/luser

Create a group:
% sudo dscl . -create /groups/tomcat
% sudo dscl . -append /groups/tomcat gid 230
% sudo dscl . -append /groups/tomcat passwd "*"

Add a user to this group (replace username with the correct value):
% sudo dscl . -append /groups/tomcat GroupMembership luser

in part derived from an answer at Serverstack: http://serverfault.com/a/20706

permlink: _.at: Create a Unix User / Group from the command line on MacOS X

Start MacOS X Screen Sharing

last change: 2015-06-13
To start the Screen Sharing application directly open Terminal and type the following command:
# open /System/Library/CoreServices/Screen\ Sharing.app/

Under OS X 10.10 this moved application was moved:
# open /System//Library/CoreServices/Applications/Screen\ Sharing.app

permlink: _.at: Start MacOS X Screen Sharing

Change Networksettings on MacOS X on the commandline

last change: 2011-09-22
First determine the installed services / interfaces:
# networksetup -listallnetworkservices

Read the current configuration for a service (name as listed in the output above):
# networksetup -getinfo Ethernet

Change e.g. the DNS server:
# networksetup -setdnsservers "Ethernet"

permlink: _.at: Change Networksettings on MacOS X on the commandline

Disable Lion Window Animations and other minor annoyances

last change: 2011-08-01
Disable generic window open animation use the following command in a Terminal window:
# defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO
Replace 'NO' with 'YES' to re-enable them.

Disable animations in Mail:
# defaults write com.apple.Mail DisableReplyAnimations -bool YES
Quit Mail before changing this setting. Replace 'YES' with 'NO' to re-enable animations.

Restore key autorepeat:
# defaults write -g ApplePressAndHoldEnabled -bool false

Make Library folder visible:
# chflags nohidden ~/Library/

Disable Spelling correction:
# defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool NO

Disable local Timemachine:
# sudo tmutil disablelocal

permlink: _.at: Disable Lion Window Animations and other minor annoyances


last change: 2009-11-03
Apples lame decision to drop ZFS from its future goals or MacOS X gets special treatment by Sun: ZFS gets inline deduplication. Besides other advanced features already present in the current version such as integrated RAID support, pooled storage and snapshots, this makes me doubt that Apple can come up with something even remotely as powerful...

permlink: _.at: ZFS

Reset Macbook/Air/Pro SMC

last change: 2009-04-27
How to reset the System Management Controller (SMC) on current Macbook, Macbook Air and Macbook Pro laptops.

permlink: _.at: Reset Macbook/Air/Pro SMC

Debian: set default encoding

last change: 2009-04-27
One of the really dark corners of configuration as well as programming: encoding.

permlink: _.at: Debian: set default encoding

Manually add users under MacOS X Leopard

last change: 2009-04-27
Unfortunately not as easy as editing /etc/passwd...

all articles represent the sole opinion of their respective author. all content comes without any warranty for correctnes, despite due diligence.