Skip to content

Instantly share code, notes, and snippets.

@xcooper
Last active April 25, 2016 03:08
Show Gist options
  • Save xcooper/d655a5e46acbd29f465c to your computer and use it in GitHub Desktop.
Save xcooper/d655a5e46acbd29f465c to your computer and use it in GitHub Desktop.
My script to setup environment after Ubuntu installed.
#!/bin/bash
mkdir -p ~/bin
mkdir -p ~/workspace
# startup environment
cat >> ~/.profile <<EOF
export PATH=~/bin:$PATH
export TEMP=${TEMP:-"/tmp"}
EOF
chmod u+x ~/.profile
. ~/.profile
# software
for i in nautilus-dropbox nautilus-open-terminal nautilus-gtkhash nautilus-actions nautilus-pastebin git subversion vim vim-gtk libsvn-java curl openjdk-8-jdk wireshark meld filezilla shutter vlc p7zip-full clipit xclip bleachbit rabbitvcs-nautilus gtk-recordmydesktop fcitx-table-scj6 zsh
do
sudo apt-get install -y $i
done
## install btsync
wget -O- 'http://download-lb.utorrent.com/endpoint/btsync/os/linux-x64/track/stable' | tar zx --directory ~/bin
## install pac
wget -O $TEMP/pac.deb 'http://downloads.sourceforge.net/project/pacmanager/pac-4.0/pac-4.5.5.5-all.deb?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpacmanager%2F&ts=1415778533&use_mirror=jaist'
sudo dpkg --install $TEMP/pac.deb
sudo apt-get install -f
## install atom
wget --no-check-certificate -O $TEMP/atom.deb 'https://atom.io/download/deb'
sudo dpkg --install $TEMP/atom.deb
sudo apt-get install -f
apm install autocomplete-java build build-gradle build-make java-generator java-importer linter linter-javac markdown-writer minimap project-manager terminal-plus
## vundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
cat >> ~/.vimrc <<EOF
set ai
set ts=4
set sw=4
set hlsearch
set shiftwidth=4
set nu
syntax enable
set fencs=utf-8,big5
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/vundle'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'L9'
Plugin 'FuzzyFinder'
Plugin 'AutoComplPop'
Plugin 'snipMate'
Plugin 'neocomplcache-snippets_complete'
call vundle#end()
filetype plugin indent on
EOF
vim +PluginInstall +qall
## additional useful repositories
#sudo add-apt-repository -y ppa:fingerprint/fingerprint-gui
#sudo apt-get update
#sudo apt-get install -y libbsapi policykit-1-fingerprint-gui fingerprint-gui
## install oh-my-zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
### config zsh
grep -E '^plugins=' ~/.zshrc
if [ $? -eq 0 ]
then
sed 's/^plugins=.*/plugins=(cp git svn gradle fasd docker)/' ~/.zshrc
else
echo 'plugins=(cp git svn gradle fasd docker)' >> ~/.zshrc
fi
cat >> ~/.zshrc <<EOF
alias xclip="xclip -selection clipboard"
EOF
chmod u+x ~/.zshrc
source ~/.zshrc
## install fasd
git clone 'https://github.com/clvv/fasd.git' $TEMP/fasd
pushd $TEMP/fasd
sudo make install
popd
echo 'eval "$(fasd --init auto)"' >> ~/.zshrc
# directory symbolic links
if [ -d ~/下載 ]
then
ln -sfT ~/下載 ~/Download
fi
if [ -d ~/公共 ]
then
ln -sfT ~/公共 ~/Public
fi
if [ -d ~/圖片 ]
then
ln -sfT ~/圖片 ~/Picture
fi
if [ -d ~/影片 ]
then
ln -sfT ~/影片 ~/Movie
fi
if [ -d ~/文件 ]
then
ln -sfT ~/文件 ~/Document
fi
if [ -d ~/桌面 ]
then
ln -sfT ~/桌面 ~/Desktop
fi
if [ -d ~/模板 ]
then
ln -sfT ~/模板 ~/Template
fi
if [ -d ~/音樂 ]
then
ln -sfT ~/音樂 ~/Music
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment