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
class Registry { | |
private static $table; | |
static function exists($key) { | |
return isset(self::$table[$key]); | |
} | |
static function set($key, $val) { | |
return self::$table[$key] = $val; | |
} |
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
#!/usr/bin/env python | |
import os | |
for i in range(1,34): | |
print os.system("yes|mv /data/xxx/%d xxxx/xxx/%d" % (i, i)) |
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
#!/usr/bin/env python | |
#coding:utf-8 | |
# --*-- encoding:utf-8 --*-- | |
''' | |
Created on 2013-10-13 | |
@author: poorevil | |
''' | |
import json,sys,linecache,time |
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
sudo chmod +x /etc/init.d/nginx | |
sudo /sbin/chkconfig nginx on | |
# 检查一下 | |
sudo /sbin/chkconfig --list nginx | |
nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off | |
#finished | |
service nginx start | |
service nginx stop | |
service nginx restart |
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 | |
# | |
# Startup script for the PHP-FPM server. | |
# | |
# chkconfig: 345 85 15 | |
# description: PHP is an HTML-embedded scripting language | |
# processname: php-fpm | |
# config: /usr/local/php/etc/php.ini | |
# Source function library. |
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
<?php | |
Autoloader::namespaces(array( | |
'Tracy' => Bundle::path('tracy') . 'lib' . DS . 'src' .DS .'Tracy', | |
)); | |
if (!IoC::registered('tracy')) { | |
IoC::singleton('tracy', function () { | |
Tracy\Debugger::enable(); | |
} | |
); |
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
location /resize { | |
alias /tmp/nginx/resize; | |
set $width 150; | |
set $height 100; | |
set $dimens ""; | |
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
set $width $1; | |
set $height $2; | |
set $image_path $3; |
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
<?php | |
/* | |
纯真数据库自动更新原理实现 | |
示例代码使用php实现,从copywrite.rar中读取解密需要的一个key,然后解密qqwry.rar头0x200字节数据,随后使用zlib解压数据即可得到qqwry.dat文件 | |
通过此代码的实现,你应该可以自行实现一个纯真数据库更新工具。copywrite.rar中还有一些更多的数据,没有一一列出,比如版本号、qqwry.rar文件大小。 | |
collect from https://github.com/shuax/QQWryUpdate/blob/master/update.php | |
*/ | |
$copywrite = file_get_contents("http://update.cz88.net/ip/copywrite.rar"); | |
$qqwry = file_get_contents("http://update.cz88.net/ip/qqwry.rar"); |
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
<?php | |
class ColorCLI { | |
static $foreground_colors = array( | |
'bold' => '1', 'dim' => '2', | |
'black' => '0;30', 'dark_gray' => '1;30', | |
'blue' => '0;34', 'light_blue' => '1;34', | |
'green' => '0;32', 'light_green' => '1;32', | |
'cyan' => '0;36', 'light_cyan' => '1;36', |
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
<?php | |
set_time_limit(300); | |
error_reporting(E_ALL); | |
class test { | |
function func() {} | |
} |