This file contains hidden or 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
# ruby developer packages | |
sudo apt-get install ruby1.8 ri1.8 rdoc1.8 irb1.8 | |
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby | |
# hpricot requirements | |
sudo apt-get install ruby1.8-dev | |
sudo gem install hpricot | |
# nokogiri requirements |
This file contains hidden or 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
MySQL Log 的配置 | |
MySQL内置4种Log: | |
Error Log, General Query Log, Binary Log, Slow Query Log | |
1. Error Log | |
错误日志, 记录MySQL启动、运行、停止过程中出现的错误信息 | |
2. General Query Log | |
记录MySQL客户端连接、查询的细节, 调试的时候很有用, 正式运行的时候最好关闭否则会带来大量磁盘IO |
This file contains hidden or 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
更换mysql的数据库目录,需要将原来的db数据copy到目标目录,然后做如下更改: | |
/etc/mysql/my.cnf | |
# * Basic Settings | |
# | |
# | |
# * IMPORTANT | |
# If you make changes to these settings and your system uses apparmor, you may |
This file contains hidden or 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
EC2 softwares configure file: | |
1.Mysql | |
/etc/mysql/my.cnf | |
sudo /etc/init.d/mysql start|stop|restart | |
2.MongoDB | |
/etc/init.d/MongoDB | |
sudo /etc/init.d/MongoDB start|stop|restart | |
sudo mongod --dbpath /mnt/mongo/data/ --logpath /mnt/mongo/log/mongodb.log --fork --logappend |
This file contains hidden or 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
# /etc/init.d/nginx | |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains hidden or 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
NSURL *url = [NSURL URLWithString:@"http://api.woyiwang.com:4001/test_post_login"]; | |
NSString *body = [NSString stringWithFormat: @"param1=%@¶m2=%@",value1,value2]; | |
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; | |
[theRequest setHTTPMethod:@"POST"]; | |
[theRequest setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]]; | |
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; |
This file contains hidden or 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
# using rvm with ruby-1.8.7-p249 | |
# latest version 2.7.7 2010-06-17 | |
brew install libxml2 | |
brew link libxml2 | |
# latest version 1.13.1 | |
brew install libiconv | |
brew link libiconv |
This file contains hidden or 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
class Person | |
def self.person | |
"Person" | |
end | |
end | |
class Person | |
class << self | |
def hello | |
"Hello" |
This file contains hidden or 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
# remove all existed ruby | |
rm -rf /usr/lib/ruby | |
wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz | |
tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz | |
./ruby-enterprise-1.8.7-2010.02/installer | |
# custom the location of ruby installation: /usr/lib/ruby | |
# ruby, passenger, rake, ri, rdoc, rubygem, rack, rails ... will be installed |
This file contains hidden or 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |