Skip to content

Instantly share code, notes, and snippets.

Created May 26, 2011 19:21
Show Gist options
  • Save ssbarnea/993847 to your computer and use it in GitHub Desktop.
Save ssbarnea/993847 to your computer and use it in GitHub Desktop.
Bash script for setting up OS X for power users
alias dos2unix-recursive='find . -iname '*.tpl' | xargs dos2unix'
alias edit='mcedit'
alias del='rm'
alias deltree='rm -r'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias attrib='chmod'
alias chdir='cd'
alias copy='cp'
alias ls='ls -a'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# this is required in order be able to build many packages because Xcode4 dropped `ppc` architecture
export ARCHFLAGS='-arch i386 -arch x86_64'
# Use at your own risk, and don't sue me.
# Welcome to contributors :) ... if you know more useful tricks, submit them.
# The script is supposed to be safely executed several times (no risk of breaking something due to this)
defaults write AppleShowAllFiles TRUE
#killall Finder
defaults write -g WebAutomaticTextReplacementEnabled -bool true
defaults write -g WebAutomaticDashSubstitutionEnabled -bool true
defaults write -g WebContinuousSpellCheckingEnabled -bool true
# How to Enable Expanded Save Dialog as Default
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true
# configure locate to update its database each day
# see
sudo launchctl load -w /System/Library/LaunchDaemons/ 2>/dev/null
# --- section ---
sudo port version>/dev/null
if [ $RETVAL -eq 0 ] ; then
echo "macports detected, running..."
sudo port install wine mc wget
# shedule macports to update regulately - better in background instead of wasting time later
sudo sh -c "cat >/System/Library/LaunchDaemons/org.macports.portupdate" <<DELIM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>port update;</string>
<string>port upgrade obsolete</string>
sudo launchctl load -w /System/Library/LaunchDaemons/org.macports.portupdate 2>/dev/null
echo "macports not found, skipped macports tools install"
sudo bash -c "cd /opt/local/bin/; wget --timestamp -nv; chmod +x winetricks"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment