Skip to content

Instantly share code, notes, and snippets.

@ralavay
ralavay / less_syntax_highlight.sh
Last active December 24, 2015 23:09
Enable syntax highlight via LESS comand
#!/bin/bash
#
# Enable syntax highlight mode in LESS command by using source-highlight
# http://www.gnu.org/software/src-highlite/
sudo apt-get install source-highlight -y
cat >> ~/.bashrc <<EOF
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=" -R"
@ralavay
ralavay / install_rvm_ruby_ror_in_cent_ubuntu.sh
Last active December 24, 2015 15:49
Install RVM then using it to install Ruby, RoR in CentOS 6.4 and Ubuntu 12.04
#!/bin/bash
#
# This script will install RVM then use it to install RUBY, RAILS.
# Thanks for DigitalOcean awesome guides at:
# https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-centos-6-with-rvm
# https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
# Detect which distro
DISTRO=`cat /etc/issue`
@ralavay
ralavay / install_stardict_ubuntu.sh
Last active December 24, 2015 13:28
Install Stardict in Ubuntu
#!/bin/bash
#
# Installs stardict in Ubuntu 12.04 and enables its systray icon
echo "
This script will add 'ppa:ubuntu-vn/ppa' repo to your update list
then install 'stardict' and 'english<->vietnamese' 'japanese<->vietnamese' dicts
"
sleep 1.5
@ralavay
ralavay / install_virtualbox_ubuntu_1204.sh
Last active December 24, 2015 10:59
Install Virtualbox 4.2 in Ubuntu 12.04
#!/bin/bash
# The default version of VBox in Ubuntu partner repo is 4.1
# We need to add new repo to install newest version 4.2.x
# Add virtualbox repo
sudo apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" -y
# Add Oracle public key
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
@ralavay
ralavay / install_kingsoft_office_ubuntu_1204.sh
Last active December 24, 2015 08:59
Install Kingsoft office in Ubuntu 12.04 x86_64
# If you are using Ubuntu 32 bit just go straight you don't have to install ia32-libs
# and if you have any troubles with dependencies. I suggest you change your Ubuntu update server to the main server.
sudo apt-get install ia32-libs
# Download the newest version of Kingsoft office here: http://wps-community.org/download.html
# There are deb, rpm and source code too
wget http://wdl.cache.ijinshan.com/wps/download/Linux/unstable/kingsoft-office_9.1.0.4184~a12p1_i386.deb
# Install using dpkg
sudo dpkg -i kingsoft*