Skip to content

Instantly share code, notes, and snippets.

View leizongmin's full-sized avatar
😴
I may be slow to respond

LEI Zongmin leizongmin

😴
I may be slow to respond
View GitHub Profile
@leizongmin
leizongmin / http-reverse-proxy.go
Last active December 11, 2017 05:07
Go语言写的简单HTTP反向代理
package main
import (
"fmt"
"io"
"log"
"net/http"
"net/url"
"time"
)
@leizongmin
leizongmin / msf-gui-armitage.sh
Created November 16, 2017 12:40
Armitage启动命令
#!/bin/sh
echo "start msfrpcd..."
pkill msf
msfrpcd -U msf -P msf -f -S -a 127.0.0.1 &
echo "wait..."
sleep 20
echo "start armitage..."
export MSF_DATABASE_CONFIG=~/.msf4/database.yml
armitage &
@leizongmin
leizongmin / check_password.js
Created November 14, 2017 02:35
检查密码规则
/**
* 检查密码是否符合规则,如果符合规则返回true
* @param {string} pwd
* @return {boolean}
*/
function check(pwd) {
return (
notSeries(pwd, "1234567890", 3) &&
notSeries(pwd, "abcdefghijklmnopqrstuvwxyz", 3) &&
notSeries(pwd, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 3) &&
@leizongmin
leizongmin / npm-proxy.js
Last active December 11, 2017 05:09
私有NPM代理程序
const httpRequest = require("http").request;
const httpsRequest = require("https").request;
const parseUrl = require("url").parse;
const connect = require("connect");
const colors = require("colors");
const PORT = Number(process.env.PORT || 6666);
const REGISTRY_CDN =
process.env.REGISTRY_CDN || "https://registry.npm.taobao.org";
const REGISTRY_PRIVATE =
@leizongmin
leizongmin / holyhi.ts
Created October 6, 2017 14:09
简单的状态管理
import * as immutable from 'immutable';
export type State = immutable.Map<string, any>;
export type Listener = () => void;
export const LISTENER_ALL = '@@@@ALL';
export class Store {
protected state: State;
@leizongmin
leizongmin / test_json.go
Created September 25, 2017 07:07
golang JSON
package main
import (
"fmt"
"encoding/json"
"github.com/mitchellh/mapstructure"
)
type A struct {
@leizongmin
leizongmin / dnspod_update.js
Created September 1, 2017 04:54
DNSPod 更新域名解析记录
/**
* DNSPOD 动态更新域名
*
* 参考:https://gist.github.com/chuangbo/833369
* https://www.dnspod.cn/docs/records.html#dns
*/
const os = require('os');
const request = require('request');
@leizongmin
leizongmin / process_video.html
Last active June 20, 2017 05:59
HTML5本地视频截图演示
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>本地视频截图演示</title>
<style>
#videoInfo {
padding: 20px;
background: antiquewhite;
@leizongmin
leizongmin / test_image.go
Last active June 4, 2017 08:53
go处理jpeg图片例子
package main
import (
"os"
"image/color"
"image/jpeg"
"image"
"time"
"fmt"
)
@leizongmin
leizongmin / lei.css
Last active December 13, 2017 02:01
Typora Theme - Lei
html, body {
font-family: "Biaodian Pro Sans CNS","Helvetica Neue",Helvetica,Arial,"Zhuyin Heiti","Han Heiti",sans-serif;
-webkit-font-smoothing: subpixel-antialiased;
line-height: 1.7;
word-break: break-word;
color: #333;
background-color: #f3f2ee;
}