This file contains hidden or 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 groovy.sql.GroovyResultSet | |
| import groovy.sql.Sql | |
| import java.sql.ResultSet | |
| /** | |
| * 这个程序用来修改 MySQL 数据库表中字段的字符集标注。适用于原先没有标注(latin1),但存储的却是 GBK 编码的表格。 | |
| * | |
| * 如果原本存储的是 UTF-8 数据,把程序中的 gbk 替换为 utf8 即可。 | |
| */ |
This file contains hidden or 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 -*- | |
| # 检查 gnokii smsd 连接的短信猫对应的电话卡的余额,并返回给 nagios | |
| # 使用方法为 check_smsd_balance -c 20: -w 100: -p 2 | |
| import MySQLdb, re, string | |
| ## This is for the custom nagios module | |
| from pynag.Plugins import simple as Plugin |
This file contains hidden or 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 base.shiro.ShiroRole | |
| import base.shiro.ShiroUser | |
| import org.apache.shiro.cas.CasAuthenticationException | |
| import org.apache.shiro.authc.AccountException | |
| import org.apache.shiro.authc.SimpleAuthenticationInfo | |
| import org.apache.shiro.util.StringUtils | |
| import org.apache.shiro.util.CollectionUtils | |
| import org.apache.shiro.subject.PrincipalCollection | |
| import org.apache.shiro.subject.SimplePrincipalCollection |
This file contains hidden or 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 | |
| function add_slash { | |
| echo $1 | sed -e 's/\//\\\//' | |
| } | |
| function list_snapshot { | |
| local v=$(add_slash $VOL) | |
| zfs list -t snapshot | awk "/$v@$SNAPSHOT-/"'{print $1}' | |
| } |
This file contains hidden or 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 -*- | |
| import csv, subprocess | |
| tableReader = csv.reader(open('lx.csv', 'rb'), delimiter=',', quotechar='"') | |
| tableWriter = csv.writer(open('mdl-lx.csv', 'wb')) | |
| tableWriter.writerow(['username','password','lastname','firstname','email','description','course1']) |
This file contains hidden or 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
| // ==UserScript== | |
| // @name 开心网超级大亨 | |
| // @namespace kaixin001.app.rich | |
| // @description 记录开心网超级大亨各种产品的价格 | |
| // @include http://www.kaixin001.com/!rich/* | |
| // ==/UserScript== | |
| function parse_number(num) { | |
| var unit = 1; | |
| if (num.match(/万元/)) { |