Skip to content

Instantly share code, notes, and snippets.

@kalashnikovisme
Last active October 27, 2019 11:52
Show Gist options
  • Save kalashnikovisme/6718913 to your computer and use it in GitHub Desktop.
Save kalashnikovisme/6718913 to your computer and use it in GitHub Desktop.
script for my environment on ubuntu 12.04 LTS and 14.04 (testing) LTS #rails #vim #git #postgresql
sudo apt-get update
# ruby and rails
sudo apt-get install htop graphviz git curl build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libreadline-dev libsqlite3-dev libxslt1-dev libgdbm-dev libncurses5-dev automake libtool bison libffi-dev libsqlite3-0 libmysql-ruby libmysqlclient-dev libs$ --yes
curl -L https://get.rvm.io | bash -s stable --rails
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
notify-send "Ruby on Rails" Installed
git clone https://gist.github.com/6722293.git ~/config_files
mv ~/config_files/.pryrc ~/.pryrc
# git and auth github
sudo apt-get install git-core --yes
ssh-keygen -t rsa -C "[email protected]"
echo /home/{user}/.ssh/id_rsa | ssh-add ~/.ssh/id_rsa
sudo apt-get install xclip --yes
xclip -sel clip < ~/.ssh/id_rsa.pub
notify-send "Git" "Installed. Put ssh key from clipboard to Github"
# copy my config files
mv ~/config_files/.gitconfig ~/.gitconfig
mv ~/config_files/global.gitignore ~/.gitignore
# gitflow
sudo apt-get install git-flow --yes
# press Enter
mv ~/config_files/.bashrc ~/.bashrc
# repo for install vim 7.4
echo | sudo add-apt-repository ppa:fcwu-tw/ppa
sudo apt-get update
sudo apt-get install vim --yes
sudo apt-get install ncurses-term
git clone git://github.com/akitaonrails/vimfiles.git ~/.vim
cd ~/.vim
mv ~/config_files/.vimrc ~/.vimrc
git submodule init
git submodule update
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
sudo apt-get install ctags --yes
vim +BundleInstall +qall
#press Enter
git clone https://github.com/ingydotnet/yaml-vim.git ~/vim_files
mv ~/vim_files/syntax/yaml.vim ~/.vim/syntax/yaml.vim
mkdir ~/.vim/scripts
mv ~/vim_files/yamlsort.vim ~/.vim/scripts/yamlsort.vim
mv ~/vim_files/yamlsort.rb ~/.vim/scripts/yamlsort.rb
rm -rf ~/vim_files
git config --global core.editor "vim"
notify-send "Vim" "Installed & configurated"
# postgresql and config
sudo apt-get install postgresql-9.4 --yes
sudo mv ~/config_files/pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf
sudo service postgresql restart
notify-send "PostgreSQL" "Installed & configurated"
#mysql
echo | echo| echo | sudo apt-get install mysql-server --yes
notify-send "MySQL" "Installed"
# must have libs
sudo apt-get install libpq-dev --yes
sudo apt-get install libmagickwand-dev --yes
sudo apt-get install nodejs --yes
#install dolphin
sudo apt-get install dolphin ark --yes
#install wine
echo | sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine --yes
cp wine_cad.sh ~/wine_cad.sh
chmod +x ~/wine_cad.sh
#install npm
sudo apt-get install npm --yes
npm config set registry http://registry.npmjs.org/
#install boot-repair
if [[ `lsb_release -rs` == "14.04" ]] ; then
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list"
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
else
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)
fi
notify-send "Bootrepair" "Installed. Use it!"
#install Skype
if [[ `lsb_release -rs` == "14.04" ]] ; then
sudo sh -c 'echo "deb http://archive.canonical.com/ quantal partner" >> /etc/apt/sources.list'
sudo apt-get update
fi
sudo apt-get install skype --yes
notify-send "Skype" "Installed"
#install Nvidia Prime if Ubuntu 14.04 and Nvidia video card
echo Do you want to install Nvidia Prime. You need it, if you have OS = Ubuntu 14.04 and Nvidia video card.
echo Install Nvidia Prime? y or n
read WISH
echo
if [ $WISH = "n" ] ; then
echo OK :)
fi
if [ ! $WISH = "y" ] ; then
echo in vaild optin g - exiting
exit
fi
if [ $WISH = "y"] ; then
sudo apt-get install nvidia-331 nvidia-settings nvidia-prime
fi
#install gimp
sudo apt-get install gimp --yes
notify-send "Gimp" "Installed & configurated"
#install elasticsearch
sudo apt-get install openjdk-7-jre-headless -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb
notify-send "ElasticSearch" "Installed & configurated"
#install undistract-me
echo | sudo add-apt-repository ppa:undistract-me-packagers/daily
sudo apt-get update
sudo apt-get install undistract-me -y
#fix brigthness in 12.04
if [[ `lsb_release -rs` == "12.04" ]] ; then
echo sudo vim /etc/default/grub
echo SET GRUB_CMDLINE_LINUX_DEFAULT="guiet splash acpi_backlight=vendor"
notify-send "Brightness" "Fixed"
fi
#Wakatime plugin for gedit
git clone [email protected]:wakatime/gedit-wakatime
wget https://bootstrap.pypa.io/get-pip.py ~/get-pip.py
sudo python ~/get-pip.py
sudo python ~/gedit-wakatime/install.py
#html2haml for vim
gem install html2haml
# edit layout
sudo apt-get install -y gnome-tweak-tool
echo Use tweak tool (Дополнительные параметры)
#!/bin/bash
# Определяем расширение файла
dd=$1; razr=`echo ${dd:(-3)};` ff=`echo ${dd/\'/\'Z:}`; ff=`echo "\"Z:"$ff\"`;
# В зависимости от расширение запускаем нужную программу
case $razr in
frw)
env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ASCON\\KOMPAS-3D Viewer V9\\Bin\\kViewer.Exe" `echo $ff` &
;;
cdw)
env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ASCON\\KOMPAS-3D Viewer V9\\Bin\\kViewer.Exe" `echo $ff` &
;;
dwg)
env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ZWCAD 2009 Eng\\ZWCAD.exe" `echo $ff` &
;;
dxf)
env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ZWCAD 2009 Eng\\ZWCAD.exe" `echo $ff` &
;;
# Тут можно добавить ещё расширений и программ
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment