Skip to content

Instantly share code, notes, and snippets.

@ralavay
ralavay / sshfs_ubuntu.sh
Last active August 29, 2015 13:56
Install SSHFS in Ubuntu to mount remote folder to local
#!/bin/bash
#
# Install SSHFS to mount remote folder to local folder -> edit code with Sublime for example
# Install sshfs
sudo apt-get install sshfs -y
sudo modprobe fuse
# Get your username
YOUR_USER_NAME=$(whoami)
@ralavay
ralavay / bash_aliases
Created March 29, 2014 16:37
bash_aliases for Ubuntu
# Aliases
# Copy this file to ~/.bash_aliases
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade -y'
alias up='sudo apt-get update && sudo apt-get upgrade -y'
alias dist-upgrade='sudo apt-get dist-upgrade -y'
alias inst='sudo apt-get install'
alias ins='sudo apt-get install --no-install-recommends'
alias remove='sudo apt-get remove --purge'
@ralavay
ralavay / ls.md
Last active August 31, 2015 07:20
ls useful stuff
  1. List only dirs
ls -ld */.
  1. List only files
ls -p | grep -v /
@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*
@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_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_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 / 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 / change_ubuntu_hostname.sh
Created September 24, 2015 02:30
Change Ubuntu hostname
#!/bin/bash
#
# Change hostname for Ubuntu host
OLD_NAME=$(hostname)
echo "- Current hostname is: $OLD_NAME"
read -p "- Please input new hostname: " NEW_NAME
update_ect_hostname() {
sudo hostname $NEW_NAME
@ralavay
ralavay / termux-init.md
Last active August 19, 2018 13:59
termux-init

Thing to install for Termux

pkg update
pkg install -y \
    bash \
    bash-completion \
    git \
    vim \
 openssh \