-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·38 lines (30 loc) · 1.29 KB
/
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
cd ~
rm -f .screenrc
rm -f .vimrc
rm -f .gitignore_global
rm -f .gitconfig
wget https://raw.githubusercontent.com/iarp/dotfiles/master/.screenrc
wget https://raw.githubusercontent.com/iarp/dotfiles/master/.vimrc
wget https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore -O .gitignore_global
wget https://raw.githubusercontent.com/iarp/dotfiles/master/.gitconfig
wget https://raw.githubusercontent.com/iarp/dotfiles/master/.bashrc -O .tmp_bashrc
# Replace the username in the gitconfig file with the currently logged in user
echo "Set username in gitconfig to $USER"
sed "s/username/$USER/g" .gitconfig -i
# Enable bash colouring by uncommenting force_color_prompt
echo "Enable bash line colour prompt"
sed '/force_color_prompt=yes/s/^# *//' .bashrc -i
# Remove lines from .bashrc that start with the following
echo "Removing HISTSIZE, HISTFILESIZE, HISTCONTROL, PROMPT_COMMAND from .bashrc"
sed '/^HISTSIZE/d' .bashrc -i
sed '/^HISTFILESIZE/d' .bashrc -i
sed '/^HISTCONTROL/d' .bashrc -i
sed '/^PROMPT_COMMAND/d' .bashrc -i
echo "Copying commands from .tmp_bashrc to .bashrc"
cat .tmp_bashrc >> .bashrc
echo "Generating ssh key"
ssh-keygen -t rsa -C "$USER@$HOSTNAME"
curl https://github.com/iarp.keys >> ~/.ssh/authorized_keys
sudo apt update
sudo apt install -y screen git
sudo apt upgrade