From 0414f9bfce3dcbc3006b5bb7d79bc89e693ff4cd Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 28 Mar 2018 00:19:48 +0200 Subject: [PATCH 01/13] Use rcm for dotfile management --- .aliases => .dotfiles/tag-dev-setup/aliases | 0 {.aws => .dotfiles/tag-dev-setup/aws}/config | 0 .../tag-dev-setup/aws}/credentials | 0 .../tag-dev-setup/bash_profile | 0 .../tag-dev-setup/bash_prompt | 0 .bashrc => .dotfiles/tag-dev-setup/bashrc | 0 {bin => .dotfiles/tag-dev-setup/bin}/bash | 0 .../tag-dev-setup/bin}/httpcompression | 0 {bin => .dotfiles/tag-dev-setup/bin}/subl | 0 .curlrc => .dotfiles/tag-dev-setup/curlrc | 0 .../ds-themes}/Preferences.sublime-settings | 0 .../Solarized Dark xterm-256color.terminal | 0 .../ds-themes}/Solarized Dark.itermcolors | 0 .../tag-dev-setup/editorconfig | 0 .exports => .dotfiles/tag-dev-setup/exports | 0 .../tag-dev-setup/functions | 0 .gdbinit => .dotfiles/tag-dev-setup/gdbinit | 0 .../tag-dev-setup/gitattributes | 0 .../tag-dev-setup/gitconfig | 0 .../tag-dev-setup/gitignore | 0 .gvimrc => .dotfiles/tag-dev-setup/gvimrc | 0 .hgignore => .dotfiles/tag-dev-setup/hgignore | 0 .../tag-dev-setup/hushlogin | 0 .inputrc => .dotfiles/tag-dev-setup/inputrc | 0 .../ipython}/profile_default/startup/README | 0 .../profile_default/static/custom/custom.css | 0 .../profile_default/static/custom/custom.js | 0 .../ipython}/profile_pyspark/history.sqlite | Bin .../profile_pyspark/ipython_config.py | 0 .../ipython_nbconvert_config.py | 0 .../ipython_notebook_config.py | 0 .../ipython_qtconsole_config.py | 0 .../startup/00-pyspark-setup.py | 0 .../ipython}/profile_pyspark/startup/README | 0 .../profile_pyspark/static/custom/custom.css | 0 .../profile_pyspark/static/custom/custom.js | 0 .../tag-dev-setup/mrjob.conf | 34 +++++++++--------- .s3cfg => .dotfiles/tag-dev-setup/s3cfg | 0 .screenrc => .dotfiles/tag-dev-setup/screenrc | 0 .../tag-dev-setup/vim}/backups/.gitignore | 0 .../tag-dev-setup/vim}/colors/solarized.vim | 0 .../tag-dev-setup/vim}/swaps/.gitignore | 0 .../tag-dev-setup/vim}/syntax/json.vim | 0 .../tag-dev-setup/vim}/undo/.gitignore | 0 .vimrc => .dotfiles/tag-dev-setup/vimrc | 0 .wgetrc => .dotfiles/tag-dev-setup/wgetrc | 0 .dots | 1 + .rcrc | 4 +++ aws.sh | 5 +-- bootstrap.sh | 5 +-- osx.sh | 6 ++-- pydata.sh | 8 +---- rcm.sh | 25 +++++++++++++ 53 files changed, 55 insertions(+), 33 deletions(-) rename .aliases => .dotfiles/tag-dev-setup/aliases (100%) rename {.aws => .dotfiles/tag-dev-setup/aws}/config (100%) rename {.aws => .dotfiles/tag-dev-setup/aws}/credentials (100%) rename .bash_profile => .dotfiles/tag-dev-setup/bash_profile (100%) rename .bash_prompt => .dotfiles/tag-dev-setup/bash_prompt (100%) rename .bashrc => .dotfiles/tag-dev-setup/bashrc (100%) rename {bin => .dotfiles/tag-dev-setup/bin}/bash (100%) rename {bin => .dotfiles/tag-dev-setup/bin}/httpcompression (100%) rename {bin => .dotfiles/tag-dev-setup/bin}/subl (100%) rename .curlrc => .dotfiles/tag-dev-setup/curlrc (100%) rename {init => .dotfiles/tag-dev-setup/ds-themes}/Preferences.sublime-settings (100%) rename {init => .dotfiles/tag-dev-setup/ds-themes}/Solarized Dark xterm-256color.terminal (100%) rename {init => .dotfiles/tag-dev-setup/ds-themes}/Solarized Dark.itermcolors (100%) rename .editorconfig => .dotfiles/tag-dev-setup/editorconfig (100%) rename .exports => .dotfiles/tag-dev-setup/exports (100%) rename .functions => .dotfiles/tag-dev-setup/functions (100%) rename .gdbinit => .dotfiles/tag-dev-setup/gdbinit (100%) rename .gitattributes => .dotfiles/tag-dev-setup/gitattributes (100%) rename .gitconfig => .dotfiles/tag-dev-setup/gitconfig (100%) rename .gitignore => .dotfiles/tag-dev-setup/gitignore (100%) rename .gvimrc => .dotfiles/tag-dev-setup/gvimrc (100%) rename .hgignore => .dotfiles/tag-dev-setup/hgignore (100%) rename .hushlogin => .dotfiles/tag-dev-setup/hushlogin (100%) rename .inputrc => .dotfiles/tag-dev-setup/inputrc (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_default/startup/README (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_default/static/custom/custom.css (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_default/static/custom/custom.js (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/history.sqlite (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/ipython_config.py (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/ipython_nbconvert_config.py (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/ipython_notebook_config.py (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/ipython_qtconsole_config.py (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/startup/00-pyspark-setup.py (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/startup/README (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/static/custom/custom.css (100%) rename {init => .dotfiles/tag-dev-setup/ipython}/profile_pyspark/static/custom/custom.js (100%) rename .mrjob.conf => .dotfiles/tag-dev-setup/mrjob.conf (96%) rename .s3cfg => .dotfiles/tag-dev-setup/s3cfg (100%) rename .screenrc => .dotfiles/tag-dev-setup/screenrc (100%) rename {.vim => .dotfiles/tag-dev-setup/vim}/backups/.gitignore (100%) rename {.vim => .dotfiles/tag-dev-setup/vim}/colors/solarized.vim (100%) rename {.vim => .dotfiles/tag-dev-setup/vim}/swaps/.gitignore (100%) rename {.vim => .dotfiles/tag-dev-setup/vim}/syntax/json.vim (100%) rename {.vim => .dotfiles/tag-dev-setup/vim}/undo/.gitignore (100%) rename .vimrc => .dotfiles/tag-dev-setup/vimrc (100%) rename .wgetrc => .dotfiles/tag-dev-setup/wgetrc (100%) create mode 100644 .rcrc create mode 100755 rcm.sh diff --git a/.aliases b/.dotfiles/tag-dev-setup/aliases similarity index 100% rename from .aliases rename to .dotfiles/tag-dev-setup/aliases diff --git a/.aws/config b/.dotfiles/tag-dev-setup/aws/config similarity index 100% rename from .aws/config rename to .dotfiles/tag-dev-setup/aws/config diff --git a/.aws/credentials b/.dotfiles/tag-dev-setup/aws/credentials similarity index 100% rename from .aws/credentials rename to .dotfiles/tag-dev-setup/aws/credentials diff --git a/.bash_profile b/.dotfiles/tag-dev-setup/bash_profile similarity index 100% rename from .bash_profile rename to .dotfiles/tag-dev-setup/bash_profile diff --git a/.bash_prompt b/.dotfiles/tag-dev-setup/bash_prompt similarity index 100% rename from .bash_prompt rename to .dotfiles/tag-dev-setup/bash_prompt diff --git a/.bashrc b/.dotfiles/tag-dev-setup/bashrc similarity index 100% rename from .bashrc rename to .dotfiles/tag-dev-setup/bashrc diff --git a/bin/bash b/.dotfiles/tag-dev-setup/bin/bash similarity index 100% rename from bin/bash rename to .dotfiles/tag-dev-setup/bin/bash diff --git a/bin/httpcompression b/.dotfiles/tag-dev-setup/bin/httpcompression similarity index 100% rename from bin/httpcompression rename to .dotfiles/tag-dev-setup/bin/httpcompression diff --git a/bin/subl b/.dotfiles/tag-dev-setup/bin/subl similarity index 100% rename from bin/subl rename to .dotfiles/tag-dev-setup/bin/subl diff --git a/.curlrc b/.dotfiles/tag-dev-setup/curlrc similarity index 100% rename from .curlrc rename to .dotfiles/tag-dev-setup/curlrc diff --git a/init/Preferences.sublime-settings b/.dotfiles/tag-dev-setup/ds-themes/Preferences.sublime-settings similarity index 100% rename from init/Preferences.sublime-settings rename to .dotfiles/tag-dev-setup/ds-themes/Preferences.sublime-settings diff --git a/init/Solarized Dark xterm-256color.terminal b/.dotfiles/tag-dev-setup/ds-themes/Solarized Dark xterm-256color.terminal similarity index 100% rename from init/Solarized Dark xterm-256color.terminal rename to .dotfiles/tag-dev-setup/ds-themes/Solarized Dark xterm-256color.terminal diff --git a/init/Solarized Dark.itermcolors b/.dotfiles/tag-dev-setup/ds-themes/Solarized Dark.itermcolors similarity index 100% rename from init/Solarized Dark.itermcolors rename to .dotfiles/tag-dev-setup/ds-themes/Solarized Dark.itermcolors diff --git a/.editorconfig b/.dotfiles/tag-dev-setup/editorconfig similarity index 100% rename from .editorconfig rename to .dotfiles/tag-dev-setup/editorconfig diff --git a/.exports b/.dotfiles/tag-dev-setup/exports similarity index 100% rename from .exports rename to .dotfiles/tag-dev-setup/exports diff --git a/.functions b/.dotfiles/tag-dev-setup/functions similarity index 100% rename from .functions rename to .dotfiles/tag-dev-setup/functions diff --git a/.gdbinit b/.dotfiles/tag-dev-setup/gdbinit similarity index 100% rename from .gdbinit rename to .dotfiles/tag-dev-setup/gdbinit diff --git a/.gitattributes b/.dotfiles/tag-dev-setup/gitattributes similarity index 100% rename from .gitattributes rename to .dotfiles/tag-dev-setup/gitattributes diff --git a/.gitconfig b/.dotfiles/tag-dev-setup/gitconfig similarity index 100% rename from .gitconfig rename to .dotfiles/tag-dev-setup/gitconfig diff --git a/.gitignore b/.dotfiles/tag-dev-setup/gitignore similarity index 100% rename from .gitignore rename to .dotfiles/tag-dev-setup/gitignore diff --git a/.gvimrc b/.dotfiles/tag-dev-setup/gvimrc similarity index 100% rename from .gvimrc rename to .dotfiles/tag-dev-setup/gvimrc diff --git a/.hgignore b/.dotfiles/tag-dev-setup/hgignore similarity index 100% rename from .hgignore rename to .dotfiles/tag-dev-setup/hgignore diff --git a/.hushlogin b/.dotfiles/tag-dev-setup/hushlogin similarity index 100% rename from .hushlogin rename to .dotfiles/tag-dev-setup/hushlogin diff --git a/.inputrc b/.dotfiles/tag-dev-setup/inputrc similarity index 100% rename from .inputrc rename to .dotfiles/tag-dev-setup/inputrc diff --git a/init/profile_default/startup/README b/.dotfiles/tag-dev-setup/ipython/profile_default/startup/README similarity index 100% rename from init/profile_default/startup/README rename to .dotfiles/tag-dev-setup/ipython/profile_default/startup/README diff --git a/init/profile_default/static/custom/custom.css b/.dotfiles/tag-dev-setup/ipython/profile_default/static/custom/custom.css similarity index 100% rename from init/profile_default/static/custom/custom.css rename to .dotfiles/tag-dev-setup/ipython/profile_default/static/custom/custom.css diff --git a/init/profile_default/static/custom/custom.js b/.dotfiles/tag-dev-setup/ipython/profile_default/static/custom/custom.js similarity index 100% rename from init/profile_default/static/custom/custom.js rename to .dotfiles/tag-dev-setup/ipython/profile_default/static/custom/custom.js diff --git a/init/profile_pyspark/history.sqlite b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/history.sqlite similarity index 100% rename from init/profile_pyspark/history.sqlite rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/history.sqlite diff --git a/init/profile_pyspark/ipython_config.py b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_config.py similarity index 100% rename from init/profile_pyspark/ipython_config.py rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_config.py diff --git a/init/profile_pyspark/ipython_nbconvert_config.py b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_nbconvert_config.py similarity index 100% rename from init/profile_pyspark/ipython_nbconvert_config.py rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_nbconvert_config.py diff --git a/init/profile_pyspark/ipython_notebook_config.py b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_notebook_config.py similarity index 100% rename from init/profile_pyspark/ipython_notebook_config.py rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_notebook_config.py diff --git a/init/profile_pyspark/ipython_qtconsole_config.py b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_qtconsole_config.py similarity index 100% rename from init/profile_pyspark/ipython_qtconsole_config.py rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/ipython_qtconsole_config.py diff --git a/init/profile_pyspark/startup/00-pyspark-setup.py b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/startup/00-pyspark-setup.py similarity index 100% rename from init/profile_pyspark/startup/00-pyspark-setup.py rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/startup/00-pyspark-setup.py diff --git a/init/profile_pyspark/startup/README b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/startup/README similarity index 100% rename from init/profile_pyspark/startup/README rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/startup/README diff --git a/init/profile_pyspark/static/custom/custom.css b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/static/custom/custom.css similarity index 100% rename from init/profile_pyspark/static/custom/custom.css rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/static/custom/custom.css diff --git a/init/profile_pyspark/static/custom/custom.js b/.dotfiles/tag-dev-setup/ipython/profile_pyspark/static/custom/custom.js similarity index 100% rename from init/profile_pyspark/static/custom/custom.js rename to .dotfiles/tag-dev-setup/ipython/profile_pyspark/static/custom/custom.js diff --git a/.mrjob.conf b/.dotfiles/tag-dev-setup/mrjob.conf similarity index 96% rename from .mrjob.conf rename to .dotfiles/tag-dev-setup/mrjob.conf index ee89d3595..813897b31 100755 --- a/.mrjob.conf +++ b/.dotfiles/tag-dev-setup/mrjob.conf @@ -1,17 +1,17 @@ -runners: - emr: - aws_access_key_id: YOURACCESSKEY - aws_secret_access_key: YOURSECRETKEY - aws_region: us-east-1 - ec2_key_pair: YOURKEYPAIR - ec2_key_pair_file: ~/.ssh/YOURKEYPAIR.pem - ssh_tunnel_to_job_tracker: true - ec2_master_instance_type: m1.small - ec2_instance_type: m1.small - num_ec2_instances: 5 - s3_scratch_uri: s3://YOURBUCKETSCRATCH - s3_log_uri: s3://YOURBUCKETLOG - enable_emr_debugging: True - bootstrap: - - sudo apt-get install -y python-pip - - sudo pip install --upgrade simplejson +runners: + emr: + aws_access_key_id: YOURACCESSKEY + aws_secret_access_key: YOURSECRETKEY + aws_region: us-east-1 + ec2_key_pair: YOURKEYPAIR + ec2_key_pair_file: ~/.ssh/YOURKEYPAIR.pem + ssh_tunnel_to_job_tracker: true + ec2_master_instance_type: m1.small + ec2_instance_type: m1.small + num_ec2_instances: 5 + s3_scratch_uri: s3://YOURBUCKETSCRATCH + s3_log_uri: s3://YOURBUCKETLOG + enable_emr_debugging: True + bootstrap: + - sudo apt-get install -y python-pip + - sudo pip install --upgrade simplejson diff --git a/.s3cfg b/.dotfiles/tag-dev-setup/s3cfg similarity index 100% rename from .s3cfg rename to .dotfiles/tag-dev-setup/s3cfg diff --git a/.screenrc b/.dotfiles/tag-dev-setup/screenrc similarity index 100% rename from .screenrc rename to .dotfiles/tag-dev-setup/screenrc diff --git a/.vim/backups/.gitignore b/.dotfiles/tag-dev-setup/vim/backups/.gitignore similarity index 100% rename from .vim/backups/.gitignore rename to .dotfiles/tag-dev-setup/vim/backups/.gitignore diff --git a/.vim/colors/solarized.vim b/.dotfiles/tag-dev-setup/vim/colors/solarized.vim similarity index 100% rename from .vim/colors/solarized.vim rename to .dotfiles/tag-dev-setup/vim/colors/solarized.vim diff --git a/.vim/swaps/.gitignore b/.dotfiles/tag-dev-setup/vim/swaps/.gitignore similarity index 100% rename from .vim/swaps/.gitignore rename to .dotfiles/tag-dev-setup/vim/swaps/.gitignore diff --git a/.vim/syntax/json.vim b/.dotfiles/tag-dev-setup/vim/syntax/json.vim similarity index 100% rename from .vim/syntax/json.vim rename to .dotfiles/tag-dev-setup/vim/syntax/json.vim diff --git a/.vim/undo/.gitignore b/.dotfiles/tag-dev-setup/vim/undo/.gitignore similarity index 100% rename from .vim/undo/.gitignore rename to .dotfiles/tag-dev-setup/vim/undo/.gitignore diff --git a/.vimrc b/.dotfiles/tag-dev-setup/vimrc similarity index 100% rename from .vimrc rename to .dotfiles/tag-dev-setup/vimrc diff --git a/.wgetrc b/.dotfiles/tag-dev-setup/wgetrc similarity index 100% rename from .wgetrc rename to .dotfiles/tag-dev-setup/wgetrc diff --git a/.dots b/.dots index 61103a9cd..ca52d5098 100755 --- a/.dots +++ b/.dots @@ -40,6 +40,7 @@ function runDots() { echo "" ./brew.sh fi + if [ $ARG == "osx" ] || [ $ARG == "all" ]; then # Run the osx.sh Script # I strongly suggest you read through the commented osx.sh diff --git a/.rcrc b/.rcrc new file mode 100644 index 000000000..c22e1a4fa --- /dev/null +++ b/.rcrc @@ -0,0 +1,4 @@ +DOTFILES_DIRS=".dotfiles" +TAGS="dev-setup" +SYMLINK_DIRS="ds-themes" +UNDOTTED="bin" diff --git a/aws.sh b/aws.sh index e8b6fefa9..0ffad52be 100755 --- a/aws.sh +++ b/aws.sh @@ -91,9 +91,6 @@ brew install apache-spark echo "------------------------------" echo "Installing IPython Notebook Spark integration" -# Add the pyspark IPython profile -cp -r init/profile_pyspark/ ~/.ipython/profile_pyspark - BASH_PROFILE_PATH=~/.bash_profile echo $BASH_PROFILE_PATH echo "" >> $BASH_PROFILE_PATH @@ -110,4 +107,4 @@ echo "------------------------------" echo "TODO: Update .aws/ with your AWS credentials and region, or run aws --configure." echo "TODO: Update .mrjob.conf with your credentials, keypair, keypair location, region, and bucket info." echo "TODO: Update .s3cfg with your credentials, location, and passphrase or run s3cmd --configure." -echo "Script completed." \ No newline at end of file +echo "Script completed." diff --git a/bootstrap.sh b/bootstrap.sh index abe1aeeb2..98f119535 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -5,8 +5,9 @@ cd "$(dirname "${BASH_SOURCE}")"; git pull origin master; function doIt() { - rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ - --exclude "README.md" --exclude "LICENSE" -avh --no-perms . ~; + ./rcm.sh + + source ~/.bash_profile; } diff --git a/osx.sh b/osx.sh index 14cdfba54..ac85bf408 100755 --- a/osx.sh +++ b/osx.sh @@ -586,7 +586,7 @@ tell application "Terminal" (* Open the custom theme so that it gets added to the list of available terminal themes (note: this will open two additional terminal windows). *) - do shell script "open '$HOME/init/" & themeName & ".terminal'" + do shell script "open '$HOME/.ds-themes/" & themeName & ".terminal'" (* Wait a little bit to ensure that the custom theme is added. *) delay 1 @@ -640,7 +640,7 @@ start_if_needed() { # Install the Solarized Dark theme for iTerm start_if_needed iTerm -open "${HOME}/init/Solarized Dark.itermcolors" +open "${HOME}/.ds-themes/Solarized Dark.itermcolors" # Don’t display the annoying prompt when quitting iTerm defaults write com.googlecode.iterm2 PromptOnQuit -bool false @@ -774,7 +774,7 @@ defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false ############################################################################### # Install Sublime Text settings -cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null +cp -r ${HOME}/.ds-themes/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null ############################################################################### # Transmission.app # diff --git a/pydata.sh b/pydata.sh index ebdb710d4..f1922aac5 100755 --- a/pydata.sh +++ b/pydata.sh @@ -97,14 +97,8 @@ pip install mysqlclient # Install IPython Profile ############################################################################### -echo "------------------------------" -echo "Installing IPython Notebook Default Profile" - -# Add the IPython profile -mkdir -p ~/.ipython -cp -r init/profile_default/ ~/.ipython/profile_default echo "------------------------------" echo "Script completed." echo "Usage: workon py2-data for Python2" -echo "Usage: workon py3-data for Python3" \ No newline at end of file +echo "Usage: workon py3-data for Python3" diff --git a/rcm.sh b/rcm.sh new file mode 100755 index 000000000..00f43109d --- /dev/null +++ b/rcm.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Install command-line tools using Homebrew. + +# Ask for the administrator password upfront. +sudo -v + +# Keep-alive: update existing `sudo` time stamp until the script has finished. +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 + +# Make sure we’re using the latest Homebrew. +brew update + +brew tap thoughtbot/formulae +brew install rcm + +# setup dotfiles +env RCRC=".rcrc" rcup From a1441c752a471fdb5c8c5c8df2c7ff26a28bc3ef Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 28 Mar 2018 00:42:55 +0200 Subject: [PATCH 02/13] Call rcm when bootstraping --- .dots | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.dots b/.dots index ca52d5098..3d2b69484 100755 --- a/.dots +++ b/.dots @@ -17,6 +17,12 @@ function runDots() { echo "------------------------------" echo "" cd ~ && curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,LICENSE} + + echo "------------------------------" + echo "Installing rcm via homebrew to setup all dotfiles." + echo "------------------------------" + echo "" + ./rcm.sh fi if [ $ARG == "osxprep" ] || [ $ARG == "all" ]; then # Run the osxprep.sh Script From 4b71c0fa385a0d8298cc7cb3b1cdd335d2fb59fe Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Fri, 30 Mar 2018 15:22:44 +0200 Subject: [PATCH 03/13] Generalize the ds-themes directory --- .../themes}/Preferences.sublime-settings | 0 .../themes}/Solarized Dark xterm-256color.terminal | 0 .../themes}/Solarized Dark.itermcolors | 0 .rcrc | 2 +- osx.sh | 6 +++--- 5 files changed, 4 insertions(+), 4 deletions(-) rename .dotfiles/tag-dev-setup/{ds-themes => dev-setup/themes}/Preferences.sublime-settings (100%) rename .dotfiles/tag-dev-setup/{ds-themes => dev-setup/themes}/Solarized Dark xterm-256color.terminal (100%) rename .dotfiles/tag-dev-setup/{ds-themes => dev-setup/themes}/Solarized Dark.itermcolors (100%) diff --git a/.dotfiles/tag-dev-setup/ds-themes/Preferences.sublime-settings b/.dotfiles/tag-dev-setup/dev-setup/themes/Preferences.sublime-settings similarity index 100% rename from .dotfiles/tag-dev-setup/ds-themes/Preferences.sublime-settings rename to .dotfiles/tag-dev-setup/dev-setup/themes/Preferences.sublime-settings diff --git a/.dotfiles/tag-dev-setup/ds-themes/Solarized Dark xterm-256color.terminal b/.dotfiles/tag-dev-setup/dev-setup/themes/Solarized Dark xterm-256color.terminal similarity index 100% rename from .dotfiles/tag-dev-setup/ds-themes/Solarized Dark xterm-256color.terminal rename to .dotfiles/tag-dev-setup/dev-setup/themes/Solarized Dark xterm-256color.terminal diff --git a/.dotfiles/tag-dev-setup/ds-themes/Solarized Dark.itermcolors b/.dotfiles/tag-dev-setup/dev-setup/themes/Solarized Dark.itermcolors similarity index 100% rename from .dotfiles/tag-dev-setup/ds-themes/Solarized Dark.itermcolors rename to .dotfiles/tag-dev-setup/dev-setup/themes/Solarized Dark.itermcolors diff --git a/.rcrc b/.rcrc index c22e1a4fa..040f67d05 100644 --- a/.rcrc +++ b/.rcrc @@ -1,4 +1,4 @@ DOTFILES_DIRS=".dotfiles" TAGS="dev-setup" -SYMLINK_DIRS="ds-themes" +SYMLINK_DIRS="dev-setup" UNDOTTED="bin" diff --git a/osx.sh b/osx.sh index ac85bf408..20ee75e2d 100755 --- a/osx.sh +++ b/osx.sh @@ -586,7 +586,7 @@ tell application "Terminal" (* Open the custom theme so that it gets added to the list of available terminal themes (note: this will open two additional terminal windows). *) - do shell script "open '$HOME/.ds-themes/" & themeName & ".terminal'" + do shell script "open '$HOME/.dev-setup/themes/" & themeName & ".terminal'" (* Wait a little bit to ensure that the custom theme is added. *) delay 1 @@ -640,7 +640,7 @@ start_if_needed() { # Install the Solarized Dark theme for iTerm start_if_needed iTerm -open "${HOME}/.ds-themes/Solarized Dark.itermcolors" +open "${HOME}/.dev-setup/themes/Solarized Dark.itermcolors" # Don’t display the annoying prompt when quitting iTerm defaults write com.googlecode.iterm2 PromptOnQuit -bool false @@ -774,7 +774,7 @@ defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false ############################################################################### # Install Sublime Text settings -cp -r ${HOME}/.ds-themes/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null +cp -r ${HOME}/.dev-setup/themes/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null ############################################################################### # Transmission.app # From 497756f8c9d599def9e5c592e090ffbdcfd784a1 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Fri, 30 Mar 2018 00:52:35 +0200 Subject: [PATCH 04/13] Use Homebrew Bundle --- .dotfiles/tag-dev-setup/brew-bundle.sh | 24 +++ .dotfiles/tag-dev-setup/ds-brewfiles/android | 8 + .dotfiles/tag-dev-setup/ds-brewfiles/aws | 1 + .dotfiles/tag-dev-setup/ds-brewfiles/core | 147 +++++++++++++++ .../tag-dev-setup/ds-brewfiles/datastores | 13 ++ .dotfiles/tag-dev-setup/ds-brewfiles/web | 1 + .dots | 6 +- .rcrc | 1 + README.md | 40 ++-- android.sh | 27 +-- aws.sh | 12 +- brew.sh | 174 ------------------ core.sh | 24 +++ datastores.sh | 33 +--- web.sh | 23 +-- 15 files changed, 246 insertions(+), 288 deletions(-) create mode 100755 .dotfiles/tag-dev-setup/brew-bundle.sh create mode 100644 .dotfiles/tag-dev-setup/ds-brewfiles/android create mode 100644 .dotfiles/tag-dev-setup/ds-brewfiles/aws create mode 100644 .dotfiles/tag-dev-setup/ds-brewfiles/core create mode 100644 .dotfiles/tag-dev-setup/ds-brewfiles/datastores create mode 100644 .dotfiles/tag-dev-setup/ds-brewfiles/web delete mode 100755 brew.sh create mode 100755 core.sh diff --git a/.dotfiles/tag-dev-setup/brew-bundle.sh b/.dotfiles/tag-dev-setup/brew-bundle.sh new file mode 100755 index 000000000..7d9656312 --- /dev/null +++ b/.dotfiles/tag-dev-setup/brew-bundle.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Install command-line tools using Homebrew. + +# Ask for the administrator password upfront. +sudo -v + +# Keep-alive: update existing `sudo` time stamp until the script has finished. +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 + +# Make sure we’re using the latest Homebrew. +brew update + +brew bundle "$@" + +# Remove outdated versions from the cellar. +brew cleanup diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/android b/.dotfiles/tag-dev-setup/ds-brewfiles/android new file mode 100644 index 000000000..9fcd14fdd --- /dev/null +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/android @@ -0,0 +1,8 @@ +cask_args appdir: "/Applications" + +brew "android-sdk" + +cask "java" +cask "intellij-idea-ce" +cask "android-studio" + diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/aws b/.dotfiles/tag-dev-setup/ds-brewfiles/aws new file mode 100644 index 000000000..c882158e3 --- /dev/null +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/aws @@ -0,0 +1 @@ +brew "apache-spark" diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/core b/.dotfiles/tag-dev-setup/ds-brewfiles/core new file mode 100644 index 000000000..dda17937f --- /dev/null +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/core @@ -0,0 +1,147 @@ +cask_args appdir: "/Applications" + +tap "homebrew/versions" +tap "bramstein/webfonttools" + +brew "coreutils" + +# Install some other useful utilities like `sponge`. +brew "moreutils" + +# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. +brew "findutils" + +# Install GNU `sed`, overwriting the built-in `sed`. +brew "gnu-sed", args: ["with-default-names"] + +# Install Bash 4. +brew "bash" + +brew "bash-completion2" + +# Install `wget` with IRI support. +brew "wget", args: ["with-iri"] + +# Install RingoJS and Narwhal. +# Note that the order in which these are installed is important; +# see http://git.io/brew-narwhal-ringo. +brew "ringojs" +brew "narwhal" + +# Install Python +brew "python" +brew "python3" + +# Install ruby-build and rbenv +brew "ruby-build" +brew "rbenv" + +# Install more recent versions of some OS X tools. +brew "vim", args: ["override-system-vi"] +brew "homebrew/dupes/grep" +brew "homebrew/dupes/openssh" +brew "homebrew/dupes/screen" +brew "homebrew/php/php55", args: ["with-gmp"] + +# Install font tools. + +brew "sfnt2woff" +brew "sfnt2woff-zopfli" +brew "woff2" + +# Install some CTF tools; see https://github.com/ctfs/write-ups. +brew "aircrack-ng" +brew "bfg" +brew "binutils" +brew "binwalk" +brew "cifer" +brew "dex2jar" +brew "dns2tcp" +brew "fcrackzip" +brew "foremost" +brew "hashpump" +brew "hydra" +brew "john" +brew "knock" +brew "netpbm" +brew "nmap" +brew "pngcheck" +brew "socat" +brew "sqlmap" +brew "tcpflow" +brew "tcpreplay" +brew "tcptrace" +brew "ucspi-tcp" # `tcpserver` etc. +brew "homebrew/x11/xpdf" +brew "xz" + +# Install other useful binaries. +brew "ack" +brew "dark-mode" +#brew "exiv2" +brew "git" +brew "git-lfs" +brew "git-flow" +brew "git-extras" +brew "hub" +brew "imagemagick", args: ["with-webp"] +brew "lua" +brew "lynx" +brew "p7zip" +brew "pigz" +brew "pv" +brew "rename" +brew "rhino" +brew "speedtest_cli" +brew "ssh-copy-id" +brew "tree" +brew "webkit2png" +brew "zopfli" +brew "pkg-config libffi" +brew "pandoc" + +# Lxml and Libxslt +brew "libxml2" +brew "libxslt" + +# Install Heroku +brew "heroku-toolbelt" + +# Core casks +cask "alfred" +cask "iterm2" +cask "java" +cask "xquartz" + +# Development tool casks +cask "sublime-text" +cask "atom" +cask "virtualbox" +cask "vagrant" +cask "macdown" + +# Misc casks +cask "google-chrome" +cask "firefox" +cask "skype" +cask "slack" +cask "dropbox" +cask "evernote" +cask "1password" +#cask "gimp" +#cask "inkscape + +# Install Docker, which requires virtualbox +brew "docker" +brew "boot2docker" + +# Install developer friendly quick look plugins; see https://github.com/sindresorhus/quick-look-plugins +cask "qlcolorcode" +cask "qlstephen" +cask "qlmarkdown" +cask "quicklook-json" +cask "qlimagesize" +cask "webpquicklook" +cask "suspicious-package" +cask "quicklookase" +cask "qlvideo" diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/datastores b/.dotfiles/tag-dev-setup/ds-brewfiles/datastores new file mode 100644 index 000000000..327854709 --- /dev/null +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/datastores @@ -0,0 +1,13 @@ +cask_args appdir: "/Applications" + +# Install data stores +brew "mysql" +brew "postgresql" +brew "mongo" +brew "redis" +brew "elasticsearch" + +# Install mysql workbench +# Install Cask +brew "caskroom/cask/brew-cask" +cask "mysqlworkbench" diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/web b/.dotfiles/tag-dev-setup/ds-brewfiles/web new file mode 100644 index 000000000..e4feee601 --- /dev/null +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/web @@ -0,0 +1 @@ +brew "node" diff --git a/.dots b/.dots index 3d2b69484..20194ed41 100755 --- a/.dots +++ b/.dots @@ -34,9 +34,9 @@ function runDots() { ./osxprep.sh fi if [ $ARG == "brew" ] || [ $ARG == "all" ]; then - # Run the brew.sh Script + # Run the core.sh Script # For a full listing of installed formulae and apps, refer to - # the commented brew.sh source file directly and tweak it to + # the commented core.sh source file directly and tweak it to # suit your needs. echo "" echo "------------------------------" @@ -44,7 +44,7 @@ function runDots() { echo "This might awhile to complete, as some formulae need to be installed from source." echo "------------------------------" echo "" - ./brew.sh + ./core.sh fi if [ $ARG == "osx" ] || [ $ARG == "all" ]; then diff --git a/.rcrc b/.rcrc index 040f67d05..740f4c77e 100644 --- a/.rcrc +++ b/.rcrc @@ -2,3 +2,4 @@ DOTFILES_DIRS=".dotfiles" TAGS="dev-setup" SYMLINK_DIRS="dev-setup" UNDOTTED="bin" +EXCLUDES="ds-brewfiles/* brew-bundle.sh" diff --git a/README.md b/README.md index ea1ce4a06..90491edfd 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ This repo takes a more **light-weight** approach to automation using a combinati * Syncs dev-setup to your local home directory `~` * [osxprep.sh script](#osxprepsh-script) * Updates OS X and installs Xcode command line tools -* [brew.sh script](#brewsh-script) +* [core.sh script](#brewsh-script) * Installs common Homebrew formulae and apps * [osx.sh script](#osxsh-script) * Sets up OS X defaults geared towards developers @@ -167,11 +167,11 @@ Run all: $ ./.dots all -Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`: +Run `bootstrap.sh`, `osxprep.sh`, `core.sh`, and `osx.sh`: $ ./.dots bootstrap osxprep brew osx -Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: +Run `bootstrap.sh`, `osxprep.sh`, `core.sh`, and `osx.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: $ ./.dots bootstrap osxprep brew osx pydata aws datastores @@ -187,7 +187,7 @@ Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh` * Syncs dev-setup to your local home directory `~` * [osxprep.sh](https://github.com/donnemartin/dev-setup/blob/master/osxprep.sh) * Updates OS X and installs Xcode command line tools -* [brew.sh](https://github.com/donnemartin/dev-setup/blob/master/brew.sh) +* [core.sh](https://github.com/donnemartin/dev-setup/blob/master/core.sh) * Installs common Homebrew formulae and apps * [osx.sh](https://github.com/donnemartin/dev-setup/blob/master/osx.sh) * Sets up OS X defaults geared towards developers @@ -209,7 +209,7 @@ Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh` * If OS X updates require a restart, simply run `.dots` again to resume where you left off. * When installing the Xcode command line tools, a dialog box will confirm installation. * Once Xcode is installed, follow the instructions on the terminal to continue. -* `.dots` runs `brew.sh`, which takes awhile to complete as some formulae need to be installed from source. +* `.dots` runs `core.sh`, which takes awhile to complete as some formulae need to be installed from source. * **When `.dots` completes, be sure to restart your computer for all updates to take effect.** I encourage you to read through Section 1 so you have a better idea of what each installation script does. The following discussions describe in greater detail what is executed when running the [.dots](https://github.com/donnemartin/dev-setup/blob/master/.dots) script. @@ -316,22 +316,22 @@ If you're running 10.8 or older, you'll need to go to [http://developer.apple.co Once you reach the downloads page, search for "command line tools", and download the latest **Command Line Tools (OS X Mountain Lion) for Xcode**. Open the **.dmg** file once it's done downloading, and double-click on the **.mpkg** installer to launch the installation. When it's done, you can unmount the disk in Finder. -### brew.sh script +### core.sh script


-When setting up a new Mac, you may want to install [Homebrew](http://brew.sh/), a package manager that simplifies installing and updating applications or libraries. +When setting up a new Mac, you may want to install [Homebrew](http://core.sh/), a package manager that simplifies installing and updating applications or libraries. -Some of the apps installed by the `brew.sh` script include: Chrome, Firefox, Sublime Text, Atom, Dropbox, Evernote, Skype, Slack, Alfred, VirtualBox, Vagrant, Docker, etc. **For a full listing of installed formulae and apps, refer to the commented [brew.sh source file](https://github.com/donnemartin/dev-setup/blob/master/brew.sh) directly and tweak it to suit your needs.** +Some of the apps installed by the `core.sh` script include: Chrome, Firefox, Sublime Text, Atom, Dropbox, Evernote, Skype, Slack, Alfred, VirtualBox, Vagrant, Docker, etc. **For a full listing of installed formulae and apps, refer to the commented [core.sh source file](https://github.com/donnemartin/dev-setup/blob/master/core.sh) directly and tweak it to suit your needs.** -Run the `brew.sh` script: +Run the `core.sh` script: - $ ./brew.sh + $ ./core.sh -The `brew.sh` script takes awhile to complete, as some formulae need to be installed from source. +The `core.sh` script takes awhile to complete, as some formulae need to be installed from source. **For your terminal customization to take full effect, quit and re-start the terminal** @@ -444,7 +444,7 @@ With the terminal, the text editor is a developer's most important tool. Everyon #### Installation -The [brew.sh script](#brewsh-script) installs Sublime Text. +The [core.sh script](#brewsh-script) installs Sublime Text. If you prefer to install it separately, go ahead and [download](http://www.sublimetext.com/) it. Open the **.dmg** file, drag-and-drop in the **Applications** folder. @@ -524,7 +524,7 @@ I set my comments color to `#E6DB74`. #### Installation -The [brew.sh script](#brewsh-script) installs Atom. +The [core.sh script](#brewsh-script) installs Atom. If you prefer to install it separately, [download](https://atom.io/) it, open the **.dmg** file, drag-and-drop in the **Applications** folder. @@ -602,7 +602,7 @@ VirtualBox creates and manages virtual machines. It's a solid free solution to #### Installation -The [brew.sh script](#brewsh-script) installs VirtualBox +The [core.sh script](#brewsh-script) installs VirtualBox If you prefer to install it separately, you can download it [here](https://www.virtualbox.org/wiki/Downloads) or run: @@ -621,7 +621,7 @@ Vagrant creates and configures development environments. You can think of it as #### Installation -The [brew.sh script](#brewsh-script) installs Vagrant. +The [core.sh script](#brewsh-script) installs Vagrant. If you prefer to install it separately, you can download it [here](https://www.vagrantup.com/) or run: @@ -640,7 +640,7 @@ Docker automates the deployment of applications inside software containers. I t #### Installation -The [brew.sh script](#brewsh-script) installs Docker. +The [core.sh script](#brewsh-script) installs Docker. If you prefer to install it separately, you can download it [here](https://www.docker.com/) or run: @@ -710,11 +710,11 @@ To push code to your GitHub repositories, we're going to use the recommended HTT

-Package managers make it so much easier to install and update applications (for Operating Systems) or libraries (for programming languages). The most popular one for OS X is [Homebrew](http://brew.sh/). +Package managers make it so much easier to install and update applications (for Operating Systems) or libraries (for programming languages). The most popular one for OS X is [Homebrew](http://core.sh/). #### Installation -The [brew.sh script](#brewsh-script) installs Homebrew and a number of useful Homebrew formulae and apps. +The [core.sh script](#brewsh-script) installs Homebrew and a number of useful Homebrew formulae and apps. If you prefer to install it separately, run the following command and follow the steps on the screen: @@ -763,7 +763,7 @@ To see what you have installed (with their version numbers): #### Installation -`brew.sh` provides [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build) which allow you to manage multiple versions of Ruby on the same machine. `brew.sh` adds the following line to your `.extra` file to initialize `rbenv`: +`core.sh` provides [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build) which allow you to manage multiple versions of Ruby on the same machine. `core.sh` adds the following line to your `.extra` file to initialize `rbenv`: ``` eval "$(rbenv init -)" @@ -811,7 +811,7 @@ OS X, like Linux, ships with [Python](http://python.org/) already installed. But #### Installation -The [brew.sh script](#brewsh-script) installs the latest versions of Python 2 and Python 3. +The [core.sh script](#brewsh-script) installs the latest versions of Python 2 and Python 3. ### Pip diff --git a/android.sh b/android.sh index a646696b9..bfce04137 100755 --- a/android.sh +++ b/android.sh @@ -1,28 +1,3 @@ #!/usr/bin/env bash -# Install command-line tools using Homebrew. - -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 - -# Make sure we’re using the latest Homebrew. -brew update - -brew cask install --appdir="~/Applications" java -brew cask install --appdir="~/Applications" intellij-idea-ce -brew cask install --appdir="~/Applications" android-studio - -brew install android-sdk - -# Remove outdated versions from the cellar. -brew cleanup +./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/android diff --git a/aws.sh b/aws.sh index 0ffad52be..12207b960 100755 --- a/aws.sh +++ b/aws.sh @@ -72,17 +72,7 @@ pip install awscli # System-Wide Packages # ############################################################################### -# 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 - -# Make sure we’re using the latest Homebrew. -brew update - -brew install apache-spark +./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/aws ############################################################################### # Install IPython Notebook Spark Integration diff --git a/brew.sh b/brew.sh deleted file mode 100755 index 22a64c4f5..000000000 --- a/brew.sh +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env bash - -# Install command-line tools using Homebrew. - -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 - -# Make sure we’re using the latest Homebrew. -brew update - -# Upgrade any already-installed formulae. -brew upgrade --all - -# Install GNU core utilities (those that come with OS X are outdated). -# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. -brew install coreutils -sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum - -# Install some other useful utilities like `sponge`. -brew install moreutils -# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. -brew install findutils -# Install GNU `sed`, overwriting the built-in `sed`. -brew install gnu-sed --with-default-names -# Install Bash 4. -brew install bash -brew tap homebrew/versions -brew install bash-completion2 -# We installed the new shell, now we have to activate it -echo "Adding the newly installed shell to the list of allowed shells" -# Prompts for password -sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' -# Change to the new shell, prompts for password -chsh -s /usr/local/bin/bash - -# Install `wget` with IRI support. -brew install wget --with-iri - -# Install RingoJS and Narwhal. -# Note that the order in which these are installed is important; -# see http://git.io/brew-narwhal-ringo. -brew install ringojs -brew install narwhal - -# Install Python -brew install python -brew install python3 - -# Install ruby-build and rbenv -brew install ruby-build -brew install rbenv -LINE='eval "$(rbenv init -)"' -grep -q "$LINE" ~/.extra || echo "$LINE" >> ~/.extra - -# Install more recent versions of some OS X tools. -brew install vim --override-system-vi -brew install homebrew/dupes/grep -brew install homebrew/dupes/openssh -brew install homebrew/dupes/screen -brew install homebrew/php/php55 --with-gmp - -# Install font tools. -brew tap bramstein/webfonttools -brew install sfnt2woff -brew install sfnt2woff-zopfli -brew install woff2 - -# Install some CTF tools; see https://github.com/ctfs/write-ups. -brew install aircrack-ng -brew install bfg -brew install binutils -brew install binwalk -brew install cifer -brew install dex2jar -brew install dns2tcp -brew install fcrackzip -brew install foremost -brew install hashpump -brew install hydra -brew install john -brew install knock -brew install netpbm -brew install nmap -brew install pngcheck -brew install socat -brew install sqlmap -brew install tcpflow -brew install tcpreplay -brew install tcptrace -brew install ucspi-tcp # `tcpserver` etc. -brew install homebrew/x11/xpdf -brew install xz - -# Install other useful binaries. -brew install ack -brew install dark-mode -#brew install exiv2 -brew install git -brew install git-lfs -brew install git-flow -brew install git-extras -brew install hub -brew install imagemagick --with-webp -brew install lua -brew install lynx -brew install p7zip -brew install pigz -brew install pv -brew install rename -brew install rhino -brew install speedtest_cli -brew install ssh-copy-id -brew install tree -brew install webkit2png -brew install zopfli -brew install pkg-config libffi -brew install pandoc - -# Lxml and Libxslt -brew install libxml2 -brew install libxslt -brew link libxml2 --force -brew link libxslt --force - -# Install Heroku -brew install heroku-toolbelt -heroku update - -# Core casks -brew cask install --appdir="/Applications" alfred -brew cask install --appdir="~/Applications" iterm2 -brew cask install --appdir="~/Applications" java -brew cask install --appdir="~/Applications" xquartz - -# Development tool casks -brew cask install --appdir="/Applications" sublime-text -brew cask install --appdir="/Applications" atom -brew cask install --appdir="/Applications" virtualbox -brew cask install --appdir="/Applications" vagrant -brew cask install --appdir="/Applications" macdown - -# Misc casks -brew cask install --appdir="/Applications" google-chrome -brew cask install --appdir="/Applications" firefox -brew cask install --appdir="/Applications" skype -brew cask install --appdir="/Applications" slack -brew cask install --appdir="/Applications" dropbox -brew cask install --appdir="/Applications" evernote -brew cask install --appdir="/Applications" 1password -#brew cask install --appdir="/Applications" gimp -#brew cask install --appdir="/Applications" inkscape - -#Remove comment to install LaTeX distribution MacTeX -#brew cask install --appdir="/Applications" mactex - -# Install Docker, which requires virtualbox -brew install docker -brew install boot2docker - -# Install developer friendly quick look plugins; see https://github.com/sindresorhus/quick-look-plugins -brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook suspicious-package - -# Remove outdated versions from the cellar. -brew cleanup diff --git a/core.sh b/core.sh new file mode 100755 index 000000000..b578c1542 --- /dev/null +++ b/core.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/core + +# GNU core utilities (those that come with OS X are outdated). +# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. +sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum + +# We installed the new shell, now we have to activate it +echo "Adding the newly installed shell to the list of allowed shells" +# Prompts for password +sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' +# Change to the new shell, prompts for password +chsh -s /usr/local/bin/bash + +LINE='eval "$(rbenv init -)"' +grep -q "$LINE" ~/.extra || echo "$LINE" >> ~/.extra + +# Lxml and Libxslt +brew link libxml2 --force +brew link libxslt --force + +# Heroku +heroku update diff --git a/datastores.sh b/datastores.sh index bc6fb882e..ec909b9d9 100755 --- a/datastores.sh +++ b/datastores.sh @@ -1,34 +1,3 @@ #!/usr/bin/env bash -# Install command-line tools using Homebrew. - -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 - -# Make sure we’re using the latest Homebrew. -brew update - -# Install data stores -brew install mysql -brew install postgresql -brew install mongo -brew install redis -brew install elasticsearch - -# Install mysql workbench -# Install Cask -brew install caskroom/cask/brew-cask -brew cask install --appdir="/Applications" mysqlworkbench - -# Remove outdated versions from the cellar. -brew cleanup \ No newline at end of file +./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/datastores diff --git a/web.sh b/web.sh index dee44602c..346cdabf3 100755 --- a/web.sh +++ b/web.sh @@ -1,27 +1,6 @@ #!/usr/bin/env bash -# Install command-line tools using Homebrew. - -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 - -# Make sure we’re using the latest Homebrew. -brew update - -brew install node - -# Remove outdated versions from the cellar. -brew cleanup +./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/web npm install -g coffee-script npm install -g grunt-cli From 743c47631b98cee5ea1194aa393617ed8d152af0 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Fri, 30 Mar 2018 01:11:12 +0200 Subject: [PATCH 05/13] Remove "caskroom/cask/brew-cask" as it is deprecated --- .dotfiles/tag-dev-setup/ds-brewfiles/datastores | 2 -- README.md | 6 ------ 2 files changed, 8 deletions(-) diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/datastores b/.dotfiles/tag-dev-setup/ds-brewfiles/datastores index 327854709..0ef94fa61 100644 --- a/.dotfiles/tag-dev-setup/ds-brewfiles/datastores +++ b/.dotfiles/tag-dev-setup/ds-brewfiles/datastores @@ -8,6 +8,4 @@ brew "redis" brew "elasticsearch" # Install mysql workbench -# Install Cask -brew "caskroom/cask/brew-cask" cask "mysqlworkbench" diff --git a/README.md b/README.md index 90491edfd..2600915f5 100644 --- a/README.md +++ b/README.md @@ -607,7 +607,6 @@ The [core.sh script](#brewsh-script) installs VirtualBox If you prefer to install it separately, you can download it [here](https://www.virtualbox.org/wiki/Downloads) or run: $ brew update - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="/Applications" virtualbox ### Vagrant @@ -626,7 +625,6 @@ The [core.sh script](#brewsh-script) installs Vagrant. If you prefer to install it separately, you can download it [here](https://www.vagrantup.com/) or run: $ brew update - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="/Applications" vagrant ### Docker @@ -1566,7 +1564,6 @@ In terms of a GUI client for MySQL, I'm used to the official and free [MySQL Wor The [datastores.sh script](#datastoressh-script) installs MySQL Workbench. If you prefer to install it separately, run: - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="/Applications" mysqlworkbench You can also find the MySQL Workbench download [here](http://www.mysql.com/downloads/workbench/). (**Note**: It will ask you to sign in, you don't need to, just click on "No thanks, just start my download!" at the bottom.) @@ -1823,7 +1820,6 @@ The [android.sh script](#androidsh-script) installs Java. If you prefer to install it separately, you can download the JDK [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or run: $ brew update - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="~/Applications" java ### Android SDK @@ -1849,7 +1845,6 @@ The [android.sh script](#androidsh-script) installs Android Studio. If you prefer to install it separately, you can download it [here](https://developer.android.com/sdk/index.html) or run: $ brew update - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="~/Applications" android-studio ### IntelliJ IDEA @@ -1864,7 +1859,6 @@ The [android.sh script](#androidsh-script) installs Java. If you prefer to install it separately, you can download it [here](https://www.jetbrains.com/idea/download/) or run: $ brew update - $ brew install caskroom/cask/brew-cask $ brew cask install --appdir="~/Applications" intellij-idea-ce ## Section 8: Misc From 4682c2e48050920d30833dee6e293169dd877f9c Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Fri, 30 Mar 2018 17:07:32 +0200 Subject: [PATCH 06/13] Move brewfiles into dev-setup directory --- .../{ => dev-setup}/brew-bundle.sh | 0 .../brewfiles}/android | 0 .../{ds-brewfiles => dev-setup/brewfiles}/aws | 0 .../brewfiles}/core | 0 .../brewfiles}/datastores | 0 .../tag-dev-setup/dev-setup/brewfiles/rcm | 3 +++ .../{ds-brewfiles => dev-setup/brewfiles}/web | 0 .rcrc | 2 -- android.sh | 2 +- aws.sh | 2 +- core.sh | 2 +- datastores.sh | 2 +- rcm.sh | 21 +------------------ web.sh | 2 +- 14 files changed, 9 insertions(+), 27 deletions(-) rename .dotfiles/tag-dev-setup/{ => dev-setup}/brew-bundle.sh (100%) rename .dotfiles/tag-dev-setup/{ds-brewfiles => dev-setup/brewfiles}/android (100%) rename .dotfiles/tag-dev-setup/{ds-brewfiles => dev-setup/brewfiles}/aws (100%) rename .dotfiles/tag-dev-setup/{ds-brewfiles => dev-setup/brewfiles}/core (100%) rename .dotfiles/tag-dev-setup/{ds-brewfiles => dev-setup/brewfiles}/datastores (100%) create mode 100644 .dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm rename .dotfiles/tag-dev-setup/{ds-brewfiles => dev-setup/brewfiles}/web (100%) diff --git a/.dotfiles/tag-dev-setup/brew-bundle.sh b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh similarity index 100% rename from .dotfiles/tag-dev-setup/brew-bundle.sh rename to .dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/android b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/android similarity index 100% rename from .dotfiles/tag-dev-setup/ds-brewfiles/android rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/android diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/aws b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/aws similarity index 100% rename from .dotfiles/tag-dev-setup/ds-brewfiles/aws rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/aws diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/core b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/core similarity index 100% rename from .dotfiles/tag-dev-setup/ds-brewfiles/core rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/core diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/datastores b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/datastores similarity index 100% rename from .dotfiles/tag-dev-setup/ds-brewfiles/datastores rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/datastores diff --git a/.dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm new file mode 100644 index 000000000..01958ca45 --- /dev/null +++ b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm @@ -0,0 +1,3 @@ +tap "thoughtbot/formulae" + +brew "rcm" diff --git a/.dotfiles/tag-dev-setup/ds-brewfiles/web b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/web similarity index 100% rename from .dotfiles/tag-dev-setup/ds-brewfiles/web rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/web diff --git a/.rcrc b/.rcrc index 740f4c77e..368e0aacb 100644 --- a/.rcrc +++ b/.rcrc @@ -1,5 +1,3 @@ DOTFILES_DIRS=".dotfiles" TAGS="dev-setup" -SYMLINK_DIRS="dev-setup" UNDOTTED="bin" -EXCLUDES="ds-brewfiles/* brew-bundle.sh" diff --git a/android.sh b/android.sh index bfce04137..8b1e5a17a 100755 --- a/android.sh +++ b/android.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/android +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/android diff --git a/aws.sh b/aws.sh index 12207b960..928e5ebd8 100755 --- a/aws.sh +++ b/aws.sh @@ -72,7 +72,7 @@ pip install awscli # System-Wide Packages # ############################################################################### -./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/aws +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/aws ############################################################################### # Install IPython Notebook Spark Integration diff --git a/core.sh b/core.sh index b578c1542..ebe9dc611 100755 --- a/core.sh +++ b/core.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/core +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/core # GNU core utilities (those that come with OS X are outdated). # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. diff --git a/datastores.sh b/datastores.sh index ec909b9d9..e5dacce6e 100755 --- a/datastores.sh +++ b/datastores.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/datastores +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/datastores diff --git a/rcm.sh b/rcm.sh index 00f43109d..dad36708f 100755 --- a/rcm.sh +++ b/rcm.sh @@ -1,25 +1,6 @@ #!/usr/bin/env bash -# Install command-line tools using Homebrew. - -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 - -# Make sure we’re using the latest Homebrew. -brew update - -brew tap thoughtbot/formulae -brew install rcm +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/rcm # setup dotfiles env RCRC=".rcrc" rcup diff --git a/web.sh b/web.sh index 346cdabf3..f0b134b33 100755 --- a/web.sh +++ b/web.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -./.dotfiles/tag-dev-setup/brew-bundle.sh install --file=.dotfiles/tag-dev-setup/ds-brewfiles/web +./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/web npm install -g coffee-script npm install -g grunt-cli From 21b3d0f256886cc67a94405af3a2628d73896832 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Mon, 2 Apr 2018 19:14:47 +0200 Subject: [PATCH 07/13] Replace .dots with dev-setup management script --- .dots | 118 ---------------------------------- android.sh | 5 ++ aws.sh | 7 +- core.sh | 12 ++++ datastores.sh | 5 ++ dev-setup | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++ osx.sh | 13 ++++ osxprep.sh | 8 ++- pydata.sh | 6 +- rcm.sh | 5 ++ web.sh | 5 ++ 11 files changed, 236 insertions(+), 123 deletions(-) delete mode 100755 .dots create mode 100755 dev-setup diff --git a/.dots b/.dots deleted file mode 100755 index 20194ed41..000000000 --- a/.dots +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash - -function runDots() { - # Ask for the administrator password upfront - sudo -v - - # Keep-alive: update existing `sudo` time stamp until the script has finished - while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - - # Run sections based on command line arguments - for ARG in "$@" - do - if [ $ARG == "bootstrap" ] || [ $ARG == "all" ]; then - echo "" - echo "------------------------------" - echo "Syncing the dev-setup repo to your local machine." - echo "------------------------------" - echo "" - cd ~ && curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,LICENSE} - - echo "------------------------------" - echo "Installing rcm via homebrew to setup all dotfiles." - echo "------------------------------" - echo "" - ./rcm.sh - fi - if [ $ARG == "osxprep" ] || [ $ARG == "all" ]; then - # Run the osxprep.sh Script - echo "" - echo "------------------------------" - echo "Updating OSX and installing Xcode command line tools" - echo "------------------------------" - echo "" - ./osxprep.sh - fi - if [ $ARG == "brew" ] || [ $ARG == "all" ]; then - # Run the core.sh Script - # For a full listing of installed formulae and apps, refer to - # the commented core.sh source file directly and tweak it to - # suit your needs. - echo "" - echo "------------------------------" - echo "Installing Homebrew along with some common formulae and apps." - echo "This might awhile to complete, as some formulae need to be installed from source." - echo "------------------------------" - echo "" - ./core.sh - fi - - if [ $ARG == "osx" ] || [ $ARG == "all" ]; then - # Run the osx.sh Script - # I strongly suggest you read through the commented osx.sh - # source file and tweak any settings based on your personal - # preferences. The script defaults are intended for you to - # customize. For example, if you are not running an SSD you - # might want to change some of the settings listed in the - # SSD section. - echo "" - echo "------------------------------" - echo "Setting sensible OSX defaults." - echo "------------------------------" - echo "" - ./osx.sh - fi - if [ $ARG == "pydata" ] || [ $ARG == "all" ]; then - # Run the pydata.sh Script - echo "------------------------------" - echo "Setting up Python data development environment." - echo "------------------------------" - echo "" - ./pydata.sh - fi - if [ $ARG == "aws" ] || [ $ARG == "all" ]; then - # Run the aws.sh Script - echo "------------------------------" - echo "Setting up AWS development environment." - echo "------------------------------" - echo "" - ./aws.sh - fi - if [ $ARG == "datastores" ] || [ $ARG == "all" ]; then - # Run the datastores.sh Script - echo "------------------------------" - echo "Setting up data stores." - echo "------------------------------" - echo "" - ./datastores.sh - fi - if [ $ARG == "web" ] || [ $ARG == "all" ]; then - # Run the web.sh Script - echo "------------------------------" - echo "Setting up JavaScript web development environment." - echo "------------------------------" - echo "" - ./web.sh - fi - if [ $ARG == "android" ] || [ $ARG == "all" ]; then - # Run the android.sh Script - echo "------------------------------" - echo "Setting up Android development environment." - echo "------------------------------" - echo "" - ./android.sh - fi - done - - echo "------------------------------" - echo "Completed running .dots, restart your computer to ensure all updates take effect" - echo "------------------------------" -} - -read -p "This script may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; -echo ""; -if [[ $REPLY =~ ^[Yy]$ ]]; then - runDots $@ -fi; - -unset runDots; diff --git a/android.sh b/android.sh index 8b1e5a17a..543463924 100755 --- a/android.sh +++ b/android.sh @@ -1,3 +1,8 @@ #!/usr/bin/env bash +echo "------------------------------" +echo "Setting up Android development environment." +echo "------------------------------" +echo "" + ./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/android diff --git a/aws.sh b/aws.sh index 928e5ebd8..ee4b201f7 100755 --- a/aws.sh +++ b/aws.sh @@ -1,9 +1,12 @@ #!/usr/bin/env bash -# ~/aws.sh +echo "------------------------------" +echo "Setting up AWS development environment." +echo "------------------------------" +echo "" + # Removed user's cached credentials -# This script might be run with .dots, which uses elevated privileges sudo -K echo "------------------------------" diff --git a/core.sh b/core.sh index ebe9dc611..c303b2999 100755 --- a/core.sh +++ b/core.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash +# Run the core.sh Script +# For a full listing of installed formulae and apps, refer to +# the commented core.sh source file directly and tweak it to +# suit your needs. + +echo "" +echo "------------------------------" +echo "Installing Homebrew along with some common formulae and apps." +echo "This might awhile to complete, as some formulae need to be installed from source." +echo "------------------------------" +echo "" + ./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/core # GNU core utilities (those that come with OS X are outdated). diff --git a/datastores.sh b/datastores.sh index e5dacce6e..941117caf 100755 --- a/datastores.sh +++ b/datastores.sh @@ -1,3 +1,8 @@ #!/usr/bin/env bash +echo "------------------------------" +echo "Setting up data stores." +echo "------------------------------" +echo "" + ./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/datastores diff --git a/dev-setup b/dev-setup new file mode 100755 index 000000000..5790d4b89 --- /dev/null +++ b/dev-setup @@ -0,0 +1,175 @@ +#!/bin/bash +# +# This is a rather minimal example Argbash potential +# Example taken from http://argbash.readthedocs.io/en/stable/example.html +# +# ARG_OPTIONAL_BOOLEAN([selfupdate],[],[Update dev-setup],[]) +# ARG_OPTIONAL_BOOLEAN([dryrun],[],[Output only, no changes],[]) +# ARG_OPTIONAL_REPEATED([modules],[m],[Modules to provision]) +# ARG_TYPE_GROUP_SET([modules],[modules],[modules],[android,aws,core,datastores,osx,osxprep,pydata,rcm,web,all]) +# ARG_HELP([dev-setup installer]) +# ARGBASH_GO() +# needed because of Argbash --> m4_ignore([ +### START OF CODE GENERATED BY Argbash v2.6.1 one line above ### +# Argbash is a bash code generator used to get arguments parsing right. +# Argbash is FREE SOFTWARE, see https://argbash.io for more info +# Generated online by https://argbash.io/generate + +die() +{ + local _ret=$2 + test -n "$_ret" || _ret=1 + test "$_PRINT_HELP" = yes && print_help >&2 + echo "$1" >&2 + exit ${_ret} +} + +begins_with_short_option() +{ + local first_option all_short_options + all_short_options='mh' + first_option="${1:0:1}" + test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0 +} + + +# validators +modules() +{ + local _allowed=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web" "all") + local _seeking="$1" + for element in "${_allowed[@]}" + do + test "$element" = "$_seeking" && echo "$element" && return 0 + done + die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'android', 'aws', 'core', 'datastores', 'osx', 'osxprep', 'pydata', 'rcm', 'web' and 'all'" 4 +} + +# THE DEFAULTS INITIALIZATION - OPTIONALS +_arg_selfupdate="off" +_arg_dryrun="off" +_arg_modules=() + +print_help () +{ + printf '%s\n' "dev-setup installer" + printf 'Usage: %s [--(no-)selfupdate] [--(no-)dryrun] [-m|--modules ] [-h|--help]\n' "$0" + printf '\t%s\n' "--selfupdate,--no-selfupdate: Update dev-setup (off by default)" + printf '\t%s\n' "--dryrun,--no-dryrun: Output only, no changes (off by default)" + printf '\t%s\n' "-m,--modules: Modules to provision (one of 'android', 'aws', 'core', 'datastores', 'osx', 'osxprep', 'pydata', 'rcm', 'web' and 'all'; empty by default)" + printf '\t%s\n' "-h,--help: Prints help" +} + +parse_commandline () +{ + while test $# -gt 0 + do + _key="$1" + case "$_key" in + --no-selfupdate|--selfupdate) + _arg_selfupdate="on" + test "${1:0:5}" = "--no-" && _arg_selfupdate="off" + ;; + --no-dryrun|--dryrun) + _arg_dryrun="on" + test "${1:0:5}" = "--no-" && _arg_dryrun="off" + ;; + -m|--modules) + test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 + _arg_modules+=("$(modules "$2" "modules")") || exit 1 + shift + ;; + --modules=*) + _arg_modules+=("$(modules "${_key##--modules=}" "modules")") || exit 1 + ;; + -m*) + _arg_modules+=("$(modules "${_key##-m}" "modules")") || exit 1 + ;; + -h|--help) + print_help + exit 0 + ;; + -h*) + print_help + exit 0 + ;; + *) + _PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1 + ;; + esac + shift + done +} + +parse_commandline "$@" + +# OTHER STUFF GENERATED BY Argbash +# Validation of values + +### END OF CODE GENERATED BY Argbash (sortof) ### ]) +# [ <-- needed because of Argbash + +module_enabled() +{ + [[ " ${_arg_modules[@]} " =~ " ${1} " ]] +} + +should_provision() +{ + [[ ${_arg_dryrun} == "off" ]] +} + +provision_module() +{ + local module="${1}.sh" + + if [[ ! -e ${module} ]]; then + echo "${module} does not seem to exist, skipping." + false + return + fi + + echo "Running ${module} module" + + should_provision && echo "( ${module} )" +} + +# Run everything from home directory +( + cd ~ + + if [[ ${_arg_selfupdate} == "on" ]]; then + if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) ]]; then + echo "Update via git pull" + should_provision && git pull origin master + else + echo "Update via tarball download and extraction" + should_provision && curl -#L https://github.com/omares/dev-setup/tarball/master | tar -xv --strip-components 1 --exclude={README.md,LICENSE} + fi + + [[ ${#_arg_modules[@]} -eq 0 ]] && exit 0 + fi + + if [[ ${#_arg_modules[@]} -eq 0 ]]; then + _PRINT_HELP=yes die "Please provide a module to install" 1 + exit 0 + fi + + read -p "dev-setup may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; + echo ""; + [[ ! $REPLY =~ ^[Yy]$ ]] && exit 0 + + module_enabled "all" && _arg_modules=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web") + + for module in "${_arg_modules[@]}" + do + provision_module ${module} + done + + echo "------------------------------" + echo "Completed running dev-setup, restart your computer to ensure all updates take effect" + echo "------------------------------" + +) + +# ] <-- needed because of Argbash diff --git a/osx.sh b/osx.sh index 20ee75e2d..c0b10b1cb 100755 --- a/osx.sh +++ b/osx.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash +# Run the osx.sh Script +# I strongly suggest you read through the commented osx.sh +# source file and tweak any settings based on your personal +# preferences. The script defaults are intended for you to +# customize. For example, if you are not running an SSD you +# might want to change some of the settings listed in the +# SSD section. +echo "" +echo "------------------------------" +echo "Setting sensible OSX defaults." +echo "------------------------------" +echo "" + # ~/osx.sh — Originally from https://mths.be/osx # Ask for the administrator password upfront diff --git a/osxprep.sh b/osxprep.sh index 25f2301d6..26e5c1eb0 100755 --- a/osxprep.sh +++ b/osxprep.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +echo "" +echo "------------------------------" +echo "Updating OSX and installing Xcode command line tools" +echo "------------------------------" +echo "" + # Ask for the administrator password upfront sudo -v @@ -17,4 +23,4 @@ sudo softwareupdate -iva echo "------------------------------" echo "Installing Xcode Command Line Tools." # Install Xcode command line tools -xcode-select --install \ No newline at end of file +xcode-select --install diff --git a/pydata.sh b/pydata.sh index f1922aac5..cbc270271 100755 --- a/pydata.sh +++ b/pydata.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash -# ~/pydata.sh +echo "------------------------------" +echo "Setting up Python data development environment." +echo "------------------------------" +echo "" # Removed user's cached credentials -# This script might be run with .dots, which uses elevated privileges sudo -K echo "------------------------------" diff --git a/rcm.sh b/rcm.sh index dad36708f..6c2a173d2 100755 --- a/rcm.sh +++ b/rcm.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +echo "------------------------------" +echo "Installing rcm via homebrew to setup all dotfiles." +echo "------------------------------" +echo "" + ./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/rcm # setup dotfiles diff --git a/web.sh b/web.sh index f0b134b33..19e8745ce 100755 --- a/web.sh +++ b/web.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +echo "------------------------------" +echo "Setting up JavaScript web development environment." +echo "------------------------------" +echo "" + ./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/web npm install -g coffee-script From 911398f4198bf271da0e9c60bf6d1f78f4dc61b8 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Mon, 2 Apr 2018 23:20:54 +0200 Subject: [PATCH 08/13] Better sudo handling --- .../tag-dev-setup/dev-setup/brew-bundle.sh | 6 ---- aws.sh | 4 --- dev-setup | 32 +++++++++++++------ osx.sh | 12 +++---- osxprep.sh | 17 +++++----- pydata.sh | 3 -- 6 files changed, 36 insertions(+), 38 deletions(-) diff --git a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh index 7d9656312..416363308 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh @@ -2,12 +2,6 @@ # Install command-line tools using Homebrew. -# Ask for the administrator password upfront. -sudo -v - -# Keep-alive: update existing `sudo` time stamp until the script has finished. -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 diff --git a/aws.sh b/aws.sh index ee4b201f7..74ae2d76f 100755 --- a/aws.sh +++ b/aws.sh @@ -5,10 +5,6 @@ echo "Setting up AWS development environment." echo "------------------------------" echo "" - -# Removed user's cached credentials -sudo -K - echo "------------------------------" echo "Setting up AWS." echo "This script requires pip and virtualenvwrapper to be installed." diff --git a/dev-setup b/dev-setup index 5790d4b89..e48b4960f 100755 --- a/dev-setup +++ b/dev-setup @@ -109,19 +109,26 @@ parse_commandline "$@" ### END OF CODE GENERATED BY Argbash (sortof) ### ]) # [ <-- needed because of Argbash -module_enabled() -{ - [[ " ${_arg_modules[@]} " =~ " ${1} " ]] +should_provision() { + [[ ${_arg_dryrun} == "off" ]] } -should_provision() -{ - [[ ${_arg_dryrun} == "off" ]] +start_sudo() { + sudo -v + ( while true; do sudo -v; sleep 60; done; ) & + SUDO_PID="$!" + trap stop_sudo SIGINT SIGTERM } -provision_module() -{ +stop_sudo() { + kill "$SUDO_PID" + trap - SIGINT SIGTERM + sudo -k +} + +provision_module() { local module="${1}.sh" + local requires_sudo=("osx" "osxprep") if [[ ! -e ${module} ]]; then echo "${module} does not seem to exist, skipping." @@ -131,7 +138,11 @@ provision_module() echo "Running ${module} module" - should_provision && echo "( ${module} )" + if [[ " ${requires_sudo[@]} " =~ " ${1}" ]]; then + should_provision && echo "( start_sudo && ${module} && stop_sudo )" + else + should_provision && echo "( ${module} )" + fi } # Run everything from home directory @@ -159,7 +170,8 @@ provision_module() echo ""; [[ ! $REPLY =~ ^[Yy]$ ]] && exit 0 - module_enabled "all" && _arg_modules=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web") + + [[ " ${_arg_modules[@]} " =~ " all " ]] && _arg_modules=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web") for module in "${_arg_modules[@]}" do diff --git a/osx.sh b/osx.sh index c0b10b1cb..59c4c0f3f 100755 --- a/osx.sh +++ b/osx.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +if [[ "${EUID}" -ne 0 ]]; then + echo "This module requires sudo rights." + echo "You should run this module using the dev-setup script in your home directory." + exit 1 +fi + # Run the osx.sh Script # I strongly suggest you read through the commented osx.sh # source file and tweak any settings based on your personal @@ -15,12 +21,6 @@ echo "" # ~/osx.sh — Originally from https://mths.be/osx -# Ask for the administrator password upfront -sudo -v - -# Keep-alive: update existing `sudo` time stamp until `osx.sh` has finished -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - ############################################################################### # General UI/UX # ############################################################################### diff --git a/osxprep.sh b/osxprep.sh index 26e5c1eb0..81260563f 100755 --- a/osxprep.sh +++ b/osxprep.sh @@ -1,24 +1,23 @@ #!/usr/bin/env bash +if [[ "${EUID}" -ne 0 ]]; then + echo "This module requires sudo rights." + echo "You should run this module using the dev-setup script in your home directory." + exit 1 +fi + echo "" echo "------------------------------" echo "Updating OSX and installing Xcode command line tools" echo "------------------------------" echo "" -# Ask for the administrator password upfront -sudo -v - -# Keep-alive: update existing `sudo` time stamp until `osxprep.sh` has finished -while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & - # Step 1: Update the OS and Install Xcode Tools echo "------------------------------" echo "Updating OSX. If this requires a restart, run the script again." + # Install all available updates -sudo softwareupdate -iva -# Install only recommended available updates -#sudo softwareupdate -irv +sudo softwareupdate -i -a echo "------------------------------" echo "Installing Xcode Command Line Tools." diff --git a/pydata.sh b/pydata.sh index cbc270271..cad5a32dc 100755 --- a/pydata.sh +++ b/pydata.sh @@ -5,9 +5,6 @@ echo "Setting up Python data development environment." echo "------------------------------" echo "" -# Removed user's cached credentials -sudo -K - echo "------------------------------" echo "Setting up pip." From 780890e70bc23a3132bb3a44c121f65feb7f2452 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Tue, 3 Apr 2018 23:43:25 +0200 Subject: [PATCH 09/13] Better provisioning --- .../dev-setup/modules/android.sh | 0 .../tag-dev-setup/dev-setup/modules/aws.sh | 0 .../tag-dev-setup/dev-setup/modules/core.sh | 2 +- .../dev-setup/modules/datastores.sh | 0 .../tag-dev-setup/dev-setup/modules/macos.sh | 0 .../dev-setup/modules/macosprep.sh | 4 +- .../tag-dev-setup/dev-setup/modules/pydata.sh | 0 .../tag-dev-setup/dev-setup/modules/rcm.sh | 0 .../tag-dev-setup/dev-setup/modules/web.sh | 0 .dotfiles/tag-dev-setup/dev-setup/update.sh | 8 ++ bootstrap.sh | 23 ------ dev-setup | 81 +++++++++++-------- 12 files changed, 59 insertions(+), 59 deletions(-) rename android.sh => .dotfiles/tag-dev-setup/dev-setup/modules/android.sh (100%) rename aws.sh => .dotfiles/tag-dev-setup/dev-setup/modules/aws.sh (100%) rename core.sh => .dotfiles/tag-dev-setup/dev-setup/modules/core.sh (94%) rename datastores.sh => .dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh (100%) rename osx.sh => .dotfiles/tag-dev-setup/dev-setup/modules/macos.sh (100%) rename osxprep.sh => .dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh (80%) rename pydata.sh => .dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh (100%) rename rcm.sh => .dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh (100%) rename web.sh => .dotfiles/tag-dev-setup/dev-setup/modules/web.sh (100%) create mode 100755 .dotfiles/tag-dev-setup/dev-setup/update.sh delete mode 100755 bootstrap.sh diff --git a/android.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh similarity index 100% rename from android.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/android.sh diff --git a/aws.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh similarity index 100% rename from aws.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/aws.sh diff --git a/core.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/core.sh similarity index 94% rename from core.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/core.sh index c303b2999..7381c0dd1 100755 --- a/core.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/core.sh @@ -16,7 +16,7 @@ echo "" # GNU core utilities (those that come with OS X are outdated). # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. -sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum +ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum # We installed the new shell, now we have to activate it echo "Adding the newly installed shell to the list of allowed shells" diff --git a/datastores.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh similarity index 100% rename from datastores.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh diff --git a/osx.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh similarity index 100% rename from osx.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/macos.sh diff --git a/osxprep.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh similarity index 80% rename from osxprep.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh index 81260563f..0fd6dbaee 100755 --- a/osxprep.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh @@ -8,13 +8,13 @@ fi echo "" echo "------------------------------" -echo "Updating OSX and installing Xcode command line tools" +echo "Updating macOS and installing Xcode command line tools" echo "------------------------------" echo "" # Step 1: Update the OS and Install Xcode Tools echo "------------------------------" -echo "Updating OSX. If this requires a restart, run the script again." +echo "Updating macOS. If this requires a restart, run the script again." # Install all available updates sudo softwareupdate -i -a diff --git a/pydata.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh similarity index 100% rename from pydata.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh diff --git a/rcm.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh similarity index 100% rename from rcm.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh diff --git a/web.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh similarity index 100% rename from web.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/web.sh diff --git a/.dotfiles/tag-dev-setup/dev-setup/update.sh b/.dotfiles/tag-dev-setup/dev-setup/update.sh new file mode 100755 index 000000000..3e7aaafdb --- /dev/null +++ b/.dotfiles/tag-dev-setup/dev-setup/update.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Change this update file in your rc tag directory to your needs +# You should consider adapting the _DOWNLOAD_URI path to your repo +readonly _DOWNLOAD_URI="https://github.com/omares/dev-setup/tarball/master" + +echo "Update via tarball download and extraction" +provision_enabled && curl -#L ${_DOWNLOAD_URI} | tar -xv --strip-components 1 --exclude={README.md,LICENSE} diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 98f119535..000000000 --- a/bootstrap.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -cd "$(dirname "${BASH_SOURCE}")"; - -git pull origin master; - -function doIt() { - ./rcm.sh - - - source ~/.bash_profile; -} - -if [ "$1" == "--force" -o "$1" == "-f" ]; then - doIt; -else - read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; - echo ""; - if [[ $REPLY =~ ^[Yy]$ ]]; then - doIt; - fi; -fi; -unset doIt; diff --git a/dev-setup b/dev-setup index e48b4960f..a35974291 100755 --- a/dev-setup +++ b/dev-setup @@ -4,9 +4,9 @@ # Example taken from http://argbash.readthedocs.io/en/stable/example.html # # ARG_OPTIONAL_BOOLEAN([selfupdate],[],[Update dev-setup],[]) -# ARG_OPTIONAL_BOOLEAN([dryrun],[],[Output only, no changes],[]) -# ARG_OPTIONAL_REPEATED([modules],[m],[Modules to provision]) -# ARG_TYPE_GROUP_SET([modules],[modules],[modules],[android,aws,core,datastores,osx,osxprep,pydata,rcm,web,all]) +# ARG_OPTIONAL_BOOLEAN([provision],[p],[Provision with given modules (default all)],[off]) +# ARG_OPTIONAL_REPEATED([modules],[m],[Modules to provision],[all]) +# ARG_TYPE_GROUP_SET([modules],[modules],[modules],[macosprep,rcm,macos,core,android,aws,datastores,pydata,web,all]) # ARG_HELP([dev-setup installer]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ @@ -27,7 +27,7 @@ die() begins_with_short_option() { local first_option all_short_options - all_short_options='mh' + all_short_options='pmh' first_option="${1:0:1}" test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0 } @@ -36,27 +36,27 @@ begins_with_short_option() # validators modules() { - local _allowed=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web" "all") + local _allowed=("macosprep" "rcm" "macos" "core" "android" "aws" "datastores" "pydata" "web" "all") local _seeking="$1" for element in "${_allowed[@]}" do test "$element" = "$_seeking" && echo "$element" && return 0 done - die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'android', 'aws', 'core', 'datastores', 'osx', 'osxprep', 'pydata', 'rcm', 'web' and 'all'" 4 + die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'macosprep', 'rcm', 'macos', 'core', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'" 4 } # THE DEFAULTS INITIALIZATION - OPTIONALS _arg_selfupdate="off" -_arg_dryrun="off" -_arg_modules=() +_arg_provision="off" +_arg_modules=(all) print_help () { printf '%s\n' "dev-setup installer" - printf 'Usage: %s [--(no-)selfupdate] [--(no-)dryrun] [-m|--modules ] [-h|--help]\n' "$0" + printf 'Usage: %s [--(no-)selfupdate] [-p|--(no-)provision] [-m|--modules ] [-h|--help]\n' "$0" printf '\t%s\n' "--selfupdate,--no-selfupdate: Update dev-setup (off by default)" - printf '\t%s\n' "--dryrun,--no-dryrun: Output only, no changes (off by default)" - printf '\t%s\n' "-m,--modules: Modules to provision (one of 'android', 'aws', 'core', 'datastores', 'osx', 'osxprep', 'pydata', 'rcm', 'web' and 'all'; empty by default)" + printf '\t%s\n' "-p,--provision,--no-provision: Provision with given modules (default all) (off by default)" + printf '\t%s\n' "-m,--modules: Modules to provision (one of 'macosprep', 'rcm', 'macos', 'core', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'; default array: (all) )" printf '\t%s\n' "-h,--help: Prints help" } @@ -70,9 +70,17 @@ parse_commandline () _arg_selfupdate="on" test "${1:0:5}" = "--no-" && _arg_selfupdate="off" ;; - --no-dryrun|--dryrun) - _arg_dryrun="on" - test "${1:0:5}" = "--no-" && _arg_dryrun="off" + -p|--no-provision|--provision) + _arg_provision="on" + test "${1:0:5}" = "--no-" && _arg_provision="off" + ;; + -p*) + _arg_provision="on" + _next="${_key##-p}" + if test -n "$_next" -a "$_next" != "$_key" + then + begins_with_short_option "$_next" && shift && set -- "-p" "-${_next}" "$@" || die "The short option '$_key' can't be decomposed to ${_key:0:2} and -${_key:2}, because ${_key:0:2} doesn't accept value and '-${_key:2:1}' doesn't correspond to a short option." + fi ;; -m|--modules) test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 @@ -109,10 +117,23 @@ parse_commandline "$@" ### END OF CODE GENERATED BY Argbash (sortof) ### ]) # [ <-- needed because of Argbash -should_provision() { - [[ ${_arg_dryrun} == "off" ]] +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [[ -e "${SCRIPT_DIR}/.dotfiles/tag-dev-setup/dev-setup" ]]; then + echo "Development mode" + readonly PREFIX_PATH="${SCRIPT_DIR}/.dotfiles/tag-dev-setup/dev-setup" +else + readonly PREFIX_PATH=".dev-setup" +fi + + +provision_enabled() { + [[ ${_arg_provision} == "on" ]] } +export _arg_provision +export -f provision_enabled + start_sudo() { sudo -v ( while true; do sudo -v; sleep 60; done; ) & @@ -127,8 +148,8 @@ stop_sudo() { } provision_module() { - local module="${1}.sh" - local requires_sudo=("osx" "osxprep") + local -r module="${PREFIX_PATH}/modules/${1}.sh" + local -r requires_sudo=("macos" "macosprep") if [[ ! -e ${module} ]]; then echo "${module} does not seem to exist, skipping." @@ -139,9 +160,9 @@ provision_module() { echo "Running ${module} module" if [[ " ${requires_sudo[@]} " =~ " ${1}" ]]; then - should_provision && echo "( start_sudo && ${module} && stop_sudo )" + provision_enabled && echo "( start_sudo && ${module} && stop_sudo )" else - should_provision && echo "( ${module} )" + provision_enabled && echo "( ${module} )" fi } @@ -150,19 +171,13 @@ provision_module() { cd ~ if [[ ${_arg_selfupdate} == "on" ]]; then - if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) ]]; then - echo "Update via git pull" - should_provision && git pull origin master - else - echo "Update via tarball download and extraction" - should_provision && curl -#L https://github.com/omares/dev-setup/tarball/master | tar -xv --strip-components 1 --exclude={README.md,LICENSE} - fi - - [[ ${#_arg_modules[@]} -eq 0 ]] && exit 0 + ${PREFIX_PATH}/update.sh + + ! provision_enabled && exit 0 fi - if [[ ${#_arg_modules[@]} -eq 0 ]]; then - _PRINT_HELP=yes die "Please provide a module to install" 1 + if ! provision_enabled ; then + _PRINT_HELP=yes die "Please provide the --provision switch to run dev-setup." 1 exit 0 fi @@ -171,7 +186,7 @@ provision_module() { [[ ! $REPLY =~ ^[Yy]$ ]] && exit 0 - [[ " ${_arg_modules[@]} " =~ " all " ]] && _arg_modules=("android" "aws" "core" "datastores" "osx" "osxprep" "pydata" "rcm" "web") + [[ " ${_arg_modules[@]} " =~ " all " ]] && _arg_modules=("macosprep" "rcm" "macos" "core" "android" "aws" "datastores" "pydata" "web") for module in "${_arg_modules[@]}" do @@ -179,7 +194,7 @@ provision_module() { done echo "------------------------------" - echo "Completed running dev-setup, restart your computer to ensure all updates take effect" + echo "Completed running dev-setup, restart your computer to ensure all updates take effect." echo "------------------------------" ) From 5a9966b79953f98eca738cc1b6bd79e240a45fb6 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 4 Apr 2018 10:29:17 +0200 Subject: [PATCH 10/13] Add base module, rename core to essentials, fixate shebang --- .dotfiles/tag-dev-setup/bin/httpcompression | 2 +- .../tag-dev-setup/dev-setup/brew-bundle.sh | 20 +++++------ .../dev-setup/brewfiles/{rcm => base} | 0 .../dev-setup/brewfiles/{core => essentials} | 0 .../dev-setup/modules/android.sh | 2 +- .../tag-dev-setup/dev-setup/modules/aws.sh | 2 +- .../tag-dev-setup/dev-setup/modules/base.sh | 28 +++++++++++++++ .../dev-setup/modules/datastores.sh | 2 +- .../modules/{core.sh => essentials.sh} | 4 +-- .../tag-dev-setup/dev-setup/modules/macos.sh | 2 +- .../modules/{macosprep.sh => macosupdate.sh} | 15 ++++---- .../tag-dev-setup/dev-setup/modules/pydata.sh | 2 +- .../tag-dev-setup/dev-setup/modules/rcm.sh | 11 ------ .../tag-dev-setup/dev-setup/modules/web.sh | 2 +- .dotfiles/tag-dev-setup/dev-setup/update.sh | 2 +- dev-setup | 35 +++++++++++++------ 16 files changed, 80 insertions(+), 49 deletions(-) rename .dotfiles/tag-dev-setup/dev-setup/brewfiles/{rcm => base} (100%) rename .dotfiles/tag-dev-setup/dev-setup/brewfiles/{core => essentials} (100%) create mode 100644 .dotfiles/tag-dev-setup/dev-setup/modules/base.sh rename .dotfiles/tag-dev-setup/dev-setup/modules/{core.sh => essentials.sh} (92%) rename .dotfiles/tag-dev-setup/dev-setup/modules/{macosprep.sh => macosupdate.sh} (63%) delete mode 100755 .dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh diff --git a/.dotfiles/tag-dev-setup/bin/httpcompression b/.dotfiles/tag-dev-setup/bin/httpcompression index 544c2b1f7..b9de205ed 100755 --- a/.dotfiles/tag-dev-setup/bin/httpcompression +++ b/.dotfiles/tag-dev-setup/bin/httpcompression @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # DESCRIPTION: # diff --git a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh index 416363308..166e086cf 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh @@ -1,17 +1,13 @@ -#!/usr/bin/env bash - -# Install command-line tools using Homebrew. - -# 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)" +#!/bin/bash + +if [[ $(command -v brew) == "" ]]; then + echo "Installing homebrew..." + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +else + echo "Updating homebrew..." + brew update fi -# Make sure we’re using the latest Homebrew. -brew update - brew bundle "$@" # Remove outdated versions from the cellar. diff --git a/.dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/base similarity index 100% rename from .dotfiles/tag-dev-setup/dev-setup/brewfiles/rcm rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/base diff --git a/.dotfiles/tag-dev-setup/dev-setup/brewfiles/core b/.dotfiles/tag-dev-setup/dev-setup/brewfiles/essentials similarity index 100% rename from .dotfiles/tag-dev-setup/dev-setup/brewfiles/core rename to .dotfiles/tag-dev-setup/dev-setup/brewfiles/essentials diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh index 543463924..54d5e09af 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash echo "------------------------------" echo "Setting up Android development environment." diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh index 74ae2d76f..f99fb897b 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash echo "------------------------------" echo "Setting up AWS development environment." diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh new file mode 100644 index 000000000..97e53b9e4 --- /dev/null +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [[ $(command -v brew) == "" ]]; then + echo "Installing homebrew..." + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +else + echo "Updating homebrew..." + brew update +fi + + +if [[ $(command -v rcup) == "" ]]; then + + echo "------------------------------" + echo "Installing rcm suite" + + brew bundle install --file=../brewfiles/essentials +fi + +echo "------------------------------" +echo "Updating and/or installing dotfiles" +echo "------------------------------" + +# Update and/or install dotfiles. These dotfiles are stored in the .dotfiles directory. +# rcup is used to install files from the tag-specific dotfiles directory. +# rcup is part of rcm, a management suite for dotfiles +# Check https://github.com/thoughtbot/rcm for more info +env RCRC=".rcrc" rcup diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh index 941117caf..150b837b3 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash echo "------------------------------" echo "Setting up data stores." diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/core.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh similarity index 92% rename from .dotfiles/tag-dev-setup/dev-setup/modules/core.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh index 7381c0dd1..ba1e8a042 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/core.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # Run the core.sh Script # For a full listing of installed formulae and apps, refer to @@ -7,7 +7,7 @@ echo "" echo "------------------------------" -echo "Installing Homebrew along with some common formulae and apps." +echo "Installing core homebrew formulae and apps." echo "This might awhile to complete, as some formulae need to be installed from source." echo "------------------------------" echo "" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh index 59c4c0f3f..befa63366 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash if [[ "${EUID}" -ne 0 ]]; then echo "This module requires sudo rights." diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh similarity index 63% rename from .dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh rename to .dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh index 0fd6dbaee..99a25d9e9 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/macosprep.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash if [[ "${EUID}" -ne 0 ]]; then echo "This module requires sudo rights." @@ -8,7 +8,7 @@ fi echo "" echo "------------------------------" -echo "Updating macOS and installing Xcode command line tools" +echo "Updating macOS and the Xcode command line tools if not present" echo "------------------------------" echo "" @@ -19,7 +19,10 @@ echo "Updating macOS. If this requires a restart, run the script again." # Install all available updates sudo softwareupdate -i -a -echo "------------------------------" -echo "Installing Xcode Command Line Tools." -# Install Xcode command line tools -xcode-select --install +# normally homebrew installs xcode for us +if [[ -z $(xcode-select -p) ]]; then + echo "------------------------------" + echo "Installing Xcode Command Line Tools." + + xcode-select --install +fi diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh index cad5a32dc..c66a76036 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/pydata.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash echo "------------------------------" echo "Setting up Python data development environment." diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh deleted file mode 100755 index 6c2a173d2..000000000 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/rcm.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -echo "------------------------------" -echo "Installing rcm via homebrew to setup all dotfiles." -echo "------------------------------" -echo "" - -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/rcm - -# setup dotfiles -env RCRC=".rcrc" rcup diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh index 19e8745ce..ac7753bc9 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash echo "------------------------------" echo "Setting up JavaScript web development environment." diff --git a/.dotfiles/tag-dev-setup/dev-setup/update.sh b/.dotfiles/tag-dev-setup/dev-setup/update.sh index 3e7aaafdb..7ca355916 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/update.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/update.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # Change this update file in your rc tag directory to your needs # You should consider adapting the _DOWNLOAD_URI path to your repo diff --git a/dev-setup b/dev-setup index a35974291..05f2764d6 100755 --- a/dev-setup +++ b/dev-setup @@ -5,8 +5,8 @@ # # ARG_OPTIONAL_BOOLEAN([selfupdate],[],[Update dev-setup],[]) # ARG_OPTIONAL_BOOLEAN([provision],[p],[Provision with given modules (default all)],[off]) -# ARG_OPTIONAL_REPEATED([modules],[m],[Modules to provision],[all]) -# ARG_TYPE_GROUP_SET([modules],[modules],[modules],[macosprep,rcm,macos,core,android,aws,datastores,pydata,web,all]) +# ARG_OPTIONAL_REPEATED([modules],[m],[Modules to provision, all if none given]) +# ARG_TYPE_GROUP_SET([modules],[modules],[modules],[macosupdate,macos,essentials,android,aws,datastores,pydata,web,all]) # ARG_HELP([dev-setup installer]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ @@ -36,19 +36,19 @@ begins_with_short_option() # validators modules() { - local _allowed=("macosprep" "rcm" "macos" "core" "android" "aws" "datastores" "pydata" "web" "all") + local _allowed=("macosupdate" "macos" "essentials" "android" "aws" "datastores" "pydata" "web" "all") local _seeking="$1" for element in "${_allowed[@]}" do test "$element" = "$_seeking" && echo "$element" && return 0 done - die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'macosprep', 'rcm', 'macos', 'core', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'" 4 + die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'macosupdate', 'macos', 'essentials', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'" 4 } # THE DEFAULTS INITIALIZATION - OPTIONALS _arg_selfupdate="off" _arg_provision="off" -_arg_modules=(all) +_arg_modules=() print_help () { @@ -56,7 +56,7 @@ print_help () printf 'Usage: %s [--(no-)selfupdate] [-p|--(no-)provision] [-m|--modules ] [-h|--help]\n' "$0" printf '\t%s\n' "--selfupdate,--no-selfupdate: Update dev-setup (off by default)" printf '\t%s\n' "-p,--provision,--no-provision: Provision with given modules (default all) (off by default)" - printf '\t%s\n' "-m,--modules: Modules to provision (one of 'macosprep', 'rcm', 'macos', 'core', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'; default array: (all) )" + printf '\t%s\n' "-m,--modules: Modules to provision, all if none given (one of 'macosupdate', 'macos', 'essentials', 'android', 'aws', 'datastores', 'pydata', 'web' and 'all'; empty by default)" printf '\t%s\n' "-h,--help: Prints help" } @@ -149,7 +149,7 @@ stop_sudo() { provision_module() { local -r module="${PREFIX_PATH}/modules/${1}.sh" - local -r requires_sudo=("macos" "macosprep") + local -r requires_sudo=("macos" "macosupdate") if [[ ! -e ${module} ]]; then echo "${module} does not seem to exist, skipping." @@ -185,12 +185,27 @@ provision_module() { echo ""; [[ ! $REPLY =~ ^[Yy]$ ]] && exit 0 + [[ ${#_arg_modules[@]} = 0 || " ${_arg_modules[@]} " =~ " all " ]] && modules=("macosupdate" "macos" "essentials" "android" "aws" "datastores" "pydata" "web") || modules=("${_arg_modules[@]}") - [[ " ${_arg_modules[@]} " =~ " all " ]] && _arg_modules=("macosprep" "rcm" "macos" "core" "android" "aws" "datastores" "pydata" "web") + # 99% of our modules are not usable without homebrew and a proper dotfiles setup so we always run the base module + modules=("base" "${modules[@]}") - for module in "${_arg_modules[@]}" + # check if macosupdate is contained in module list and if so queue it at the beginning + if [[ " ${modules[@]} " =~ " macosupdate " ]]; then + _tmp_modules=() + + for module in "${modules[@]}" + do + [[ ${module} != "macosupdate" ]] && _tmp_modules+=("${module}") + done + + modules=("macosupdate" "${_tmp_modules[@]}") + fi + + # run modules + for module in "${modules[@]}" do - provision_module ${module} + provision_module ${module} done echo "------------------------------" From a70b467b6e4256785eae590f32b45f664288ce24 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 4 Apr 2018 10:43:16 +0200 Subject: [PATCH 11/13] Ditch brew-bundle.sh --- .dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh | 14 -------------- .../tag-dev-setup/dev-setup/modules/android.sh | 4 +++- .dotfiles/tag-dev-setup/dev-setup/modules/aws.sh | 4 +++- .dotfiles/tag-dev-setup/dev-setup/modules/base.sh | 5 ++++- .../tag-dev-setup/dev-setup/modules/datastores.sh | 4 +++- .../tag-dev-setup/dev-setup/modules/essentials.sh | 4 +++- .dotfiles/tag-dev-setup/dev-setup/modules/web.sh | 4 +++- dev-setup | 4 ++-- 8 files changed, 21 insertions(+), 22 deletions(-) delete mode 100755 .dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh mode change 100644 => 100755 .dotfiles/tag-dev-setup/dev-setup/modules/base.sh diff --git a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh b/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh deleted file mode 100755 index 166e086cf..000000000 --- a/.dotfiles/tag-dev-setup/dev-setup/brew-bundle.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [[ $(command -v brew) == "" ]]; then - echo "Installing homebrew..." - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -else - echo "Updating homebrew..." - brew update -fi - -brew bundle "$@" - -# Remove outdated versions from the cellar. -brew cleanup diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh index 54d5e09af..59217a0c7 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/android.sh @@ -1,8 +1,10 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + echo "------------------------------" echo "Setting up Android development environment." echo "------------------------------" echo "" -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/android +brew bundle install --file="${SCRIPT_DIR}/../brewfiles/android" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh index f99fb897b..48f6052d1 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/aws.sh @@ -1,5 +1,7 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + echo "------------------------------" echo "Setting up AWS development environment." echo "------------------------------" @@ -71,7 +73,7 @@ pip install awscli # System-Wide Packages # ############################################################################### -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/aws +brew bundle install --file="${SCRIPT_DIR}/../brewfiles/aws" ############################################################################### # Install IPython Notebook Spark Integration diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh old mode 100644 new mode 100755 index 97e53b9e4..c3d219246 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/base.sh @@ -1,5 +1,7 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + if [[ $(command -v brew) == "" ]]; then echo "Installing homebrew..." /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -14,9 +16,10 @@ if [[ $(command -v rcup) == "" ]]; then echo "------------------------------" echo "Installing rcm suite" - brew bundle install --file=../brewfiles/essentials + brew bundle install --file="${SCRIPT_DIR}/../brewfiles/base" fi + echo "------------------------------" echo "Updating and/or installing dotfiles" echo "------------------------------" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh index 150b837b3..8c8b6f0f2 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/datastores.sh @@ -1,8 +1,10 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + echo "------------------------------" echo "Setting up data stores." echo "------------------------------" echo "" -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/datastores +brew bundle install --file="${SCRIPT_DIR}/../brewfiles/datastores" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh index ba1e8a042..0b318140f 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh @@ -1,5 +1,7 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + # Run the core.sh Script # For a full listing of installed formulae and apps, refer to # the commented core.sh source file directly and tweak it to @@ -12,7 +14,7 @@ echo "This might awhile to complete, as some formulae need to be installed from echo "------------------------------" echo "" -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/core +brew bundle install --file="${SCRIPT_DIR}/../brewfiles/essentials" # GNU core utilities (those that come with OS X are outdated). # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`. diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh index ac7753bc9..e17e7d904 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/web.sh @@ -1,11 +1,13 @@ #!/bin/bash +readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + echo "------------------------------" echo "Setting up JavaScript web development environment." echo "------------------------------" echo "" -./.dev-setup/brew-bundle.sh install --file=.dev-setup/brewfiles/web +brew bundle install --file="${SCRIPT_DIR}/../brewfiles/web" npm install -g coffee-script npm install -g grunt-cli diff --git a/dev-setup b/dev-setup index 05f2764d6..1c4797769 100755 --- a/dev-setup +++ b/dev-setup @@ -160,9 +160,9 @@ provision_module() { echo "Running ${module} module" if [[ " ${requires_sudo[@]} " =~ " ${1}" ]]; then - provision_enabled && echo "( start_sudo && ${module} && stop_sudo )" + provision_enabled && ( start_sudo && ${module} && stop_sudo ) else - provision_enabled && echo "( ${module} )" + provision_enabled && ( ${module} ) fi } From f2c9eb4d53e69a2cbd7441cff292b69a4e2b493e Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 4 Apr 2018 10:49:11 +0200 Subject: [PATCH 12/13] Ditch dash in script name, update readme --- README.md | 113 ++++++++++++++++++++---------------------- dev-setup => devsetup | 0 2 files changed, 55 insertions(+), 58 deletions(-) rename dev-setup => devsetup (100%) diff --git a/README.md b/README.md index 2600915f5..95bb838d1 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ This repo takes a more **light-weight** approach to automation using a combinati * [Single Setup Script](#single-setup-script) * [bootstrap.sh script](#bootstrapsh-script) * Syncs dev-setup to your local home directory `~` -* [osxprep.sh script](#osxprepsh-script) +* [macosupdate.sh script](#macosupdatesh-script) * Updates OS X and installs Xcode command line tools -* [core.sh script](#brewsh-script) +* [essentials.sh script](#brewsh-script) * Installs common Homebrew formulae and apps -* [osx.sh script](#osxsh-script) +* [macos.sh script](#macossh-script) * Sets up OS X defaults geared towards developers * [pydata.sh script](#pydatash-script) * Sets up python for data analysis @@ -157,62 +157,59 @@ This repo takes a more **light-weight** approach to automation using a combinati $ git clone https://github.com/donnemartin/dev-setup.git && cd dev-setup -##### Run the .dots Script with Command Line Arguments +##### Run the devsetup Script with Command Line Arguments -**Since you probably don't want to install every section**, the `.dots` script supports command line arguments to run only specified sections. Simply pass in the [scripts](#scripts) that you want to install. Below are some examples. +**Since you probably don't want to install every section**, the `devsetup` script supports command line arguments to run only specified sections. Simply pass in the [scripts](#scripts) that you want to install. Below are some examples. -**For more customization, you can [clone](#clone-the-repo) or [fork](https://github.com/donnemartin/dev-setup/fork) the repo and tweak the `.dots` script and its associated components to suit your needs.** +**For more customization, you can [clone](#clone-the-repo) or [fork](https://github.com/donnemartin/dev-setup/fork) the repo and tweak the `devsetup` script and its associated components to suit your needs.** Run all: - $ ./.dots all + $ ./devsetup -p -Run `bootstrap.sh`, `osxprep.sh`, `core.sh`, and `osx.sh`: +Run `macosupdate.sh`, `essentials.sh`, and `macos.sh`: - $ ./.dots bootstrap osxprep brew osx + $ ./devsetup -p -m `macosupdate` -m macos -m essentials -Run `bootstrap.sh`, `osxprep.sh`, `core.sh`, and `osx.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: +Run `macosupdate.sh`, `essentials.sh`, and `macos.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: - $ ./.dots bootstrap osxprep brew osx pydata aws datastores + $ ./devsetup -p -m `macosupdate` -m essentials -m macos -m pydata -m aws -m datastores #### Running without Git - $ curl -O https://raw.githubusercontent.com/donnemartin/dev-setup/master/.dots && ./.dots [Add ARGS Here] + $ curl -O https://raw.githubusercontent.com/omares/dev-setup/master/devsetup && ./devsetup [Add ARGS Here] #### Scripts -* [.dots](https://github.com/donnemartin/dev-setup/blob/master/.dots) +* devsetup * Runs specified scripts -* [bootstrap.sh](https://github.com/donnemartin/dev-setup/blob/master/bootstrap.sh) - * Syncs dev-setup to your local home directory `~` -* [osxprep.sh](https://github.com/donnemartin/dev-setup/blob/master/osxprep.sh) +* macosupdate.sh * Updates OS X and installs Xcode command line tools -* [core.sh](https://github.com/donnemartin/dev-setup/blob/master/core.sh) +* essentials.sh * Installs common Homebrew formulae and apps -* [osx.sh](https://github.com/donnemartin/dev-setup/blob/master/osx.sh) +* macos.sh * Sets up OS X defaults geared towards developers -* [pydata.sh](https://github.com/donnemartin/dev-setup/blob/master/pydata.sh) +* pydata.sh * Sets up python for data analysis -* [aws.sh](https://github.com/donnemartin/dev-setup/blob/master/aws.sh) +* aws.sh * Sets up Spark, Hadoop MapReduce, and Amazon Web Services -* [datastores.sh](https://github.com/donnemartin/dev-setup/blob/master/datastores.sh) +* datastores.sh * Sets up common data stores -* [web.sh](https://github.com/donnemartin/dev-setup/blob/master/web.sh) +* web.sh * Sets up JavaScript web development -* [android.sh](https://github.com/donnemartin/dev-setup/blob/master/android.sh) +* android.sh * Sets up Android development **Notes:** -* `.dots` will initially prompt you to enter your password. -* `.dots` might ask you to re-enter your password at certain stages of the installation. -* If OS X updates require a restart, simply run `.dots` again to resume where you left off. +* `devsetup` might ask you to enter your password at certain stages of the installation. +* If OS X updates require a restart, simply run `devsetup` again to resume where you left off. * When installing the Xcode command line tools, a dialog box will confirm installation. * Once Xcode is installed, follow the instructions on the terminal to continue. -* `.dots` runs `core.sh`, which takes awhile to complete as some formulae need to be installed from source. -* **When `.dots` completes, be sure to restart your computer for all updates to take effect.** +* `devsetup` runs `essentials.sh`, which takes awhile to complete as some formulae need to be installed from source. +* **When `devsetup` completes, be sure to restart your computer for all updates to take effect.** -I encourage you to read through Section 1 so you have a better idea of what each installation script does. The following discussions describe in greater detail what is executed when running the [.dots](https://github.com/donnemartin/dev-setup/blob/master/.dots) script. +I encourage you to read through Section 1 so you have a better idea of what each installation script does. The following discussions describe in greater detail what is executed when running the [devsetup](https://github.com/donnemartin/dev-setup/blob/master/devsetup) script. ### bootstrap.sh script @@ -280,18 +277,18 @@ gpip(){ You could also use `~/.extra` to override settings, functions, and aliases from the dev-setup repository, although it’s probably better to [fork the dev-setup repository](https://github.com/donnemartin/dev-setup/fork). -### osxprep.sh script +### macosupdate.sh script


-Run the `osxprep.sh` script: +Run the `macosupdate.sh` script: - $ ./osxprep.sh + $ ./macosupdate.sh -`osxprep.sh` will first install all updates. If a restart is required, simply run the script again. Once all updates are installed, `osxprep.sh` will then [Install Xcode Command Line Tools](#install-xcode-command-line-tools). +`macosupdate.sh` will first install all updates. If a restart is required, simply run the script again. Once all updates are installed, `macosupdate.sh` will then [Install Xcode Command Line Tools](#install-xcode-command-line-tools). If you want to go the manual route, you can also install all updates by running "App Store", selecting the "Updates" icon, then updating both the OS and installed apps. @@ -303,7 +300,7 @@ If you are running **OS X 10.9 Mavericks or later**, then you can install the Xc $ xcode-select --install -**Note**: the `osxprep.sh` script executes this command. +**Note**: the `macosupdate.sh` script executes this command. Running the command above will display a dialog where you can either: * Install Xcode and the command line tools @@ -316,39 +313,39 @@ If you're running 10.8 or older, you'll need to go to [http://developer.apple.co Once you reach the downloads page, search for "command line tools", and download the latest **Command Line Tools (OS X Mountain Lion) for Xcode**. Open the **.dmg** file once it's done downloading, and double-click on the **.mpkg** installer to launch the installation. When it's done, you can unmount the disk in Finder. -### core.sh script +### essentials.sh script


-When setting up a new Mac, you may want to install [Homebrew](http://core.sh/), a package manager that simplifies installing and updating applications or libraries. +When setting up a new Mac, you may want to install [Homebrew](http://essentials.sh/), a package manager that simplifies installing and updating applications or libraries. -Some of the apps installed by the `core.sh` script include: Chrome, Firefox, Sublime Text, Atom, Dropbox, Evernote, Skype, Slack, Alfred, VirtualBox, Vagrant, Docker, etc. **For a full listing of installed formulae and apps, refer to the commented [core.sh source file](https://github.com/donnemartin/dev-setup/blob/master/core.sh) directly and tweak it to suit your needs.** +Some of the apps installed by the `essentials.sh` script include: Chrome, Firefox, Sublime Text, Atom, Dropbox, Evernote, Skype, Slack, Alfred, VirtualBox, Vagrant, Docker, etc. **For a full listing of installed formulae and apps, refer to the commented [essentials.sh source file](https://github.com/donnemartin/dev-setup/blob/master/essentials.sh) directly and tweak it to suit your needs.** -Run the `core.sh` script: +Run the `essentials.sh` script: - $ ./core.sh + $ ./essentials.sh -The `core.sh` script takes awhile to complete, as some formulae need to be installed from source. +The `essentials.sh` script takes awhile to complete, as some formulae need to be installed from source. **For your terminal customization to take full effect, quit and re-start the terminal** -### osx.sh script +### macos.sh script

- +

-When setting up a new Mac, you may want to set OS X defaults geared towards developers. The `osx.sh` script also configures common third-party apps such Sublime Text and Chrome. +When setting up a new Mac, you may want to set OS X defaults geared towards developers. The `macos.sh` script also configures common third-party apps such Sublime Text and Chrome. -**Note**: **I strongly encourage you read through the commented [osx.sh source file](https://github.com/donnemartin/dev-setup/blob/master/osx.sh) and tweak any settings based on your personal preferences. The script defaults are intended for you to customize.** For example, if you are not running an SSD you might want to change some of the settings listed in the SSD section. +**Note**: **I strongly encourage you read through the commented [macos.sh source file](https://github.com/donnemartin/dev-setup/blob/master/macos.sh) and tweak any settings based on your personal preferences. The script defaults are intended for you to customize.** For example, if you are not running an SSD you might want to change some of the settings listed in the SSD section. -Run the `osx.sh` script: +Run the `macos.sh` script: - $ ./osx.sh + $ ./macos.sh **For your terminal customization to take full effect, quit and re-start the terminal.** @@ -444,7 +441,7 @@ With the terminal, the text editor is a developer's most important tool. Everyon #### Installation -The [core.sh script](#brewsh-script) installs Sublime Text. +The [essentials.sh script](#brewsh-script) installs Sublime Text. If you prefer to install it separately, go ahead and [download](http://www.sublimetext.com/) it. Open the **.dmg** file, drag-and-drop in the **Applications** folder. @@ -454,7 +451,7 @@ Sublime Text is not free, but I think it has an unlimited "evaluation period". A #### Configuration -The [osx.sh script](#osxsh-script) contains Sublime Text configurations. +The [macos.sh script](#macossh-script) contains Sublime Text configurations. #### Soda Theme @@ -524,7 +521,7 @@ I set my comments color to `#E6DB74`. #### Installation -The [core.sh script](#brewsh-script) installs Atom. +The [essentials.sh script](#brewsh-script) installs Atom. If you prefer to install it separately, [download](https://atom.io/) it, open the **.dmg** file, drag-and-drop in the **Applications** folder. @@ -543,7 +540,7 @@ Since we spend so much time in the terminal, we should try to make it a more ple #### Configuration -The [bootstrap.sh script](#bootstrapsh-script) and [osx.sh script](#osxsh-script) contain terminal customizations. +The [bootstrap.sh script](#bootstrapsh-script) and [macos.sh script](#macossh-script) contain terminal customizations. ### iTerm2 @@ -602,7 +599,7 @@ VirtualBox creates and manages virtual machines. It's a solid free solution to #### Installation -The [core.sh script](#brewsh-script) installs VirtualBox +The [essentials.sh script](#brewsh-script) installs VirtualBox If you prefer to install it separately, you can download it [here](https://www.virtualbox.org/wiki/Downloads) or run: @@ -620,7 +617,7 @@ Vagrant creates and configures development environments. You can think of it as #### Installation -The [core.sh script](#brewsh-script) installs Vagrant. +The [essentials.sh script](#brewsh-script) installs Vagrant. If you prefer to install it separately, you can download it [here](https://www.vagrantup.com/) or run: @@ -638,7 +635,7 @@ Docker automates the deployment of applications inside software containers. I t #### Installation -The [core.sh script](#brewsh-script) installs Docker. +The [essentials.sh script](#brewsh-script) installs Docker. If you prefer to install it separately, you can download it [here](https://www.docker.com/) or run: @@ -697,7 +694,7 @@ They will get added to your `.gitconfig` file. To push code to your GitHub repositories, we're going to use the recommended HTTPS method (versus SSH). So you don't have to type your username and password everytime, let's enable Git password caching as described [here](https://help.github.com/articles/set-up-git): - $ git config --global credential.helper osxkeychain + $ git config --global credential.helper macoskeychain **Note**: On a Mac, it is important to remember to add `.DS_Store` (a hidden OS X system file that's put in folders) to your `.gitignore` files. You can take a look at this repository's [.gitignore](https://github.com/donnemartin/dev-setup/blob/master/.gitignore) file for inspiration. Also check out GitHub's [collection of .gitignore templates](https://github.com/github/gitignore). @@ -708,11 +705,11 @@ To push code to your GitHub repositories, we're going to use the recommended HTT

-Package managers make it so much easier to install and update applications (for Operating Systems) or libraries (for programming languages). The most popular one for OS X is [Homebrew](http://core.sh/). +Package managers make it so much easier to install and update applications (for Operating Systems) or libraries (for programming languages). The most popular one for OS X is [Homebrew](http://essentials.sh/). #### Installation -The [core.sh script](#brewsh-script) installs Homebrew and a number of useful Homebrew formulae and apps. +The [essentials.sh script](#brewsh-script) installs Homebrew and a number of useful Homebrew formulae and apps. If you prefer to install it separately, run the following command and follow the steps on the screen: @@ -761,7 +758,7 @@ To see what you have installed (with their version numbers): #### Installation -`core.sh` provides [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build) which allow you to manage multiple versions of Ruby on the same machine. `core.sh` adds the following line to your `.extra` file to initialize `rbenv`: +`essentials.sh` provides [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build) which allow you to manage multiple versions of Ruby on the same machine. `essentials.sh` adds the following line to your `.extra` file to initialize `rbenv`: ``` eval "$(rbenv init -)" @@ -809,7 +806,7 @@ OS X, like Linux, ships with [Python](http://python.org/) already installed. But #### Installation -The [core.sh script](#brewsh-script) installs the latest versions of Python 2 and Python 3. +The [essentials.sh script](#brewsh-script) installs the latest versions of Python 2 and Python 3. ### Pip diff --git a/dev-setup b/devsetup similarity index 100% rename from dev-setup rename to devsetup From 0bb4e191fc3231c26ff8e0d7333e7b9515ab1cd1 Mon Sep 17 00:00:00 2001 From: Ota Mares Date: Wed, 4 Apr 2018 22:57:37 +0200 Subject: [PATCH 13/13] Update some outputs --- .../dev-setup/modules/essentials.sh | 3 +-- .../tag-dev-setup/dev-setup/modules/macos.sh | 3 +-- .../dev-setup/modules/macosupdate.sh | 22 ++++++++----------- .dotfiles/tag-dev-setup/dev-setup/update.sh | 13 +++++++---- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh index 0b318140f..a1ecc788a 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/essentials.sh @@ -7,9 +7,8 @@ readonly SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # the commented core.sh source file directly and tweak it to # suit your needs. -echo "" echo "------------------------------" -echo "Installing core homebrew formulae and apps." +echo "Installing essential homebrew formulae and apps." echo "This might awhile to complete, as some formulae need to be installed from source." echo "------------------------------" echo "" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh index befa63366..8f667a6fe 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/macos.sh @@ -13,9 +13,8 @@ fi # customize. For example, if you are not running an SSD you # might want to change some of the settings listed in the # SSD section. -echo "" echo "------------------------------" -echo "Setting sensible OSX defaults." +echo "Setting sensible macos defaults." echo "------------------------------" echo "" diff --git a/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh b/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh index 99a25d9e9..a18180cc2 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/modules/macosupdate.sh @@ -6,23 +6,19 @@ if [[ "${EUID}" -ne 0 ]]; then exit 1 fi -echo "" echo "------------------------------" -echo "Updating macOS and the Xcode command line tools if not present" +echo "Updating macOS. If this requires a restart, run the script again." echo "------------------------------" echo "" -# Step 1: Update the OS and Install Xcode Tools -echo "------------------------------" -echo "Updating macOS. If this requires a restart, run the script again." - # Install all available updates sudo softwareupdate -i -a -# normally homebrew installs xcode for us -if [[ -z $(xcode-select -p) ]]; then - echo "------------------------------" - echo "Installing Xcode Command Line Tools." - - xcode-select --install -fi +# homebrew is installing xcode there this step is not needed +# for convenience i am leaving this here +#if [[ -z $(xcode-select -p) ]]; then +# echo "------------------------------" +# echo "Installing Xcode Command Line Tools." +# +# xcode-select --install +#fi diff --git a/.dotfiles/tag-dev-setup/dev-setup/update.sh b/.dotfiles/tag-dev-setup/dev-setup/update.sh index 7ca355916..533231a5d 100755 --- a/.dotfiles/tag-dev-setup/dev-setup/update.sh +++ b/.dotfiles/tag-dev-setup/dev-setup/update.sh @@ -1,8 +1,13 @@ #!/bin/bash -# Change this update file in your rc tag directory to your needs -# You should consider adapting the _DOWNLOAD_URI path to your repo -readonly _DOWNLOAD_URI="https://github.com/omares/dev-setup/tarball/master" +# Change this update file in your rcm tag directory to your needs +# You should consider adapting the username to point to your repo +readonly username="omares" +readonly version="master" + +readonly download_uri="https://github.com/${username}/dev-setup/tarball/${version}" echo "Update via tarball download and extraction" -provision_enabled && curl -#L ${_DOWNLOAD_URI} | tar -xv --strip-components 1 --exclude={README.md,LICENSE} +provision_enabled && curl -#L ${download_uri} | tar -xv --strip-components 1 --exclude={README.md,LICENSE} + +