Skip to content

Instantly share code, notes, and snippets.

@owulveryck
owulveryck / AAaa note.md
Last active January 10, 2024 08:24
havre / a docker like that runs an embedded squashfs image

About

This is a proof of concept of a portable operating system a-la-docker.

It is a single binary that contains an image of an OS in SquashFS and the binary to run it.

a make will build the binary with an embedded alpine image. make havre-xenial will build a binary with an embedded ubuntu image.

What does the binary do?

@BretFisher
BretFisher / docker-for-mac.md
Last active April 18, 2024 11:56
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@everyx
everyx / bestroutetb_generator_shadowsocks.sh
Last active July 23, 2018 14:21
使用 bestroutetb 生成为 shadowsocks 透明代理需要的 shell 脚本
#!/usr/bin/bash
filename=$'iptables.shadow'
bestroutetb -p custom -o $filename --rule-format=$'iptables -t nat -A SHADOWSOCKS -d %prefix/%mask -j %gw\n' --gateway.net=RETURN --gateway.vpn=ACCEPT --header=$'#!/usr/bin/sh\niptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 1080\niptables -t nat -A SHADOWSOCKS -d MY_SS-REDIR_SERVER_IP -j RETURN\n\n' --footer=$'\niptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 1080\niptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS\n'
if [ -f "$filename" ]; then
sed -e '/-j ACCEPT/d' $filename > tmp
rm $filename
mv tmp $filename
fi
@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 可用,但端口一致,就设置这个
@rcoup
rcoup / aws_usage.py
Created June 1, 2010 21:46
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'