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
Mongodb Dynamic querys select | |
MySQL: | |
SELECT * FROM user | |
Mongo: | |
db.user.find() | |
MySQL: | |
SELECT * FROM user WHERE name = 'foobar' | |
Mongo: |
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
http://api.t.sina.com.cn/oauth/authorize?oauth_token=871de25c7f1d923e7b0a56bee795d869&oauth_token_secret=36ffdca3c6ca0496ac88808270ecce88&oauth_callback=http://www.dianping.com/ThirdPart.v?do=r | |
Consumer (key:1860579545, secret:d62c11d9ddaa25d55fc59b1835e73619) | |
1.没有授权,进行授权 | |
RequestToken (secret: bf307a4e119addd45645a4ccdda12b3c, token: b4da5eba67b73aec6ee5b9e7230a526d) | |
AccessToken (secret: bf307a4e119addd45645a4ccdda12b3c, token: 38372a1b37859d2ca39d85f24e62a597) | |
2.解除授权,重新授权 | |
RequestToken (secret: 8cb67ae3bbd96ca9e68a0a3a3b0c5461, token: e0258140e68375428239e828b6ef7449) |