Skip to content

Instantly share code, notes, and snippets.

@zwjzxh520
zwjzxh520 / server.js
Created August 6, 2018 12:30 — forked from bencentra/server.js
An HTTPS server for static content (Node.js)
/*
This module creates an HTTPS web server and serves static content
from a specified directory on a specified port.
To generate a new cert:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
To remove the passphrase requirement:
@zwjzxh520
zwjzxh520 / MinumDistance.php
Last active November 8, 2016 04:37
最小编辑距离算法比较文本异同 Levenshtein Distance。引用自https://code.google.com/archive/p/clamdemo/downloads
<?php
/***************************************************************************
*
* Copyright (c) 2011 log4myself.com, Inc. All Rights Reserved
*
**************************************************************************/
/**
@zwjzxh520
zwjzxh520 / socks5.php
Last active October 21, 2016 11:06
PHP 简易socks5客户端。支持密码方式验证
<?php
/**
* PHP 简易socks5客户端。支持密码方式验证
*/
$user = 'root';
$pass = '123456';
$port = 80;
@zwjzxh520
zwjzxh520 / NginxLog.php
Last active February 1, 2022 13:59
php写的nginx 日志分析
<?php
/**
* nginx日志文件分析。
* 根据配置的nginx日志格式,分析对应的日志内容。各变量
*/
class NginxLog {
protected static $br = "\n";
/**
//消除文件中的注释内容。支持以下两种格式
//1. 以//开头单行注释
//2. /**/块级注释
//可用于清除配置文件中的注释
package comment
func ClearLine(text []byte) []byte {
newText := []byte("")
n := byte('\n')
r := byte('\r')
@zwjzxh520
zwjzxh520 / fcgiclient.go
Created April 5, 2016 15:11 — forked from wofeiwo/fcgiclient.go
Golang FastCGI Client
// Copyright 2012 Junqing Tan <ivan@mysqlab.net> and The Go Authors
// Use of this source code is governed by a BSD-style
// Part of source code is from Go fcgi package
// Fix bug: Can't recive more than 1 record untill FCGI_END_REQUEST 2012-09-15
// By: wofeiwo
package fcgiclient
import (