Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jakub Holy
committed
Apr 17, 2015
1 parent
696749f
commit ef73e39
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
FRESH_SETUP="false" | ||
|
||
if [ "$FRESH_SETUP" = "true" ]; then | ||
echo "Wipe all (default) app icons from the Dock" | ||
defaults write com.apple.dock persistent-apps -array # TODO Add finder, notes, iterm, ... | ||
fi | ||
|
||
echo "Requiring password immediately after sleep or screen saver begins" | ||
defaults write com.apple.screensaver askForPassword -int 1 | ||
defaults write com.apple.screensaver askForPasswordDelay -int 3 | ||
|
||
echo "" | ||
echo "DONE" | ||
echo "" | ||
echo "Beware: Some of these might require restart / re-login" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#!/bin/bash | ||
set -e | ||
set -u | ||
|
||
# Here we go.. ask for the administrator password upfront and run a | ||
# keep-alive to update existing `sudo` time stamp until script has finished | ||
# Credits: https://gist.github.com/brandonb927/3195465 | ||
sudo -v | ||
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | ||
|
||
# Check for Homebrew, | ||
# Install if we don't have it | ||
if test ! $(which brew); then | ||
echo "Installing homebrew..." | ||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
fi | ||
|
||
# Update homebrew recipes | ||
brew update | ||
|
||
#--------------------------------- | ||
|
||
# Install GNU core utilities (those that come with OS X are outdated) | ||
brew install coreutils | ||
|
||
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed | ||
brew install findutils | ||
|
||
# Install Bash 4 | ||
#brew install bash | ||
|
||
# Install more recent versions of some OS X tools | ||
brew tap homebrew/dupes | ||
brew install homebrew/dupes/grep | ||
|
||
#--------------------------------- | ||
binaries=( | ||
git | ||
nvm | ||
editorconfig | ||
fish | ||
) | ||
|
||
echo "installing binaries..." | ||
brew install ${binaries[@]} | ||
|
||
brew cleanup | ||
|
||
#--------------------------------- | ||
|
||
brew install caskroom/cask/brew-cask | ||
|
||
# Apps | ||
apps=( | ||
alfred | ||
dropbox | ||
google-chrome | ||
slack | ||
firefox | ||
vagrant | ||
iterm2 | ||
#sublime-text3 | ||
virtualbox | ||
atom | ||
vlc | ||
skype | ||
rowanj-gitx | ||
) | ||
|
||
# Install apps to /Applications | ||
# Default is: /Users/$user/Applications | ||
echo "installing apps..." | ||
brew cask install --appdir="/Applications" ${apps[@]} | ||
|
||
# For alternative versions: brew tap caskroom/versions | ||
|
||
#--------------------------------- | ||
echo "Installing Node.js ... " | ||
export NVM_DIR=~/.nvm | ||
set +u | ||
set +e | ||
source $(brew --prefix nvm)/nvm.sh | ||
set -u | ||
set -e | ||
|
||
nvm install v0.10 # FIXME Does not work for soem reason?! | ||
nvm alias default v0.10 | ||
|
||
#--------------------------------- | ||
|
||
echo "Settin up ruby env (rbenv)" | ||
# GEMs, linter-puppet-lint prereq | ||
brew install rbenv ruby-build | ||
if [ ! -f ~/.gemrc ]; then | ||
sudo gem update --system | ||
export RBENV_ROOT="$(brew --prefix rbenv)" | ||
export GEM_HOME="$(brew --prefix)/opt/gems" | ||
export GEM_PATH="$(brew --prefix)/opt/gems" | ||
echo "gem: -n/usr/local/bin" > ~/.gemrc | ||
gem install puppet-lint | ||
fi | ||
|
||
#--------------------------------- | ||
echo "Installing Atom plugins..." | ||
|
||
atom_plugins=( | ||
linter | ||
jshint | ||
react | ||
lodash-snippets | ||
javascript-snippets | ||
script | ||
refactor | ||
js-refactor | ||
test-status | ||
editorconfig | ||
language-puppet | ||
linter-puppet-lint | ||
) | ||
|
||
apm install ${atom_plugins[@]} | ||
#--------------------------------- | ||
|
||
echo "Setting up dotfiles..." | ||
|
||
if [ ! -d ~/dotfiles ]; then | ||
git clone -b dotf https://github.com/jakubholynet/dotfiles.git ~/dotfiles | ||
( cd ~/dotfiles; git remote set-url origin git@github.com:jakubholynet/dotfiles.git ) | ||
~/dotfiles/symlink.sh | ||
fi | ||
#--------------------------------- | ||
## TODO: Update path in .profile | ||
# $PATH=$(brew --prefix coreutils)/libexec/gnubin:$PATH | ||
# Add rbenv to bash, zsh, fish: https://coderwall.com/p/6bqzvq/sudoless-brewed-rubygems-on-os-x | ||
# export NVM_DIR=~/.nvm | ||
# source $(brew --prefix nvm)/nvm.sh | ||
|
||
## TODO Install | ||
# Junos, Sophos | ||
## TODO Config OSX, apps |