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
from restclient import GET, POST | |
import simplejson as json | |
import logging | |
import socket | |
logger = logging.getLogger('rs.utils.restclient') | |
class ConnectAPI(object): | |
''' | |
all the way of connection web and api server |
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/python | |
# -*- coding:utf-8 -*- | |
#this script is used to do some operations more convenient via ftp | |
#1.[p]upload many files in the same time,show md5s | |
#2.[g]download many files in the same time,show md5s | |
#3.[l]list all the files on ftp site | |
#4.[f]search a file on ftp site,return True or Flase | |
#5.[h]show help info | |
#add upload and download operations 20111210 version0.1 |
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 python | |
# -*- coding: utf-8 -*- | |
__all__ = ['timeout'] | |
import ctypes | |
import functools | |
import threading | |
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
var http = require('http'); | |
http.createServer(function(req, res){ | |
res.wirteHead(200, {'Content-Type': 'text/html'}); | |
res.wirte('<h1>Node.js</h1>'); | |
res.end('<p>Hello World</p>'); | |
}).listen(3000); | |
console.log("HTTP Server is lisetening at port 3000."); |
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
var http = require('http'); | |
var querystring = require('querystring'); | |
var server = http.createServer(function(req, res){ | |
var post = ''; | |
req.on('data', function(chunk){ | |
post += chunk; | |
}); | |
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 os | |
import sys | |
import time | |
import atexit | |
class Daemon(object): | |
def __init__(self, pidfile="/dev/null", stdin="/dev/null", stdout="/dev/null", stderr="/dev/null"): |
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
server { | |
listen 8001; | |
server_name localhost; | |
charset utf-8; | |
root /opt/celery_web; | |
location / { | |
root /opt/celery_web; | |
} | |
location ^~ /choi_wan_api/ { | |
#add_header 'Access-Control-Allow-Origin' '*'; |
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
server { | |
listen 443; | |
charset utf-8; | |
ssl on; | |
ssl_certificate /opt/disk2/var/serverconfig/server.cert; | |
ssl_certificate_key /opt/disk2/var/serverconfig/server.key; | |
location / { | |
root /opt/disk2/var/www; | |
uwsgi_pass 127.0.0.1:9001; |
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 | |
#celery web deploy | |
NGINX_CONF=/opt/disk2/var/serverconfig/www-nginx.conf | |
SVN_USERNAME="" | |
SVN_PASSWORD="" | |
CELERY_WEB_SVN="" | |
WEB_PROJECT_DIR=/opt/disk2/var/www |
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
def _default_cls_attr(name, type_, cls_value): | |
# Proxy uses properties to forward the standard | |
# class attributes __module__, __name__ and __doc__ to the real | |
# object, but these needs to be a string when accessed from | |
# the Proxy class directly. This is a hack to make that work. | |
# -- See Issue #1087. | |
def __new__(cls, getter): | |
instance = type_.__new__(cls, cls_value) | |
instance.__getter = getter |
OlderNewer