Skip to content

Instantly share code, notes, and snippets.

View Surgo's full-sized avatar
🛰️
Generating...

Kosei Kitahara Surgo

🛰️
Generating...
View GitHub Profile
simple benchmark
http://github.com/mopemope/meinheld/tree/master/bench/hello/
result:
ma2@xxxx:11:51:ab -c 100 -n 10000 http://192.168.2.10:8000/ ~
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
import sys
from ctypes import *
c_int_p = POINTER(c_int)
c_uint_p = POINTER(c_uint)
def typeof(structure, name):
for k, v in structure._fields_:
if k == name:
return v
@Craftworks
Craftworks / mymemcheck
Created December 8, 2010 15:14
MySQL memory configuration check tool
#!/usr/bin/env perl
use strict;
use warnings;
my @GLOBAL_BUFFERS = qw(
key_buffer_size
innodb_buffer_pool_size
innodb_log_buffer_size
innodb_additional_mem_pool_size
@mopemope
mopemope / pink.py
Created April 6, 2011 09:19
ピンク速報 skype bot
# -*- coding: utf-8 -*-
from plugpy.ext.skype import SimpleSkypePlugin
import itertools
import mimetools
import mimetypes
from cStringIO import StringIO
import urllib2
import os
import feedparser
from pyquery import PyQuery as pq
@mopemope
mopemope / test_server.py
Created May 30, 2011 02:14
tobikko example
from tobikko import get_hub
from tobikko.api import *
from tobikko.server import StreamServer
from tobikko import socket
def test_accept():
s = StreamServer()
def _handle(sock, addr):
while True:

DNS and DotCloud

In the following, replace example.net with your domain name. XXX.XXX.XXX.XXX is the IP of the reverse proxy.

DNS entries

Required DNS entries

example.net. 300 IN A XXX.XXX.XXX.XXX

@mala
mala / gist:1073591
Created July 9, 2011 13:50
jQueryでクロスドメイン読み込みを全般的に禁止する
// jQueryでクロスドメイン読み込みを全般的に禁止する
// Note: 同一ドメインにオープンリダイレクタがないか確認すること
(function($){
var gethost = function(url){
var a = document.createElement("a");
a.href = url;
return a.host
};
var old_beforesend = $.ajaxSettings.beforeSend;
@mala
mala / gist:1073612
Created July 9, 2011 14:20
jQuery MobileのloadPageで異なるホストを弾く
// jQuery MobileのloadPageで異なるホストを弾く
// Note: 同一ドメインにオープンリダイレクタがないか確認すること
(function($){
var old = $.mobile.loadPage;
var gethost = function(url){
var a = document.createElement("a");
a.href = url;
return a.host
};
@mopemope
mopemope / hello_world.py
Created July 19, 2011 05:15
yield response
from meinheld import server
def hello_world(environ, start_response):
status = '200 OK'
res = "Hello world!"
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
yield res
yield "Yield"
@theothertom
theothertom / Template_MySQL_Server.xml
Created December 6, 2011 16:04
Template_MySQL_Server.xml
<?xml version="1.0"?>
<zabbix_export version="1.0" date="06.09.08" time="04.11">
<hosts>
<host name="Template_MySQL_Server">
<useip>0</useip>
<dns></dns>
<ip></ip>
<port>10050</port>
<status>3</status>
<groups>