Skip to content

Instantly share code, notes, and snippets.

@kkamkou
Last active February 20, 2017 09:38
Show Gist options
  • Save kkamkou/8504376 to your computer and use it in GitHub Desktop.
Save kkamkou/8504376 to your computer and use it in GitHub Desktop.
Shell customization on a remote server
#!/bin/sh
#@author Kanstantsin Kamkou <kkamkou@gmail.com>
if [ "`id -u`" = "0" ]; then
echo "Do not run this script as root" 1>&2
exit 1
fi
LIST_PIP='pip pip-tools httpie docker-compose'
LIST_PIP_UI='virtualenvwrapper'
LIST_REQUIRED="scdaemon chrony zsh curl wget git mc python-pip jq rar vim ack-grep htop mytop exuberant-ctags rake \
pwgen s3cmd sysv-rc-conf ruby-dev tree pass"
LIST_UI="google-chrome-stable chromium-codecs-ffmpeg-extra xfonts-terminus ttf-bitstream-vera \
terminator sysv-rc-conf ubuntu-restricted-extras"
ZSH_PLUGINS="git svn npm pip history history-substring-search zsh-syntax-highlighting virtualenv \
virtualenvwrapper z sublime colored-man safe-paste extract ssh-agent docker phing"
echo "Enter the sudo password:"
sudo apt-get install -y $LIST_REQUIRED
sudo pip install --upgrade $LIST_PIP
read -p 'Install UI dependencies? ' inst_ui
if [ "${inst_ui}" = 'y' ]; then
sudo apt-get install -y $LIST_UI
sudo pip install --upgrade $LIST_PIP_UI
fi
# zsh setup
chsh -s `which zsh 2>/dev/null`
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone git://github.com/seebi/dircolors-solarized.git ~/.dircolors-solarized
cp ~/.zshrc ~/.zshrc_old &>/dev/null
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
sed -i "s/plugins=(git)/plugins=(${ZSH_PLUGINS})/g" ~/.zshrc
echo 'export TERM="xterm-256color"' >> ~/.zshrc
echo 'eval `dircolors ~/.dircolors-solarized/dircolors.256dark`' >> ~/.zshrc
# vim setup
curl -Lo- https://bit.ly/janus-bootstrap | bash
git clone https://github.com/bling/vim-airline.git ~/.janus/vim-airline
git clone https://github.com/StanAngeloff/php.vim.git ~/.janus/vim-php-syntax
git clone git://github.com/klen/python-mode.git ~/.janus/python-mode
echo 'export EDITOR=vim' >> ~/.zshrc
# dropbox with personal stuff
read -p 'Install Dropbox? ' inst_dropbox
if [ "${inst_dropbox}" = 'y' ]; then
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
fi
echo "Done..."
@kkamkou
Copy link
Author

kkamkou commented Jan 19, 2014

curl -o ~/env-setup.sh  -s "https://gist.githubusercontent.com/kkamkou/8504376/raw/a69b3772fb7cdfa9752b8a3ac9cfc9f934989625/env-setup.sh" && sh ~/env-setup.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment