Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
perl -ne 'm/^([^#][^\s=]+)\s*(=.*|)/ && printf("%-35s%s\n", $1, $2)' /etc/mysql/my.cnf
SHOW SLAVE STATUS \G
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;
SHOW SLAVE STATUS \G
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
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',
@didip
didip / __init__py
Created June 8, 2009 06:41
My Default tests/__init__.py
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__), '..', '..'))