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 / main.go
Created December 1, 2017 03:57 — forked from dmitshur/main.go
Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
package main
import (
"crypto/tls"
"flag"
"log"
"net/http"
"net/http/httputil"
"time"
@ego008
ego008 / main.go
Created December 12, 2017 00:53 — forked from jaksi/main.go
Go web server
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net/http"
@ego008
ego008 / aes.go
Created January 16, 2018 03:29 — forked from willshiao/aes.go
AES 256-CFB in Node.js and Golang
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@ego008
ego008 / TornadoTank.py
Created February 23, 2018 08:41 — forked from clouetb/TornadoTank.py
Base for a Tornado based robot control UI. Allows to stream mjpeg in the HTML page returned.
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.tcpserver
import tornado.tcpclient
import tornado.httpclient
import tornado.iostream
import tornado.gen
import uuid
import json
import struct
try:
from time import perf_counter as clock
except ImportError:
from time import time as clock
from tornado.tcpserver import TCPServer
from tornado.tcpclient import TCPClient
from tornado.ioloop import IOLoop
from tornado import gen
@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'
@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 / 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 / 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 <me@seriyps.ru>
How to test:
$ head -c 100M /dev/urandom > static_file.bin
$ python
@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: