-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux-setup.sh
executable file
·87 lines (65 loc) · 2.04 KB
/
linux-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
# By Patrick Wyatt 8/10/2011
# to execute:
# sudo apt-get install -qq -y curl
# bash < <(curl -s https://raw.github.com/webcoyote/linux-setup/master/linux-setup.sh)
# Make sure this script is not run with sudo
if [ $(id -u) -eq 0 ]
then
echo 'ERROR: This script should not be run as sudo or root.'
exit
fi
# Generate SSH key if it doesn't exist
if [ ! -r "$HOME/.ssh/id_rsa" ]
then
ssh-keygen -N '' -t rsa -f ~/.ssh/id_rsa
# Ubuntu workaround to fix these problems:
# github Permission denied (publickey).
# Agent admitted failure to sign using the key.
ssh-add ~/.ssh/id_rsa
fi
# Update and upgrade
sudo apt-get update -y
# sudo apt-get upgrade -y # do not upgrade ubuntu to 11.10; unity blows
# Install useful stuff
sudo apt-get install -y git-core # git
sudo apt-get install -y meld # meld diff tool
sudo apt-get install -y zsh # z shell
sudo apt-get install -y devilspie # window organizer
sudo apt-get install -y sqlitebrowser # sqlite database browser GUI
sudo apt-get install -y tree # tree command
# Add/update firefox
sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get install firefox-locale-en
# get linux setup
if [ ! -d "$HOME/dev/linux-setup" ]
then
mkdir -p ~/dev
git clone git://github.com/webcoyote/linux-setup.git ~/dev/linux-setup
fi
# link home directory - includes .gemrc .rvmrc .zshrc bin/* .devilspie/*
function link_homedir_files () {
for file in $1/*; do
if [[ -d $file ]]; then
mkdir -p $2/`basename $file`
link_homedir_files $file $2/`basename $file`
else
ln -f $file $2/`basename $file`
fi
done
}
shopt -s dotglob
link_homedir_files ~/dev/linux-setup/home ~
shopt -u dotglob
# Install sublime text 2
sudo ~/bin/sublime-update.sh 2126
# Use zsh
if [ ! -d "$HOME/.oh-my-zsh" ]
then
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
chsh -s `which zsh`
fi
# Install rvm + ruby
~/bin/install-rvm-ruby.sh
echo "System setup complete"
echo 'You might need to run "chsh -s `which zsh`"'