Skip to content

Instantly share code, notes, and snippets.

@chzealot
chzealot / http_get.go
Created March 22, 2024 00:50
create http client with custom root ca
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@chzealot
chzealot / gist:4523660
Created January 13, 2013 11:42
电影低俗小说,mldonkey上的搜索结果
# Pulp.Fiction.1994.低俗小说.双语字幕.HR-HDTV.AC3.1024x576.x264-人人影视制作.mkv
ed2k://|file|Pulp.Fiction.1994.xn--oqqwmy62ajj2c.xn--jor88oxrc5w3e.HR-HDTV.AC3.1024x576.xn--x264--gd2ha01ky5ny50b6k1h.mkv|2539544624|5CF34CA02FE58124A97728E924FA1DD3|/
# [低俗小说].Pulp.Fiction.1994.Blu-ray.720p.x264.DTS-HiS@SiLUHD.disk02.mkv
ed2k://xn--|file|[]-2h2mg8bd93f1d4j.Pulp.Fiction.1994.Blu-ray.720p.x264.DTS-HiS@SiLUHD.disk02.mkv|2304902795|B864C886DF52D67B175719B321F79DA6|/
@chzealot
chzealot / autossh_fabfile.py
Created September 2, 2012 14:37
fabfile to deploy autossh for sock5 proxy over ssh
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Zealot Ke <chzealot@gmail.com>
# Copyright (C) losthit.com 2012
import os
import sys
import time
from fabric.api import *
@chzealot
chzealot / 12factor.md
Created August 24, 2012 02:54 — forked from harmy/12factor.md
12factor

中文翻译:梁山 英文原文:Adam Wiggins

简介

如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或“软件即服务”(SaaS)。“十二要素应用程序”(12-Factor App)为构建如下的SaaS应用提供了方法论:

  • 使用标准化流程自动配置,从而使新的开发者花费最少的学习成本加入这个项目;
  • 和操作系统之间尽可能的划清界限,在各个系统中提供最大的可移植性
  • 适合部署在现代的云计算平台,从而在服务器和系统管理方面节省资源;
@chzealot
chzealot / ssh-config
Created August 18, 2012 18:36
ssh配置,普通用户权限就可以;开启ForwardAgent,方便中转;每隔30s发送NOOP指令,连续6次失败则中止,保持连接,避免掉线;
$ cat ~/.ssh/config
Host *
ServerAliveInterval 30
ServerAliveCountMax 6
ForwardAgent yes
@chzealot
chzealot / ssh.d.proxy.plist
Created July 18, 2012 09:46
开机自动启动ssh-D代理 $ launchctl load ~/Library/LaunchAgents/ssh.d.proxy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh.d.proxy</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh</string>
<string>-D</string>
@chzealot
chzealot / fast.txt
Created December 31, 2011 07:21
php hash algorithm collision: http://www.ocert.org/advisories/ocert-2011-003.html "$ git clone git://gist.github.com/1543224.git"
0=0&1=0&2=0&3=0&4=0&5=0&6=0&7=0&8=0&9=0&10=0&11=0&12=0&13=0&14=0&15=0&16=0&17=0&18=0&19=0&20=0&21=0&22=0&23=0&24=0&25=0&26=0&27=0&28=0&29=0&30=0&31=0&32=0&33=0&34=0&35=0&36=0&37=0&38=0&39=0&40=0&41=0&42=0&43=0&44=0&45=0&46=0&47=0&48=0&49=0&50=0&51=0&52=0&53=0&54=0&55=0&56=0&57=0&58=0&59=0&60=0&61=0&62=0&63=0&64=0&65=0&66=0&67=0&68=0&69=0&70=0&71=0&72=0&73=0&74=0&75=0&76=0&77=0&78=0&79=0&80=0&81=0&82=0&83=0&84=0&85=0&86=0&87=0&88=0&89=0&90=0&91=0&92=0&93=0&94=0&95=0&96=0&97=0&98=0&99=0&100=0&101=0&102=0&103=0&104=0&105=0&106=0&107=0&108=0&109=0&110=0&111=0&112=0&113=0&114=0&115=0&116=0&117=0&118=0&119=0&120=0&121=0&122=0&123=0&124=0&125=0&126=0&127=0&128=0&129=0&130=0&131=0&132=0&133=0&134=0&135=0&136=0&137=0&138=0&139=0&140=0&141=0&142=0&143=0&144=0&145=0&146=0&147=0&148=0&149=0&150=0&151=0&152=0&153=0&154=0&155=0&156=0&157=0&158=0&159=0&160=0&161=0&162=0&163=0&164=0&165=0&166=0&167=0&168=0&169=0&170=0&171=0&172=0&173=0&174=0&175=0&176=0&177=0&178=0&179=0&180=0&181=0&182=0&183=0&184=0&185=0&186=0&187=0&188=0&
@chzealot
chzealot / linode.speedtest.2011-12-39
Created December 30, 2011 11:12
result of speedtest for linode datacenter
# generated by speedtest.py
# - you could get it from https://github.com/chzealot/tools/tree/master/python/linode
facility hostname url
Tokyo, JP tokyo1.linode.com http://tokyo1.linode.com/100MB-tokyo.bin
London, UK london1.linode.com http://london1.linode.com/100MB-london.bin
Newark, NJ newark1.linode.com http://newark1.linode.com/100MB-newark.bin
Atlanta, GA atlanta1.linode.com http://atlanta1.linode.com/100MB-atlanta.bin
Dallas, TX dallas1.linode.com http://dallas1.linode.com/100MB-dallas.bin
Fremont, CA fremont1.linode.com http://fremont1.linode.com/100MB-fremont.bin
@chzealot
chzealot / vim-py
Created November 18, 2011 13:23
vim python
if has("autocmd")
autocmd BufNewFile *.py 0r ~/.vim/python-support/simple.py
endif
@chzealot
chzealot / nginx-for-mldonkey
Created September 24, 2011 03:38
Nginx configuration for mldonkey
upstream mlnet {
server 127.0.0.1:4080;
}
server {
listen 80;
server_name mldonkey.kejie.me;
root /Users/zealot/.mldonkey/incoming;
location / {
if (!-f $request_filename) {