Skip to content

Instantly share code, notes, and snippets.

@ShenXuGongZi
ShenXuGongZi / haproxy.sh
Last active June 3, 2019 06:46
haproxy.sh
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS/Debian/Ubuntu
# Description: HaProxy
# Version: 1.0.7
# Author: Toyo
# Blog: https://doub.io/wlzy-19/
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>main</title>
<link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
<link rel="stylesheet" type="text/css" href="../css/api.css" />
<link rel="stylesheet" type="text/css" href="../css/common.css" />
http{
...
limit_zone one $binary_remote_addr 10m;
...
server{
listen 80;
....
location/{
limit_conn one 5; #限制连接数
limit_rate 500k; # 限制速度
RewriteEngine on
RewriteBase /dokuwiki
RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&id=$2 [QSA,L]
RewriteRule ^$ doku.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@ShenXuGongZi
ShenXuGongZi / gist:11169234
Created April 22, 2014 07:55
dibi.min.php
<?php //netteloader=IDataSource,IDibiDriver,IDibiResultDriver,IDibiReflector,DibiDateTime,DibiObject,DibiLiteral,DibiHashMapBase,DibiHashMap,DibiException,DibiDriverException,DibiPcreException,DibiNotImplementedException,DibiNotSupportedException,DibiConnection,DibiResult,DibiResultIterator,DibiRow,DibiTranslator,DibiDataSource,DibiFluent,DibiDatabaseInfo,DibiTableInfo,DibiResultInfo,DibiColumnInfo,DibiForeignKeyInfo,DibiIndexInfo,DibiEvent,DibiFileLogger,DibiFirePhpLogger,dibi,DibiMySqlReflector,DibiMySqlDriver,DibiMySqliDriver,DibiOdbcDriver,DibiSqliteReflector,DibiPdoDriver,DibiPostgreDriver,DibiSqliteDriver,DibiSqlite3Driver
/**
* dibi - smart database abstraction layer (http://dibiphp.com)
*
* Copyright (c) 2005, 2012 David Grudl (http://davidgrudl.com)
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/
[2014-04-22 04-05-50] DibiDriverException: SQLSTATE[HY000]: Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /web/lib/dibi.min.php:1102 @ http://up.vpsbar.im/en/public @@ exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
[2014-04-22 04-05-59] DibiDriverException: SQLSTATE[HY000]: Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /web/lib/dibi.min.php:1102 @ http://up.vpsbar.im/en/public @@ exception-2014-04-22-04-05-50-f3cf5137b37058de5d269f6efb15af27.html
[2014-04-22 04-06-10] DibiDriverException: SQLSTATE[HY000]: Cannot execute queries while o
@ShenXuGongZi
ShenXuGongZi / gist:11167634
Last active August 29, 2015 14:00
db.php
db.<?php
require './lib/dibi.min.php';
// DB
try {
$dsn = new PDO("mysql:host=localhost;dbname=runtime", 'root', '****', array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
));
dibi::connect(array(
@ShenXuGongZi
ShenXuGongZi / gist:10983693
Created April 17, 2014 13:32
VPS有货无货监控脚本
<?php
$url = 'https://my.frantech.ca/cart.php?a=add&pid=1';
$content = file_get_contents($url);
if (preg_match("/Out of Stock/i", $content)) {
echo "我擦,没货!";
} else {
echo "我勒个去,终于有货了!";
sendMail();
@ShenXuGongZi
ShenXuGongZi / Popobox-debian
Created November 13, 2013 02:54
泡泡云 29元安炸那个debian
Debian with Popobox v1.0
原文链接:http://pear.xiaojiublog.net/2013/11/debian-with-popobox-v1-0/
## 部分内容由 felix021 修正、简化 ##
1: 制作Debian系统
mkdir chroot && cd chroot
sudo debootstrap --foreign --arch=armel wheezy debian http://ftp.debian.org/debian
打包:
<?php include 'header.php'; ?>
<script type="text/javascript" language="javascript">
function ChangeTxt(obj){
var val = obj.options[obj.selectedIndex].value; //获取下接框选择的值
document.getElementById("menu").value=val; //将获取的值填写到文本框
}
</script>
<form action="action.php?kind=<?php echo $_GET["kind"]?>
&come=addziliao" method="post">
<div class="container">