Created
October 7, 2020 15:13
-
-
Save taylor/930e6874ddbab73e569a1d7dc45c974f to your computer and use it in GitHub Desktop.
my old ubuntu dev setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# vim: ft=sh | |
RUBY=no | |
POSTGRES=no | |
REDIS=no | |
MEMCACHED=no | |
TAYLOR_VIM=yes | |
TAYLOR_TMUX=yes | |
# TODO: add git config | |
#TAYLOR_GITCONFIG=yes | |
if [[ "$USER" = "root" ]] ; then | |
useradd -m -s /bin/bash pair | |
usermod -a -G sudo pair | |
sed -i 's/ALL$/NOPASSWD: ALL/' /etc/sudoers | |
cp -va $0 ~pair/ | |
# NOTE: This expects root to be setup with .ssh already | |
cp -va /root/.ssh ~pair/ | |
chown -R pair:pair ~pair/.ssh | |
chmod 700 ~pair/.ssh | |
else | |
sudo apt-get remove nano | |
sudo apt-get -y install software-properties-common python-software-properties | |
sudo add-apt-repository -y ppa:nviennot/tmate | |
sudo add-apt-repository -y ppa:pi-rho/dev # tmux 1.8+ | |
sudo add-apt-repository -y ppa:keithw/mosh | |
sudo add-apt-repository -y ppa:cassou/emacs | |
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list" | |
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
## build packages | |
sudo apt-get install -y build-essential checkinstall automake pkg-config \ | |
libssl-dev libncurses5-dev zlib1g-dev liblzma libpcre3 \ | |
libpcre3-dev liblzma-dev libreadline-dev libyaml-dev \ | |
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev \ | |
libcurl4-openssl-dev cmake python-dev | |
## tools | |
sudo apt-get install -y vim unzip git git-core curl ctags pwgen tmate tmux mosh emacs24 emacs24-el emacs24-common-non-dfsg | |
## more emacs | |
curl -L http://git.io/epre | sh | |
## NOTE: For Ubuntu 12.04 we need to build form source brecause the PPA is broken | |
## sudo add-apt-repository -y ppa:ggreer/ag | |
if [[ "$UBUNTU_12_04" = "true" ]] ; then | |
git clone | |
cd the_silver_searcher | |
PREFIX=/usr/local ./build.sh | |
sudo make install | |
else | |
sudo apt-get install -y the-silver-searcher | |
fi | |
## rvm | |
\curl -sSL https://get.rvm.io | bash -s stable | |
if [[ "$RUBY" = "yes" ]] ; then | |
rvm install 1.9.3 && rvm install ruby | |
fi | |
## Postgres 9.3 | |
if [[ "$POSTGRES" = "yes" ]] ; then | |
sudo apt-get install -y postgresql-common postgresql-9.3 libpq-dev | |
sudo -u postgres createuser pair -s | |
fi | |
## Memcached | |
if [[ "$MEMCACHED" = "yes" ]] ; then | |
sudo apt-get install -y memcached | |
fi | |
## Node.js | |
sudo apt-get install -y nodejs-dev nodejs | |
## Redis | |
if [[ "$REDIS" = "yes" ]] ; then | |
sudo apt-get install -y redis-server redis-tools | |
fi | |
if [[ "$TAYLOR_VIM" = "yes" ]] ; then | |
mkdir -p ~/.vim/backup | |
wget -O ~/.vim/vimrc https://raw.githubusercontent.com/taylor/vimconfig/master/vimrc | |
ln -s ~/.vim/vimrc ~/.vimrc | |
vim -c :quit | |
fi | |
if [[ "$TAYLOR_TMUX" = "yes" ]] ; then | |
wget -O ~/.tmux.conf https://raw.githubusercontent.com/taylor/dotfiles/master/.tmux.conf | |
wget -O ~/.tmate.conf https://raw.githubusercontent.com/taylor/dotfiles/master/.tmate.conf | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment