This file contains 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
/** | |
* @file queue.c | |
* @brief 基本的队列实现 | |
* @author linyaoyi | |
* @version 1.1 | |
* @date 2012-01-16 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
This file contains 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
//app.js Socket IO Test | |
var app = require('express').createServer(), | |
redis = require('socket.io/node_modules/redis'), | |
io = require('socket.io').listen(app); | |
var pub = redis.createClient(port, "url"); | |
var sub = redis.createClient(port, "url"); | |
var store = redis.createClient(port, "url"); | |
pub.auth('pass', function(){console.log("adentro! pub")}); | |
sub.auth('pass', function(){console.log("adentro! sub")}); |
This file contains 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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev | |
cd /tmp | |
wget http://ruby.taobao.org/mirrors/ruby/1.9/ruby-1.9.3-p429.tar.gz | |
tar -xvzf ruby-1.9.3-p429.tar.gz | |
cd ruby-1.9.3-p429/ | |
./configure --prefix=/usr/local --disable-install-rdoc | |
make |
This file contains 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
# root用户 | |
# 更新系统 | |
apt-get -y update | |
apt-get -y install curl git-core python-software-properties | |
# 安装nginx | |
add-apt-repository ppa:nginx/stable | |
apt-get -y update | |
apt-get -y install nginx | |
service nginx start | |
# 安装Node.js |
This file contains 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
#!/bin/bash | |
if [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this tool!\n" | |
exit 1 | |
fi | |
clear | |
printf " | |
#################################################### | |
# # |
This file contains 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
source 'http://rubygems.org' | |
gem 'rack' | |
gem 'rack-flash' | |
gem 'thin' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'mongoid' | |
gem 'bson_ext' | |
gem 'slim' |
This file contains 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
import cookielib | |
import socket | |
import urllib | |
import urllib2 | |
url = 'http://www.mitfahrgelegenheit.de/mitfahrzentrale/Dresden/Potsdam.html/' | |
http_header = { | |
"User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11", | |
"Accept" : "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,text/png,*/*;q=0.5", | |
"Accept-Language" : "en-us,en;q=0.5", |
This file contains 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
require "net/http" | |
require "uri" | |
require 'json' | |
# http://checkcosmetic.net | |
# uri = URI.parse("http://checkcosmetic.net/wp-admin/admin-ajax.php") | |
# http://cosmetic.momoko.hk | |
uri = URI.parse("http://cosmetic.momoko.hk/calculate.php") |
This file contains 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
#! /bin/sh | |
mkdir .tmp | |
cd .tmp | |
wget https://github.com/sunspot/sunspot/archive/v2.0.0.pre.130115.zip | |
unzip v2.0.0.pre.130115.zip | |
mv sunspot-2.0.0.pre.130115 sunspot | |
wget http://mmseg4j.googlecode.com/files/mmseg4j-1.8.5.zip | |
unzip mmseg4j-1.8.5.zip -d mmseg4j | |
cp -r sunspot/sunspot_solr/solr ../sunspot_solr_mmseg4j | |
mkdir -p WEB-INF/lib |
This file contains 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
# Gemfile | |
gem 'redis', '~> 3.0.1' |
OlderNewer