Skip to content

Instantly share code, notes, and snippets.

View hfcorriez's full-sized avatar
🏠
Working from home

hfcorriez hfcorriez

🏠
Working from home
View GitHub Profile
@jterrace
jterrace / shaper.sh
Created February 23, 2012 21:13
A utility script for traffic shaping with tc
#!/bin/bash
#
# shaper.sh
# ---------
# A utility script for traffic shaping using tc
#
# Usage
# -----
# shape.sh start - starts the shaper
# shape.sh stop - stops the shaper
@jmoiron
jmoiron / bongo.sh
Created June 30, 2012 21:58
export and import all collections from a mongodb database into/outof a single tarball
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
@sofish
sofish / sea.html
Created July 3, 2012 03:25
seajs send 404 request
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Loader</title>
<link href="http://typo.sofish.de/typo.css" rel="stylesheet" />
<style type="text/css">
code{padding:0 2px;border:1px solid #eee;background:#f7f7f7;border-radius:3px;}
</style>
<script src="http://test.com:8080/static/??sea/sea.js,modules/jquery-1.7.2.min.js"></script>
@hfcorriez
hfcorriez / .vimrc
Created July 3, 2012 14:59
My Mac .vimrc
"======================================================================================
"General settings
"======================================================================================
syntax on
set expandtab
set guifont=Courier\ New\ 12
set guifontwide=STXihei:h14
"set guifont=Bitstream\ Vera\ Sans\ Mono:h14
"set nomacatsui
"set termencoding=macroman
anonymous
anonymous / imageXss.js
Created September 8, 2012 09:13
php+js xss
/*
* src="javascript:alert(1)"
* src="jav ascript:alert(2)"
* src="java&#x0script:alert(3)"
* src="&#000 ……."
* src="上面4中的变种“
*/
// php 检测以上 4 种 xss
function imageXSS($img) {
@christiannelson
christiannelson / 0.config
Created November 26, 2012 00:08
Using HAProxy with Node.js, Socket.io and SSL
global
nbproc 1
maxconn 65536
defaults
timeout connect 5s
timeout queue 5s
timeout server 30s
timeout tunnel 1h
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active September 22, 2025 03:17
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@willurd
willurd / web-servers.md
Last active November 5, 2025 20:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@denji
denji / http-benchmark.md
Last active November 2, 2025 09:48
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个