Skip to content

Instantly share code, notes, and snippets.

View chaosong's full-sized avatar
🍺
homebrew

chaosong

🍺
homebrew
View GitHub Profile
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@nicolashery
nicolashery / elasticsearch.md
Last active December 30, 2023 19:03
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@janlay
janlay / README.md
Last active March 20, 2025 13:05
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

anonymous
anonymous / shadowsocks_tor_zeronet
Created November 20, 2016 12:18
Shadowsocks 作为前置代理,通过 Tor 匿名使用 ZeroNet(备忘)
# 声明:此备忘只供参考,并非权威方法,请参阅 Tor 和 ZeroNet 的安装和配置手册
# Tor 相关 FAQ 见 http://*.*.*.*:43110/gfwtalk.bit/?Topic:37_13Z7XxTa7JuFat3KzzMWu3onwM6biLuurJ/+FAQ+6+1+Update+Freenet+VPS+ZeroNet+com+bit
# ZeroNet 集成的 Tor 版本并没有及时更新,现在最新版是 0.2.9.x
# 适用 Debian/Ubuntu/raspberryPi 等系统
# 按照 Tor 官方文档安装最新版 Tor https://www.torproject.org/docs/debian.html.en#ubuntu
# 墙内使用 Tor 需要前置代理,推荐使用 Shadowsocks 作为前置代理,默认本地代理端口 1080
# Tor 和 Shadowsocks 准备就绪后修改 /etc/tor/torrc 文件
vi /etc/tor/torrc
@darth-veitcher
darth-veitcher / shellinabox.md
Created January 7, 2017 21:13
Shellinabox reverse proxy and basic auth with Caddy

Install shellinabox

sudo apt-get install shellinabox -y
# Modify the shellinabox settings
# - lock down so only localhost allowed
# - disable ssl as we will use the verified certs provided by Caddy
sudo nano /etc/default/shellinabox
...
SHELLINABOX_ARGS="--no-beep --localhost-only --disable-ssl"
...
@ianchen06
ianchen06 / ipsec_ikev2.md
Last active July 5, 2022 11:37
ikev2 ipsec vpn with letsencrypt certificate and ios/macOS native vpn compatibility
@enricofoltran
enricofoltran / main.go
Last active April 6, 2025 09:48
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@artizirk
artizirk / pyroute_netlink_wireguard.py
Last active July 5, 2022 14:09
Test program to print out WireGuard interface config using Python pyroute2 netlink library