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 unittest import TestCase | |
from paste.deploy import loadapp | |
from paste.script.appinstall import SetupCommand | |
from pylons import config, url | |
from routes.util import URLGenerator | |
from webtest import TestApp | |
import pylons.test | |
import sys, os.path | |
ROOT_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) |
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 random | |
KATAKANA_1 = [ | |
'a', 'i', 'u', 'e', 'o', | |
'ka', 'ki', 'ku', 'ke', 'ko', | |
'sa', 'shi', 'su', 'se', 'so', | |
'ta', 'chi', 'tsu', 'te', 'to', | |
'na', 'ni', 'nu', 'ne', 'no', | |
'ha', 'hi', 'fu', 'fe', 'fo', | |
'ma', 'mi', 'mu', 'me', 'mo', |
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
mysqldump --user=root --default-character-set=latin1 -c --insert-ignore --skip-set-charset <dbname> <table-name> > <filename>.sql && | |
iconv -f ISO-8859-1 -t UTF-8 <filename>.sql > <filename>.utf8.sql && | |
perl -pi -w -e 's/CHARSET=latin1/CHARSET=utf8/g;' <filename>.sql.utf8.sql && | |
mysql --user=root --max_allowed_packet=16M --default-character-set=utf8 <dbname> < <filename>.utf8.sql |
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
SHOW SLAVE STATUS \G | |
STOP SLAVE; | |
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; | |
START SLAVE; | |
SHOW SLAVE STATUS \G |
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 | |
perl -ne 'm/^([^#][^\s=]+)\s*(=.*|)/ && printf("%-35s%s\n", $1, $2)' /etc/mysql/my.cnf |
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 | |
DUMPFILE=/tmp/dump.`date +%Y.%m.%d`.sql | |
echo Dumping > $DUMPFILE | |
mysqldump dump > $DUMPFILE | |
echo Finished dumping >> $DUMPFILE |
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
httperf --hog --server 10.1.10.118 --port 8080 --num-conn 10000 --ra 100 --num-calls=100 --timeout .01 |
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 paste.deploy import appconfig | |
from tornado.wsgi import WSGIContainer | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from your_app.config.middleware import make_app | |
port = 5000 | |
config = appconfig("config:%s" % "/your/app/development.ini") | |
app = make_app(config.global_conf, **config.local_conf) |
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 | |
# This is recipe for OS X only | |
# A wise man once said; When shit fails, use strace(Linux) or dtruss(OS X) | |
# Installing MySQL gem | |
export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config | |
# Create symlink | |
# If that symlink does not work, use strace to figure out where MySQL gem is looking for it. |
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.py - nothing special here | |
# -------------------------------------------------- | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
class Application(tornado.web.Application): | |
def __init__(self): | |
pass |
OlderNewer