2016-09-30 05:06:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# make xcode shut up and give us build tools
|
|
|
|
sudo xcodebuild -license accept
|
|
|
|
|
|
|
|
# enable fde
|
|
|
|
sudo fdesetup enable
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
# disable hibernate
|
|
|
|
sudo rm /private/var/vm/sleepimage
|
|
|
|
sudo pmset -a hibernatemode 0
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# enable application firewall
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool true
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool false
|
|
|
|
|
|
|
|
# hush time machine
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
|
|
|
|
|
|
|
|
# update software
|
|
|
|
sudo softwareupdate -i -a
|
|
|
|
|
|
|
|
# enable all autoupdates
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool TRUE
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
# disable guest user account
|
|
|
|
sudo defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool false
|
|
|
|
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool false
|
|
|
|
|
|
|
|
# black like my soul
|
|
|
|
defaults write NSGlobalDomain AppleInterfaceStyle Dark
|
|
|
|
# hide menu bar
|
|
|
|
defaults write NSGlobalDomain _HIHideMenuBar -bool true
|
|
|
|
|
|
|
|
# dock on left
|
|
|
|
defaults write com.apple.dock orientation left
|
|
|
|
# autohide dock
|
|
|
|
defaults write com.apple.dock autohide -bool true
|
|
|
|
|
|
|
|
# do not save to icloud drive by default
|
|
|
|
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool FALSE
|
|
|
|
|
|
|
|
# airdrop on all interfaces
|
|
|
|
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# disable spotlight search spyware ugh thx
|
|
|
|
defaults write com.apple.lookup.shared LookupSuggestionsDisabled -int 1
|
|
|
|
defaults write com.apple.Safari UniversalSearchEnabled -int 0
|
|
|
|
|
|
|
|
# show battery percentage
|
|
|
|
defaults write com.apple.menuextra.battery ShowPercent -bool TRUE
|
|
|
|
|
|
|
|
# ask for password after 5 seconds of screen saver
|
|
|
|
defaults write com.apple.screensaver askForPassword -int 1
|
2016-09-30 21:47:50 +00:00
|
|
|
defaults write com.apple.screensaver askForPasswordDelay -int 30
|
2016-09-30 05:06:32 +00:00
|
|
|
|
|
|
|
# bottom right corner to lock screen
|
|
|
|
defaults write com.apple.dock "wvous-br-corner" -int 5
|
|
|
|
defaults write com.apple.dock "wvous-br-modifier" -int 0
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
# 2 minute screensaver activation
|
|
|
|
defaults write com.apple.screensaver idleTime -int 600
|
|
|
|
|
|
|
|
# terminal
|
|
|
|
# utf8 only
|
|
|
|
defaults write com.apple.Terminal StringEncodings -array 4
|
|
|
|
# close window if shell exited cleanly
|
|
|
|
defaults write com.apple.Terminal ShellExitAction 2
|
|
|
|
defaults write com.apple.Terminal FontAntialias 1
|
|
|
|
defaults write com.apple.Terminal "Default Window Settings" "Pro"
|
|
|
|
defaults write com.apple.Terminal "Startup Window Settings" "Pro"
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# New Finder windows use ~
|
|
|
|
defaults write com.apple.finder NewWindowTarget -string "PfHm"
|
|
|
|
|
|
|
|
# don't show mounted volumes on desktop
|
|
|
|
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -int 0
|
|
|
|
defaults write com.apple.finder ShowRemovableMediaOnDesktop -int 0
|
|
|
|
|
|
|
|
# finder show all file extensions
|
|
|
|
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
|
|
|
|
|
|
|
|
# set menubar clock to 24h with date and seconds
|
|
|
|
defaults write com.apple.menuextra.clock DateFormat -string 'EEE MMM d H:mm:ss'
|
|
|
|
|
|
|
|
# set keyboard to be really fucking fast
|
|
|
|
defaults write -g InitialKeyRepeat -int 15 # normal minimum is 15 (225 ms)
|
|
|
|
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
# safari debug stuff
|
|
|
|
defaults write com.apple.Safari IncludeDevelopMenu -bool true
|
|
|
|
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
|
|
|
|
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
|
|
|
|
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
|
|
|
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# install three python modules systemwide, that's all
|
|
|
|
# do the rest with pip install --user in homedir
|
|
|
|
sudo easy_install pip
|
|
|
|
sudo /usr/local/bin/pip install virtualenv
|
|
|
|
sudo /usr/local/bin/pip install awscli
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
# set default inputrc:
|
|
|
|
cat > ~/.inputrc <<EOF
|
|
|
|
set show-all-if-ambiguous on
|
|
|
|
set completion-ignore-case on
|
|
|
|
set completion-prefix-display-length 4
|
|
|
|
Control-j: menu-complete
|
|
|
|
Control-k: menu-complete-backward
|
|
|
|
set show-all-if-unmodified on
|
|
|
|
set completion-map-case on
|
|
|
|
set horizontal-scroll-mode Off
|
|
|
|
EOF
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# install homebrew under homedir
|
|
|
|
if [[ ! -d ~/Library/Homebrew ]]; then
|
|
|
|
mkdir -p ~/Library/Homebrew
|
|
|
|
cd ~/Library/Homebrew
|
|
|
|
curl -fsSL https://github.com/Homebrew/brew/tarball/master | \
|
|
|
|
tar --strip-components 1 -xvf -
|
|
|
|
fi
|
|
|
|
|
|
|
|
# setup modular bashrc.d and profile.d
|
|
|
|
if [[ ! -d ~/Library/bashrc.d ]]; then
|
|
|
|
cat > ~/.bashrc <<'EOF'
|
|
|
|
# do not edit this file. put files in the dir below.
|
|
|
|
for FN in $HOME/Library/bashrc.d/*.sh ; do
|
|
|
|
source $FN
|
|
|
|
done
|
|
|
|
EOF
|
|
|
|
mkdir -p ~/Library/bashrc.d
|
|
|
|
touch ~/Library/bashrc.d/keep.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d ~/Library/profile.d ]]; then
|
|
|
|
cat > ~/.profile <<'EOF'
|
|
|
|
# do not edit this file. put files in the dir below.
|
|
|
|
source ~/.bashrc
|
|
|
|
for FN in $HOME/Library/profile.d/*.sh ; do
|
|
|
|
source $FN
|
|
|
|
done
|
|
|
|
EOF
|
|
|
|
mkdir -p ~/Library/profile.d
|
|
|
|
touch ~/Library/profile.d/keep.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install homebrew path
|
2016-09-30 21:47:50 +00:00
|
|
|
if [[ ! -e ~/Library/bashrc.d/100homebrew.sh ]]; then
|
|
|
|
mkdir -p ~/Library/bashrc.d
|
2016-09-30 05:06:32 +00:00
|
|
|
echo 'export PATH+=":~/Library/Homebrew/bin"' > \
|
2016-09-30 21:47:50 +00:00
|
|
|
~/Library/bashrc.d/100homebrew.sh
|
|
|
|
echo 'export PATH+=":~/Library/Homebrew/sbin"' >> \
|
|
|
|
~/Library/bashrc.d/100homebrew.sh
|
|
|
|
echo 'export HOMEBREW_NO_ANALYTICS=1' >> \
|
|
|
|
~/Library/bashrc.d/100homebrew.sh
|
|
|
|
echo 'export HOMEBREW_CASK_OPTS="--appdir=~/Applications"' > \
|
|
|
|
~/Library/bashrc.d/100homebrewcaskdir.sh
|
2016-09-30 05:06:32 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-30 21:47:50 +00:00
|
|
|
echo 'export PS1=\'\u@\h:\w\\$ \'' > ~/Library/bashrc.d/000.ps1.sh
|
|
|
|
|
|
|
|
cat > ~/Library/bashrc.d/200.git-prompt.sh <<'EOF'
|
|
|
|
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
|
|
|
|
GIT_PROMPT_THEME=Default
|
|
|
|
GIT_PROMPT_ONLY_IN_REPO=1
|
|
|
|
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
2016-09-30 05:06:32 +00:00
|
|
|
# set homebrew path:
|
|
|
|
source ~/.profile
|
|
|
|
|
|
|
|
if [[ ! -d ~/Applications ]]; then
|
|
|
|
mkdir -p ~/Applications
|
|
|
|
fi
|
|
|
|
|
|
|
|
brew tap caskroom/cask
|
|
|
|
|
|
|
|
CASKS="
|
2016-09-30 21:47:50 +00:00
|
|
|
github-desktop
|
2016-09-30 05:06:32 +00:00
|
|
|
google-chrome
|
|
|
|
google-drive
|
2016-09-30 21:47:50 +00:00
|
|
|
gpgtools
|
|
|
|
iterm2
|
|
|
|
keepassx
|
|
|
|
lastpass
|
2016-09-30 05:06:32 +00:00
|
|
|
slack
|
2016-09-30 21:47:50 +00:00
|
|
|
sublime-text
|
2016-09-30 05:06:32 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
for CASK in $CASKS ; do
|
|
|
|
brew cask install $CASK
|
|
|
|
done
|
|
|
|
|
|
|
|
# install homebrew packages
|
|
|
|
|
|
|
|
HOMEBREW_PKGS="
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
bash-completion
|
2016-09-30 21:47:50 +00:00
|
|
|
bash-git-prompt
|
2016-09-30 05:06:32 +00:00
|
|
|
bonnie++
|
|
|
|
byobu
|
|
|
|
cmake
|
|
|
|
coreutils
|
|
|
|
curl
|
|
|
|
daemontools
|
|
|
|
docker
|
|
|
|
docker-compose
|
|
|
|
docker-machine
|
|
|
|
duplicity
|
|
|
|
ffmpeg
|
|
|
|
fish
|
|
|
|
flac
|
|
|
|
geoip
|
|
|
|
ghc
|
|
|
|
gist
|
|
|
|
git
|
|
|
|
gnupg
|
|
|
|
gnupg2
|
|
|
|
go
|
|
|
|
gpg-agent
|
2016-09-30 21:47:50 +00:00
|
|
|
homebrew/dupes/rsync
|
2016-09-30 05:06:32 +00:00
|
|
|
irssi
|
|
|
|
jq
|
|
|
|
keybase
|
|
|
|
lame
|
|
|
|
lame
|
|
|
|
mobile-shell
|
|
|
|
mtr
|
|
|
|
mutt
|
|
|
|
nmap
|
|
|
|
node
|
|
|
|
pbzip2
|
|
|
|
pinentry-mac
|
|
|
|
protobuf
|
|
|
|
pv
|
|
|
|
pwgen
|
|
|
|
python3
|
|
|
|
socat
|
|
|
|
sox
|
|
|
|
speedtest_cli
|
|
|
|
syncthing
|
|
|
|
tcptraceroute
|
|
|
|
terraform
|
|
|
|
tor
|
|
|
|
torsocks
|
|
|
|
unrar
|
|
|
|
unzip
|
|
|
|
watch
|
|
|
|
wget
|
|
|
|
whatmask
|
|
|
|
"
|
|
|
|
|
|
|
|
for PKG in $HOMEBREW_PKGS ; do
|
|
|
|
brew install $PKG
|
|
|
|
done
|
|
|
|
|