Skip to content

Instantly share code, notes, and snippets.

@ssbarnea
Created May 26, 2011 19:21
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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'
#!/bin/bash
#
# 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 com.apple.finder 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 http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist 2>/dev/null
# --- macports.org section ---
sudo port version>/dev/null
RETVAL=$?
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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>org.macports.portupdate</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>port update;</string>
<string>port upgrade obsolete</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>5</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
</dict>
</plist>
DELIM
sudo launchctl load -w /System/Library/LaunchDaemons/org.macports.portupdate 2>/dev/null
else
echo "macports not found, skipped macports tools install"
fi
sudo bash -c "cd /opt/local/bin/; wget --timestamp -nv http://winetricks.org/winetricks; chmod +x winetricks"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment