forked from tdanford/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-new-system.sh
executable file
·68 lines (56 loc) · 1.99 KB
/
bootstrap-new-system.sh
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
67
68
#!/usr/bin/env zsh
# A simple script for setting up OSX dev environment.
dev="$HOME/Developer"
pushd .
mkdir -p $dev
cd $dev
echo 'Enter new hostname of the machine (e.g. macbook-paulmillr)'
read hostname
echo "Setting new hostname to $hostname..."
scutil --set HostName "$hostname"
compname=$(sudo scutil --get HostName | tr '-' '.')
echo "Setting computer name to $compname"
scutil --set ComputerName "$compname"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$compname"
pub=$HOME/.ssh/id_rsa.pub
echo 'Checking for SSH key, generating one if it does not exist...'
[[ -f $pub ]] || ssh-keygen -t rsa
echo 'Copying public key to clipboard. Paste it into your Github account...'
[[ -f $pub ]] && cat $pub | pbcopy
open 'https://github.com/account/ssh'
# If we on OS X, install homebrew and tweak system a bit.
if [[ `uname` == 'Darwin' ]]; then
which -s brew
if [[ $? != 0 ]]; then
echo 'Installing Homebrew...'
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/homebrew/go/install)"
brew update
brew install htop mysql nginx node ruby
fi
echo 'Tweaking OS X...'
source 'etc/osx.sh'
# http://github.com/sindresorhus/quick-look-plugins
echo 'Installing Quick Look plugins...'
brew tap phinze/homebrew-cask
brew install brew-cask
brew cask install suspicious-package quicklook-json qlmarkdown qlstephen qlcolorcode
fi
echo 'Symlinking config files...'
source 'bin/symlink-dotfiles.sh'
open_apps() {
echo 'Install apps:'
echo 'Firefox:'
open http://www.mozilla.org/en-US/firefox/new/
echo 'Chrome:'
open https://www.google.com/intl/en/chrome/browser/
echo 'Skype:'
open http://www.skype.com/en/download-skype/skype-for-computer/
echo 'VLC:'
open http://www.videolan.org/vlc/index.html
echo 'Pixelmator!'
}
echo 'Should I give you links for system applications (e.g. Skype, Firefox, VLC)?'
echo 'n / y'
read give_links
[[ "$give_links" == 'y' ]] && open_apps
popd