public
Last active

Bash script for setting up OS X for power users

  • Download Gist
.profile
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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'
configure-osx-settings.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#!/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"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.