Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

initial swing at alternate linux approach

  • Loading branch information...
commit 5bac7f100b5b930a99290d4ffff2d0a061c65e97 1 parent 32da81e
pat brisbin pbrisbin authored
35 build.sh
... ... @@ -0,0 +1,35 @@
  1 +#!/bin/bash
  2 +
  3 +distro="$1"
  4 +target="./linux-$distro"
  5 +
  6 +add_lib() {
  7 + local lib="$1"
  8 +
  9 + cat >> "$target" << EOF
  10 +#
  11 +# Source: lib/${lib}.sh
  12 +#
  13 +###
  14 +
  15 +$(cat "lib/${lib}.sh")
  16 +
  17 +###
  18 +EOF
  19 +}
  20 +
  21 +echo "Generating ${target}..."
  22 +
  23 +cat > $target << EOF
  24 +#!/bin/bash
  25 +#
  26 +# laptop setup script for $distro distributions
  27 +#
  28 +# Generated: $(date)
  29 +#
  30 +###
  31 +EOF
  32 +
  33 +add_lib 'support'
  34 +add_lib "$distro"
  35 +add_lib 'main'
7 lib/arch.sh
... ... @@ -0,0 +1,7 @@
  1 +update_system() {
  2 + pacman -Syu
  3 +}
  4 +
  5 +install_pkg() {
  6 + successfully sudo pacman -S $1
  7 +}
14 lib/debian.sh
... ... @@ -0,0 +1,14 @@
  1 +update_system() {
  2 + if command -v aptitude >/dev/null; then
  3 + fancy_echo "Using aptitude ..."
  4 + else
  5 + fancy_echo "Installing aptitude ..."
  6 + successfully sudo apt-get install -y aptitude
  7 + fi
  8 + successfully sudo aptitude update
  9 + successfully sudo aptitude -y dist-upgrade
  10 +}
  11 +
  12 +install_pkg() {
  13 + successfully sudo aptitude install -y $1
  14 +}
106 lib/main.sh
... ... @@ -0,0 +1,106 @@
  1 +fancy_echo "Updating system packages ..."
  2 + update_system
  3 +
  4 +fancy_echo "Installing zsh ..."
  5 + successfully sudo aptitude install -y zsh
  6 +
  7 +fancy_echo "Changing your shell to zsh ..."
  8 + successfully chsh -s `which zsh`
  9 +
  10 +fancy_echo "Installing curl for transferring data with URL syntax ..."
  11 + install_pkg curl # Comes in Arch base already
  12 +
  13 +fancy_echo "Installing xclip for clipboard integration with your terminal ..."
  14 + install_pkg xclip
  15 +
  16 +fancy_echo "Installing git, for source control management ..."
  17 + install_pkg git
  18 +
  19 +fancy_echo "Installing base ruby build dependencies ..."
  20 + successfully sudo aptitude build-dep -y ruby1.9.3 # Not needed on Arch
  21 +
  22 +fancy_echo "Installing libraries for common gem dependencies ..."
  23 + install_pkg libxslt1-dev libcurl4-openssl-dev libksba8 libksba-dev libqtwebkit-dev # Not all needed on Arch
  24 +
  25 +fancy_echo "Installing Postgres, a good open source relational database ..."
  26 + install_pkg postgresql postgresql-server-dev-all # Arch is just "postgresql"
  27 +
  28 +fancy_echo "Installing Redis, a good key-value database ..."
  29 + install_pkg redis-server # Arch is just "redis"
  30 +
  31 +fancy_echo "Installing The Silver Searcher (better than ack or grep) for searching the contents of files ..."
  32 + # Arch has an AUR package for this
  33 + successfully git clone git://github.com/ggreer/the_silver_searcher.git /tmp/the_silver_searcher
  34 + install_pkg automake pkg-config libpcre3-dev zlib1g-dev
  35 + successfully sh /tmp/the_silver_searcher/build.sh
  36 + successfully cd /tmp/the_silver_searcher
  37 + successfully sh build.sh
  38 + successfully sudo make install
  39 + successfully cd ~
  40 + successfully rm -rf /tmp/the_silver_searcher
  41 +
  42 +fancy_echo "Installing ctags, for indexing files for vim tab completion of methods, classes, variables ..."
  43 + install_pkg exuberant-ctags
  44 +
  45 +fancy_echo "Installing vim ..."
  46 + install_pkg vim-gtk # Arch calls this gvim?
  47 +
  48 +fancy_echo "Installing tmux, for saving project state and switching between projects ..."
  49 + install_pkg tmux # I want screen :(
  50 +
  51 +fancy_echo "Installing ImageMagick, for cropping and re-sizing images ..."
  52 + install_pkg imagemagick
  53 +
  54 +fancy_echo "Installing watch, used to execute a program periodically and show the output ..."
  55 + install_pkg watch
  56 +
  57 +fancy_echo "Installing rbenv for changing Ruby versions ..."
  58 + # Arch has an AUR package for this -- also, I want chruby :(
  59 + successfully git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
  60 +
  61 + if ! grep -qs "rbenv init" ~/.zshrc; then
  62 + successfully echo 'export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
  63 + successfully echo 'eval "$(rbenv init -)"' >> ~/.zshrc
  64 + fi
  65 +
  66 + export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"
  67 + eval "$(rbenv init -)"
  68 +
  69 +fancy_echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
  70 + # Arch has an AUR package for this
  71 + successfully git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
  72 +
  73 +fancy_echo "Installing ruby-build for installing Rubies ..."
  74 + # Arch has an AUR package for this
  75 + successfully git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  76 +
  77 +fancy_echo "Installing Ruby 1.9.3-p392 ..."
  78 + successfully rbenv install 1.9.3-p392
  79 +
  80 +fancy_echo "Setting Ruby 1.9.3-p392 as global default Ruby ..."
  81 + successfully rbenv global 1.9.3-p392
  82 + successfully rbenv shell 1.9.3-p392
  83 +
  84 +fancy_echo "Update to latest Rubygems version ..."
  85 + successfully gem update --system
  86 +
  87 +fancy_echo "Installing critical Ruby gems for Rails development ..."
  88 + successfully gem install bundler foreman pg rails thin --no-document
  89 +
  90 +fancy_echo "Installing GitHub CLI client ..."
  91 + successfully gem install hub --no-document
  92 +
  93 +fancy_echo "Installing Heroku CLI client ..."
  94 + # Arch has an AUR package for this
  95 + successfully wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
  96 +
  97 +fancy_echo "Installing the heroku-config plugin for pulling config variables locally to be used as ENV variables ..."
  98 + successfully heroku plugins:install git://github.com/ddollar/heroku-config.git
  99 +
  100 +if ! grep -qs "DO NOT EDIT BELOW THIS LINE" ~/.zshrc; then
  101 + fancy_echo "Prepare ~/.zshrc for http://github.com/thoughtbot/dotfiles ..."
  102 + successfully echo "# DO NOT EDIT BELOW THIS LINE\n" >> ~/.zshrc
  103 +fi
  104 +
  105 +fancy_echo "Your shell will now restart to apply changes."
  106 + exec `which zsh` -l
10 lib/support.sh
... ... @@ -0,0 +1,10 @@
  1 +CLEAR="\033[0m"
  2 +ORANGE="\033[33m"
  3 +
  4 +successfully() {
  5 + $* || { echo "failed" >&2; exit 1 }
  6 +}
  7 +
  8 +fancy_echo() {
  9 + echo -e "${ORANGE}$*${CLEAR}\n"
  10 +}
151 linux-arch
... ... @@ -0,0 +1,151 @@
  1 +#!/bin/bash
  2 +#
  3 +# laptop setup script for arch distributions
  4 +#
  5 +# Generated: Fri Apr 19 10:33:30 EDT 2013
  6 +#
  7 +###
  8 +#
  9 +# Source: lib/support.sh
  10 +#
  11 +###
  12 +
  13 +CLEAR="\033[0m"
  14 +ORANGE="\033[33m"
  15 +
  16 +successfully() {
  17 + $* || { echo "failed" >&2; exit 1 }
  18 +}
  19 +
  20 +fancy_echo() {
  21 + echo -e "${ORANGE}$*${CLEAR}\n"
  22 +}
  23 +
  24 +###
  25 +#
  26 +# Source: lib/arch.sh
  27 +#
  28 +###
  29 +
  30 +update_system() {
  31 + pacman -Syu
  32 +}
  33 +
  34 +install_pkg() {
  35 + successfully sudo pacman -S $1
  36 +}
  37 +
  38 +###
  39 +#
  40 +# Source: lib/main.sh
  41 +#
  42 +###
  43 +
  44 +fancy_echo "Updating system packages ..."
  45 + update_system
  46 +
  47 +fancy_echo "Installing zsh ..."
  48 + successfully sudo aptitude install -y zsh
  49 +
  50 +fancy_echo "Changing your shell to zsh ..."
  51 + successfully chsh -s `which zsh`
  52 +
  53 +fancy_echo "Installing curl for transferring data with URL syntax ..."
  54 + install_pkg curl # Comes in Arch base already
  55 +
  56 +fancy_echo "Installing xclip for clipboard integration with your terminal ..."
  57 + install_pkg xclip
  58 +
  59 +fancy_echo "Installing git, for source control management ..."
  60 + install_pkg git
  61 +
  62 +fancy_echo "Installing base ruby build dependencies ..."
  63 + successfully sudo aptitude build-dep -y ruby1.9.3 # Not needed on Arch
  64 +
  65 +fancy_echo "Installing libraries for common gem dependencies ..."
  66 + install_pkg libxslt1-dev libcurl4-openssl-dev libksba8 libksba-dev libqtwebkit-dev # Not all needed on Arch
  67 +
  68 +fancy_echo "Installing Postgres, a good open source relational database ..."
  69 + install_pkg postgresql postgresql-server-dev-all # Arch is just "postgresql"
  70 +
  71 +fancy_echo "Installing Redis, a good key-value database ..."
  72 + install_pkg redis-server # Arch is just "redis"
  73 +
  74 +fancy_echo "Installing The Silver Searcher (better than ack or grep) for searching the contents of files ..."
  75 + # Arch has an AUR package for this
  76 + successfully git clone git://github.com/ggreer/the_silver_searcher.git /tmp/the_silver_searcher
  77 + install_pkg automake pkg-config libpcre3-dev zlib1g-dev
  78 + successfully sh /tmp/the_silver_searcher/build.sh
  79 + successfully cd /tmp/the_silver_searcher
  80 + successfully sh build.sh
  81 + successfully sudo make install
  82 + successfully cd ~
  83 + successfully rm -rf /tmp/the_silver_searcher
  84 +
  85 +fancy_echo "Installing ctags, for indexing files for vim tab completion of methods, classes, variables ..."
  86 + install_pkg exuberant-ctags
  87 +
  88 +fancy_echo "Installing vim ..."
  89 + install_pkg vim-gtk # Arch calls this gvim?
  90 +
  91 +fancy_echo "Installing tmux, for saving project state and switching between projects ..."
  92 + install_pkg tmux # I want screen :(
  93 +
  94 +fancy_echo "Installing ImageMagick, for cropping and re-sizing images ..."
  95 + install_pkg imagemagick
  96 +
  97 +fancy_echo "Installing watch, used to execute a program periodically and show the output ..."
  98 + install_pkg watch
  99 +
  100 +fancy_echo "Installing rbenv for changing Ruby versions ..."
  101 + # Arch has an AUR package for this -- also, I want chruby :(
  102 + successfully git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
  103 +
  104 + if ! grep -qs "rbenv init" ~/.zshrc; then
  105 + successfully echo 'export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
  106 + successfully echo 'eval "$(rbenv init -)"' >> ~/.zshrc
  107 + fi
  108 +
  109 + export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"
  110 + eval "$(rbenv init -)"
  111 +
  112 +fancy_echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
  113 + # Arch has an AUR package for this
  114 + successfully git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
  115 +
  116 +fancy_echo "Installing ruby-build for installing Rubies ..."
  117 + # Arch has an AUR package for this
  118 + successfully git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  119 +
  120 +fancy_echo "Installing Ruby 1.9.3-p392 ..."
  121 + successfully rbenv install 1.9.3-p392
  122 +
  123 +fancy_echo "Setting Ruby 1.9.3-p392 as global default Ruby ..."
  124 + successfully rbenv global 1.9.3-p392
  125 + successfully rbenv shell 1.9.3-p392
  126 +
  127 +fancy_echo "Update to latest Rubygems version ..."
  128 + successfully gem update --system
  129 +
  130 +fancy_echo "Installing critical Ruby gems for Rails development ..."
  131 + successfully gem install bundler foreman pg rails thin --no-document
  132 +
  133 +fancy_echo "Installing GitHub CLI client ..."
  134 + successfully gem install hub --no-document
  135 +
  136 +fancy_echo "Installing Heroku CLI client ..."
  137 + # Arch has an AUR package for this
  138 + successfully wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
  139 +
  140 +fancy_echo "Installing the heroku-config plugin for pulling config variables locally to be used as ENV variables ..."
  141 + successfully heroku plugins:install git://github.com/ddollar/heroku-config.git
  142 +
  143 +if ! grep -qs "DO NOT EDIT BELOW THIS LINE" ~/.zshrc; then
  144 + fancy_echo "Prepare ~/.zshrc for http://github.com/thoughtbot/dotfiles ..."
  145 + successfully echo "# DO NOT EDIT BELOW THIS LINE\n" >> ~/.zshrc
  146 +fi
  147 +
  148 +fancy_echo "Your shell will now restart to apply changes."
  149 + exec `which zsh` -l
  150 +
  151 +###
158 linux-debian
... ... @@ -0,0 +1,158 @@
  1 +#!/bin/bash
  2 +#
  3 +# laptop setup script for debian distributions
  4 +#
  5 +# Generated: Fri Apr 19 10:34:06 EDT 2013
  6 +#
  7 +###
  8 +#
  9 +# Source: lib/support.sh
  10 +#
  11 +###
  12 +
  13 +CLEAR="\033[0m"
  14 +ORANGE="\033[33m"
  15 +
  16 +successfully() {
  17 + $* || { echo "failed" >&2; exit 1 }
  18 +}
  19 +
  20 +fancy_echo() {
  21 + echo -e "${ORANGE}$*${CLEAR}\n"
  22 +}
  23 +
  24 +###
  25 +#
  26 +# Source: lib/debian.sh
  27 +#
  28 +###
  29 +
  30 +update_system() {
  31 + if command -v aptitude >/dev/null; then
  32 + fancy_echo "Using aptitude ..."
  33 + else
  34 + fancy_echo "Installing aptitude ..."
  35 + successfully sudo apt-get install -y aptitude
  36 + fi
  37 + successfully sudo aptitude update
  38 + successfully sudo aptitude -y dist-upgrade
  39 +}
  40 +
  41 +install_pkg() {
  42 + successfully sudo aptitude install -y $1
  43 +}
  44 +
  45 +###
  46 +#
  47 +# Source: lib/main.sh
  48 +#
  49 +###
  50 +
  51 +fancy_echo "Updating system packages ..."
  52 + update_system
  53 +
  54 +fancy_echo "Installing zsh ..."
  55 + successfully sudo aptitude install -y zsh
  56 +
  57 +fancy_echo "Changing your shell to zsh ..."
  58 + successfully chsh -s `which zsh`
  59 +
  60 +fancy_echo "Installing curl for transferring data with URL syntax ..."
  61 + install_pkg curl # Comes in Arch base already
  62 +
  63 +fancy_echo "Installing xclip for clipboard integration with your terminal ..."
  64 + install_pkg xclip
  65 +
  66 +fancy_echo "Installing git, for source control management ..."
  67 + install_pkg git
  68 +
  69 +fancy_echo "Installing base ruby build dependencies ..."
  70 + successfully sudo aptitude build-dep -y ruby1.9.3 # Not needed on Arch
  71 +
  72 +fancy_echo "Installing libraries for common gem dependencies ..."
  73 + install_pkg libxslt1-dev libcurl4-openssl-dev libksba8 libksba-dev libqtwebkit-dev # Not all needed on Arch
  74 +
  75 +fancy_echo "Installing Postgres, a good open source relational database ..."
  76 + install_pkg postgresql postgresql-server-dev-all # Arch is just "postgresql"
  77 +
  78 +fancy_echo "Installing Redis, a good key-value database ..."
  79 + install_pkg redis-server # Arch is just "redis"
  80 +
  81 +fancy_echo "Installing The Silver Searcher (better than ack or grep) for searching the contents of files ..."
  82 + # Arch has an AUR package for this
  83 + successfully git clone git://github.com/ggreer/the_silver_searcher.git /tmp/the_silver_searcher
  84 + install_pkg automake pkg-config libpcre3-dev zlib1g-dev
  85 + successfully sh /tmp/the_silver_searcher/build.sh
  86 + successfully cd /tmp/the_silver_searcher
  87 + successfully sh build.sh
  88 + successfully sudo make install
  89 + successfully cd ~
  90 + successfully rm -rf /tmp/the_silver_searcher
  91 +
  92 +fancy_echo "Installing ctags, for indexing files for vim tab completion of methods, classes, variables ..."
  93 + install_pkg exuberant-ctags
  94 +
  95 +fancy_echo "Installing vim ..."
  96 + install_pkg vim-gtk # Arch calls this gvim?
  97 +
  98 +fancy_echo "Installing tmux, for saving project state and switching between projects ..."
  99 + install_pkg tmux # I want screen :(
  100 +
  101 +fancy_echo "Installing ImageMagick, for cropping and re-sizing images ..."
  102 + install_pkg imagemagick
  103 +
  104 +fancy_echo "Installing watch, used to execute a program periodically and show the output ..."
  105 + install_pkg watch
  106 +
  107 +fancy_echo "Installing rbenv for changing Ruby versions ..."
  108 + # Arch has an AUR package for this -- also, I want chruby :(
  109 + successfully git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
  110 +
  111 + if ! grep -qs "rbenv init" ~/.zshrc; then
  112 + successfully echo 'export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
  113 + successfully echo 'eval "$(rbenv init -)"' >> ~/.zshrc
  114 + fi
  115 +
  116 + export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"
  117 + eval "$(rbenv init -)"
  118 +
  119 +fancy_echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
  120 + # Arch has an AUR package for this
  121 + successfully git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
  122 +
  123 +fancy_echo "Installing ruby-build for installing Rubies ..."
  124 + # Arch has an AUR package for this
  125 + successfully git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  126 +
  127 +fancy_echo "Installing Ruby 1.9.3-p392 ..."
  128 + successfully rbenv install 1.9.3-p392
  129 +
  130 +fancy_echo "Setting Ruby 1.9.3-p392 as global default Ruby ..."
  131 + successfully rbenv global 1.9.3-p392
  132 + successfully rbenv shell 1.9.3-p392
  133 +
  134 +fancy_echo "Update to latest Rubygems version ..."
  135 + successfully gem update --system
  136 +
  137 +fancy_echo "Installing critical Ruby gems for Rails development ..."
  138 + successfully gem install bundler foreman pg rails thin --no-document
  139 +
  140 +fancy_echo "Installing GitHub CLI client ..."
  141 + successfully gem install hub --no-document
  142 +
  143 +fancy_echo "Installing Heroku CLI client ..."
  144 + # Arch has an AUR package for this
  145 + successfully wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
  146 +
  147 +fancy_echo "Installing the heroku-config plugin for pulling config variables locally to be used as ENV variables ..."
  148 + successfully heroku plugins:install git://github.com/ddollar/heroku-config.git
  149 +
  150 +if ! grep -qs "DO NOT EDIT BELOW THIS LINE" ~/.zshrc; then
  151 + fancy_echo "Prepare ~/.zshrc for http://github.com/thoughtbot/dotfiles ..."
  152 + successfully echo "# DO NOT EDIT BELOW THIS LINE\n" >> ~/.zshrc
  153 +fi
  154 +
  155 +fancy_echo "Your shell will now restart to apply changes."
  156 + exec `which zsh` -l
  157 +
  158 +###

2 comments on commit 5bac7f1

Daniel Collis-Puro
Collaborator
djcp commented on 5bac7f1

Relevant to my question about arch and lsb_release: http://www.linuxquestions.org/questions/arch-29/lsb_release-r-output-on-arch-linux-4175457199/ - apparently "/etc/os-release" is the new hotness. This exists on arch, wheezy, precise, and quantal.

pat brisbin
Collaborator

Yes, I checked the other day, lsb-release is not installed on my system (as basically nothing is by default on Arch, and I had no reason to add it). I have indeed always used /etc/os-release for that sort of thing.

Please sign in to comment.
Something went wrong with that request. Please try again.