Skip to content

Instantly share code, notes, and snippets.

# -*-: coding: utf-8 -*-
import asyncio
import aiohttp
import traceback
import datetime
import math
def hsize(s):
suffixs = ["B", "KB", "MB", "GB"]
#!/usr/bin/env python
import sys
import asyncio
import websockets
class Server:
def __init__(self, host, port, loop=None, **kwargs):
#!/usr/bin/env python
import sys
import asyncio
import websockets
class Server:
def __init__(self, ws_uri, ssl_verify=True, loop=None, **wskwargs):
@neilzheng
neilzheng / server.py
Created October 21, 2017 00:30 — forked from scturtle/server.py
python socks5 proxy server with asyncio (async/await)
#!/usr/bin/env python3.5
import socket
import asyncio
from struct import pack, unpack
class Client(asyncio.Protocol):
def connection_made(self, transport):
self.transport = transport
self.server_transport = None
@neilzheng
neilzheng / OVERLAYFS
Created October 14, 2017 08:10 — forked from mutability/OVERLAYFS
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)