Skip to content

Instantly share code, notes, and snippets.

View baoshan's full-sized avatar

Baoshan Sheng baoshan

  • International Classical Music Database
  • Beijing, China
View GitHub Profile
@baoshan
baoshan / gist:3f2d7f0d74143b894519
Last active August 29, 2015 14:00
node.js on ubuntu
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
npm install -g coffee-script
@baoshan
baoshan / gist:2987337
Created June 25, 2012 08:18
For Jin Si
sudo apt-get update
sudo apt-get -y install vim curl git build-essential
# sudo dpkg --configure -a --force-all
# sudo apt-get clean
# sudo apt-get update
# Depolyment Server Only
# ssh-keygen -t rsa -C "[email protected]"
# cat ~/.ssh/id_rsa.pub
@baoshan
baoshan / gist:2731227
Created May 19, 2012 15:26
Route Port 3000 to 80 for Node.js Deployment
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000
@baoshan
baoshan / gist:2488357
Created April 25, 2012 09:02
Install Python 2.7 on CentOS
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar zxvf Python-2.7.3.tgz
cd Python-2.7.3
./configure
make
make altinstall
@baoshan
baoshan / gist:2487637
Created April 25, 2012 07:09
Install Ruby on CentOS
yum install -y gcc
yum install -y git
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source /etc/profile.d/rvm.sh
yum install -y python-devel
rvm pkg install zlib
rvm install 1.9.3
gem install bundler
yum install -y libicu-devel
git clone git://github.com/baoshan/linguist_http.git
@baoshan
baoshan / etc_sysconfig_iptables
Created April 25, 2012 06:35
Config CentOS Firewall for IP Range Pass Through
-A INPUT -m state --state NEW -m tcp -p tcp -s 50.56.227.0/0 --dport 8080 -j ACCEPT
@baoshan
baoshan / install-pypy.sh
Created April 24, 2012 11:23
Install PyPy on CentOS
# yum list \*openssl\*
yum install -y openssl098e
yum install -y zlib
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8
ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2
tar -xf pypy-1.8-linux64.tar.bz2
cp -r pypy-1.8 /opt
ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin
@baoshan
baoshan / install-redis.sh
Created April 24, 2012 07:25
Install and Configure Redis on CentOS
# Suppose the system is up-to-dated, otherwise:
# sudo yum update -y
yum install -y gcc
version=2.4.11
wget http://redis.googlecode.com/files/redis-$version.tar.gz
tar -xf redis-$version.tar.gz
cd redis-$version
make
make install
mkdir -p /etc/redis
@baoshan
baoshan / org.redis.redis-server.plist
Created April 24, 2012 01:29
Redis Post Installation Configuration (Mac OS X)
curl -o /Library/LaunchDaemons/org.redis.redis-server.plist https://gist.github.com/raw/2475316/45fb490829e5539e6e2476f7d5117fc88b59acf7/org.redis.redis-server.plist
sudo launchctl load /Library/LaunchDaemons/org.redis.redis-server.plist
sudo launchctl start org.redis.redis-server