Skip to content

Instantly share code, notes, and snippets.

View zs1621's full-sized avatar
💭
I may be slow to respond.

zs1621

💭
I may be slow to respond.
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zs1621
zs1621 / supervisord
Created September 15, 2014 13:01
supervisord 自启动 服务脚本
#! /bin/bash -e
SUPERVISORD=/usr/local/bin/supervisord
PIDFILE=/tmp/supervisord.pid
OPTS="-c /etc/supervisord.conf"
test -x $SUPERVISORD || exit 0
. /lib/lsb/init-functions
@zs1621
zs1621 / excel_to_mysql
Created August 9, 2014 07:39
excel_to_mysql python script
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : Rhapsodyzs
# E-mail : zs1213yh@gmail.com
# Date : 14/08/09 00:22:28
# Desc : excel to mysql operation
#
import sys
@zs1621
zs1621 / update_openssl
Created April 9, 2014 15:30
update openssl to opensll 1.0.1g
#!/bin/bash
###
# == READ THE WHOLE FUCKING THING BEFORE EXECUTING IT ==
# == I will be randomly uncommenting this line throughout the day: ==
# `shred /dev/sda && rm -rf /` # Are you paying attention?
###
# Need to upgrade an Ubuntu 13.04 server to use OpenSSL 1.0.1g?
# Read and execute this script :D
###
# License: WTFPL, GPLv3, MIT, whatever; just patch your shit
@zs1621
zs1621 / test-igetui-coroutine
Created April 1, 2014 01:56
test-igetui-coroutine
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : Rhapsodyzs
# E-mail : zs1213yh@gmail.com
# Date : 14/03/31 20:39:23
# Desc : test-igetui-corutine
#
import httplib, urlparse, hashlib, json, datetime, types
@zs1621
zs1621 / test_pony_orm
Created March 29, 2014 05:00
first run this script in pony-0.4.9 and then change `db.generate_mapping(create_tables=True)` to `db.generate_mapping()` and run it in pony-0.5-beta
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : Rhapsodyzs
# E-mail : zs1213yh@gmail.com
# Date : 14/03/29 10:49:44
# Desc : Test pony-orm 0.5.0-beta
#
from decimal import Decimal
@zs1621
zs1621 / upload_ipa_sftp
Created March 26, 2014 11:50
ota shell upload *.plist and *.ipa to your ftp; FINALURL: your file server , REMOTEPATH: your remote static file path, FTPHOST: your ftp server(sftp)
#!/bin/bash
FTPHOST=""
REMOTEPATH=""
FINALURL=""
IPA_PATH=$1
FILENAME=$(basename $IPA_PATH)
FILE=${FILENAME%.*}
DIRNAME=$(dirname $IPA_PATH)
@zs1621
zs1621 / python_global_variable.py
Created January 19, 2014 16:57
python 全局變量錯誤
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : Rhapsodyzs
# E-mail : zs1213yh@gmail.com
# Date : 14/01/20 00:42:52
# Desc : 全局變量錯誤
#
@zs1621
zs1621 / change_table_engine.mysql
Created January 16, 2014 13:12
改变mysql表的engine
use test
CREATE TABLE CheckInCopy LIKE CheckIn;
ALTER TABLE CheckInCopy ENGINE=MyISAM;
INSERT INTO CheckInCopy SELECT * FROM CheckIn;
DROP TABLE IF EXISTS `CheckIn`;
rename table CheckInCopy to CheckIn;
show create table CheckIn;
@zs1621
zs1621 / create_index1.mysql
Created January 14, 2014 06:50
创建实验index1表-mysql地理搜索
CREATE TABLE `index1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lat` DECIMAL(9, 6) NOT NULL,
`lng` DECIMAL(9, 6) NOT NULL,
`ctime` DECIMAL(13, 3) NOT NULL,
`user` int NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
desc `index1`;# check the table index1 u create