Last active
May 2, 2017 17:22
-
-
Save koirand/caa98e08bbf8eb9ff625a5948d7223de to your computer and use it in GitHub Desktop.
BunsenLabs first setting
This file contains 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 -e | |
askYesOrNo() { | |
while true ; do | |
read -p "$1 (y/n)?" answer | |
case $answer in | |
[yY] | [yY]es | YES ) | |
return 0;; | |
[nN] | [nN]o | NO ) | |
return 1;; | |
* ) echo "Please answer yes or no.";; | |
esac | |
done | |
} | |
#install packages. | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install build-essential module-assistant linux-headers-$(uname –r) | |
sudo apt-get install ssh wget curl zip unzip fcitx fcitx-mozc vim-gtk git sl chromium | |
sudo m-a prepare | |
sudo apt-get autoremove | |
#bash | |
cp ~/.bashrc ~/.bashrc.`date +%Y%m%d` | |
sed -i -e 's/#force_color_prompt/force_color_prompt/' ~/.bashrc | |
echo "alias ll='ls -la'" >> ~/.bashrc | |
#ssh config | |
mkdir ~/.ssh | |
echo 'ServerAliveInterval 60' > ~/.ssh/config | |
#set vim to default text editor. | |
sudo update-alternatives --set bl-text-editor /usr/bin/bl-gvim | |
sudo update-alternatives --config x-www-browser | |
#openbox autostart config | |
cp ~/.config/openbox/{autostart,autostart.`date +%Y%m%d`} | |
echo "fcitx &" >> ~/.config/openbox/autostart | |
#tint config | |
cp ~/.config/tint2/{tint2rc,tint2rc.`date +%Y%m%d`} | |
cp ~/.config/tint2/{tint2rc-bottom,tint2rc} | |
### only when is using virtual box ######################################### | |
askYesOrNo "Do you install VirtualBox Guest Additions? [Y/n]" | |
if [ $? -eq 0 ]; then | |
#install VirtualBox guest additions. | |
read -p "Insert VirtualBox Guest Additions CD image and press any key." | |
sudo mount -t iso9660 /dev/cdrom /media/cdrom0 | |
sudo sh /media/cdrom0/VBoxLinuxAdditions.run | |
sudo sed -i -e "s/vboxsf:x:999:/vboxsf:x:999:$USER/" /etc/group | |
#setup VirtualBox share folder | |
read -p "Setup VirtualBox share folder and press any key." | |
#make symbolic link(will be enable after set VirtualBox shre folder) | |
rmdir ~/.fonts | |
ln -s /media/sf_OneDrive/home/.vim ~/.vim | |
ln -s /media/sf_OneDrive/home/.vimrc ~/.vimrc | |
ln -s /media/sf_OneDrive/home/.gvimrc ~/.gvimrc | |
ln -s /media/sf_OneDrive/home/.fonts ~/.fonts | |
ln -s /media/sf_OneDrive/home/.gitconfig ~/.gitconfig | |
fi | |
############################################################################ | |
echo "Finish!!" | |
echo "System will bee rebooted after 10 seconds." | |
sleep 10 | |
sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment