Skip to content

Instantly share code, notes, and snippets.

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

Ybb ego008

🏠
Working from home
View GitHub Profile
@ego008
ego008 / tlsprox.go
Created May 8, 2018 13:17 — forked from tam7t/tlsprox.go
Minimal TLS MITM transparent proxy
/* tlsprox - minimal tls MITM transparent proxy... in go!
* by @tam7t
*
* Usage:
* If we want to MITM https://example.com first get example.com's ip address
* then add localhost to /etc/hosts:
*
* 127.0.0.1 example.com
*
* > go build tlsprox.go
@ego008
ego008 / simple_bitmap_in_golang.go
Last active April 27, 2018 11:06
Simple bitmap in golang
package main
import (
"bytes"
"fmt"
)
//bitSet实现
type BitSet []uint64
@ego008
ego008 / tcp_client_auto_reconnect.go
Last active April 26, 2018 08:30
Simple tcp server & auto reconnect client
package main
import (
"bufio"
"log"
"net"
"time"
)
func main() {
package main
import (
"flag"
"log"
"net/url"
"os"
"os/signal"
"time"
if strings.HasPrefix(path, "/.well-known/acme-challenge/") {
filePath := strings.Replace(path, "/.well-known/acme-challenge/", "", -1)
buf, err := ioutil.ReadFile("static/"+filePath)
if err != nil {
ctx.NotFound()
ctx.SetConnectionClose()
return
}
ctx.Write(buf)
ctx.SetConnectionClose()
@ego008
ego008 / gist:69d30f9fef380eda6d4ed31b88845433
Created February 27, 2018 12:46 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ego008
ego008 / server.py
Created February 25, 2018 07:59 — forked from seriyps/server.py
TornadoWEB streaming file server
# -*- coding: utf-8 -*-
'''
Created on 2012-09-24
@author: Sergey <[email protected]>
How to test:
$ head -c 100M /dev/urandom > static_file.bin
$ python
@ego008
ego008 / aes-ecb.py
Created February 25, 2018 07:30 — forked from lopes/aes-ecb.py
Simple Python example of AES in ECB mode.
from hashlib import md5
from base64 import b64decode
from base64 import b64encode
from Crypto.Cipher import AES
# Padding for the input string --not
# related to encryption itself.
BLOCK_SIZE = 16 # Bytes
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * \
@ego008
ego008 / AESCipher.py
Created February 25, 2018 07:29 — forked from crmccreary/AESCipher.py
Encryption using pycrypto, AES, and PKCS5 padding
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__( self, key ):
"""
@ego008
ego008 / client.py
Created February 24, 2018 03:03 — forked from Greyvend/client.py
Tornado TCP Server & Client with Redis connection. Refer to the corresponding repo for the full working example: https://github.com/Databrawl/real_time_tcp/tree/3e01d85e719bf793a4811b2d701609a9a4d36597
from concurrent.futures import ThreadPoolExecutor
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.iostream import StreamClosedError
from tornado.tcpclient import TCPClient
class Client(TCPClient):
msg_separator = b'\r\n'