Last active
December 1, 2016 12:12
-
-
Save pmdroid/abc4f357b6f0ce4f6be8c388d275cbdb to your computer and use it in GitHub Desktop.
dev setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GLOBAL_NPM='servedir mversion gulp grunt-cli ntl nodemon' | |
ZSH_PLUGINS='git atom docker brew go node npm' | |
declare -a APM_PACKAGES=("atom-beautify" "file-icons" "genesis-ui" "linter" "linter-xo" "react" "language-babel" "atom-ternjs" "docblockr" "hyperclick" "js-hyperclick" "imdone-atom") | |
LIST_PACKAGES='Caskroom/versions/java7 android-platform-tools elasticsearch redis wget mongodb glide homebrew/versions/node5 zsh go graphicsmagick dockutil git git-flow' | |
declare -a BREW_AUTOSTART=("redis" "mongodb" "elasticsearch") | |
## brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
brew upgrade | |
brew install $LIST_PACKAGES | |
for package in "${BREW_AUTOSTART[@]}" | |
do | |
brew services start $package | |
done | |
## Atom | |
curl -L https://atom.io/download/mac -o /tmp/atom.zip | |
cd /tmp/ | |
unzip /tmp/atom.zip | |
cp -R Atom.app /Applications/ | |
for package in "${APM_PACKAGES[@]}" | |
do | |
/Applications/Atom.app/Contents/Resources/app/apm/bin/apm install $package | |
done | |
dockutil --add /Applications/Atom.app | |
## iTerm | |
curl https://iterm2.com/downloads/beta/iTerm2-2_9_20160523.zip -o /tmp/iterm.zip | |
unzip /tmp/iterm.zip -d /Applications/ | |
dockutil --add /Applications/iTerm.app | |
## VLC | |
curl -L http://get.videolan.org/vlc/2.2.3/macosx/vlc-2.2.3.dmg -o /tmp/vlc.dmg | |
hdiutil mount -nobrowse /tmp/vlc.dmg | |
cp -R /Volumes/vlc-2.2.3/VLC.app /Applications | |
## Android Studio | |
curl -L https://dl.google.com/dl/android/studio/install/2.1.2.0/android-studio-ide-143.2915827-mac.dmg -o /tmp/android-studio.dmg | |
hdiutil mount -nobrowse /tmp/android-studio.dmg | |
cp -R /Volumes/Android\ Studio\ 2.1.2/Android\ Studio.app /Applications | |
## oh-my-zsh | |
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
sudo chsh -s /bin/zsh | |
rm ~/.oh-my-zsh/themes/agnoster.zsh-theme | |
curl https://raw.githubusercontent.com/CyberLight/agnoster.zsh-theme/master/agnoster.zsh-theme -o ~/.oh-my-zsh/themes/agnoster.zsh-theme | |
git clone https://gist.github.com/qrush/1595572/ | |
cd 1595572/ | |
cp * $HOME/Library/Fonts/ | |
sed -i '' "s/plugins=(git)/plugins=(${ZSH_PLUGINS})/g" ~/.zshrc | |
sed -i '' "s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"agnoster\"/g" ~/.zshrc | |
mkdir -p ~/Workspace/ | |
## Dropbox Installer | |
curl -L https://www.dropbox.com/download?plat=mac -o /tmp/dropbox.dmg | |
hdiutil mount -nobrowse /tmp/dropbox.dmg | |
/Volumes/Dropbox\ Installer/Dropbox.app/Contents/MacOS/Dropbox\ Installer | |
## Google Drive | |
curl https://dl.google.com/drive/installgoogledrive.dmg -o /tmp/installgoogledrive.dmg | |
hdiutil mount -nobrowse /tmp/installgoogledrive.dmg | |
cp -R /Volumes/Install\ Google\ Drive/Google\ Drive.app /Applications | |
## Google Chrome Stable | |
curl https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg -o /tmp/googlechrome.dmg | |
hdiutil mount -nobrowse /tmp/googlechrome.dmg | |
cp -R /Volumes/Google\ Chrome/Google\ Chrome.app /Applications | |
dockutil --add /Applications/Google\ Chrome.app | |
dockutil --add ~/Applications/Chrome\ Apps.localized/Default\ fhbjgbiflinjbdggehcddcbncdddomop.app | |
## spotify | |
curl https://download.spotify.com/SpotifyInstaller.zip -o /tmp/SpotifyInstaller.zip | |
unzip /tmp/SpotifyInstaller.zip -d /tmp/ | |
/tmp/Install\ Spotify.app/Contents/MacOS/Install\ Spotify | |
dockutil --add /Applications/Spotify.app | |
## franz messenger | |
curl -L https://github.com/imprecision/franz-app/releases/download/2.0/Franz-darwin-x64-0.9.10.dmg -o /tmp/franz.dmg | |
hdiutil attach /tmp/franz.dmg | |
cp -R /Volumes/Franz/Franz.app /Applications | |
dockutil --add /Applications/Franz.app | |
## 1Password | |
curl https://d13itkw33a7sus.cloudfront.net/dist/1P/mac4/1Password-6.3.zip -o /tmp/1password.zip | |
unzip /tmp/1password.zip -d /Applications/ | |
dockutil --add /Applications/1Password\ 6.app | |
## docker | |
curl https://dyhfha9j6srsj.cloudfront.net/Docker.dmg -o Docker.dmg | |
hdiutil mount -nobrowse /tmp/Docker.dmg | |
cp -R /Volumes/Franz/Docker.app /Applications | |
## Alfred | |
curl https://cachefly.alfredapp.com/Alfred_3.0_652.zip -o /tmp/alfred.zip | |
unzip /tmp/alfred.zip -d /Applications/ | |
open /Applications/Alfred\ 3.app | |
## Bartender | |
curl https://www.macbartender.com/Demo/Bartender%202.zip -o /tmp/bartender.zip | |
unzip /tmp/bartender.zip -d /Applications/ | |
open /Applications/Bartender\ 2.app | |
## Hyperdock | |
curl -L https://bahoom.com/hyperdock/download -o /tmp/hyperdock.dmg | |
hdiutil mount -nobrowse /tmp/hyperdock.dmg | |
cp -R /Volumes/HyperDock/HyperDock.prefpane ~/Library/PreferencePanes/ | |
open ~/Library/PreferencePanes/HyperDock.prefpane | |
## f.lux | |
curl -L https://justgetflux.com/mac/Flux.zip -o /tmp/flux.zip | |
unzip /tmp/flux.zip -d /Applications/ | |
open /Applications/Flux.app | |
## Robomongo | |
curl https://download.robomongo.org/0.9.0-rc8/osx/robomongo-0.9.0-rc8-darwin-x86_64-c113244.dmg -o /tmp/robomongo.dmg | |
hdiutil mount -nobrowse /tmp/robomongo.dmg | |
cp -R /Volumes/robomongo-0.9.0-rc8-darwin-x86_64-c113244/Robomongo.app /Applications | |
dockutil --add /Applications/Robomongo.app | |
## npm globals | |
npm i $GLOBAL_NPM -g | |
##remove stuff | |
rm -rf /Applications/__MACOSX/ | |
dockutil --remove 'Mail' --no-restart | |
dockutil --remove 'Kontakte' --no-restart | |
dockutil --remove 'Kalender' --no-restart | |
dockutil --remove 'Notizen' --no-restart | |
dockutil --remove 'Erinnerungen' --no-restart | |
dockutil --remove 'Karten' --no-restart | |
dockutil --remove 'Fotos' --no-restart | |
dockutil --remove 'Nachrichten' --no-restart | |
dockutil --remove 'FaceTime' --no-restart | |
dockutil --remove 'iTunes' --no-restart | |
dockutil --remove 'iBooks' | |
# create a ssh key | |
read -p 'create ssh key? ' sshkey | |
if [ "${sshkey}" = 'y' ]; then | |
mkdir -p ~/.ssh/ | |
openssl genrsa -des3 -out ~/.ssh/rsakey.pem 4096 | |
chmod 600 ~/.ssh/rsakey.pem | |
ssh-keygen -y -f ~/.ssh/rsakey.pem > ~/.ssh/rsakey.pub | |
ssh-add ~/.ssh/rsakey.pem | |
read -p 'upload key to github? ' githubupload | |
if [ "${githubupload}" = 'y' ]; then | |
read -p 'enter your github username? ' githubusername | |
if [ ! -z "${githubusername}" ]; then | |
read -p 'two-factor authentication? (leave empty if not): ' otptoken | |
if [ ! -z "${otptoken}" ] ; then | |
curl -u $githubusername -H "X-GitHub-OTP: $otptoken" --data "{\"title\": \"$(hostname)\" ,\"key\": \"$(cat ~/.ssh/rsakey.pub)\" }" https://api.github.com/user/keys | |
else | |
curl -u $githubusername --data "{\"title\": \"$(hostname)\" ,\"key\": \"$(cat ~/.ssh/rsakey.pub)\" }" https://api.github.com/user/keys | |
fi | |
else | |
echo "a username is required" | |
fi | |
fi | |
fi |
Author
pmdroid
commented
May 29, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment