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 / get.js
Created May 12, 2018 11:19 — forked from rafaelstz/get.js
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.
package main
import (
agwd "github.com/sclevine/agouti"
tbwd "github.com/tebeka/selenium"
"log"
sgwd "sourcegraph.com/sourcegraph/go-selenium"
)
// Helper for sourcegraph/go-selenium
@ego008
ego008 / unixhttpc.go
Created July 11, 2018 08:02 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@ego008
ego008 / gchart_offline.html
Created November 27, 2018 12:35 — forked from makevoid/gchart_offline.html
GChart offline example
<!--
How to use Google JS Visualization Api offline, step by step
this approach might work with other libraries loaded with google.load, after all it's still JavaScript!!!
-->
<!DOCTYPE html>
<html>
import asyncio
import base64
import hashlib
from japronto.app import Application
class NaiveWsBaseProtocol(asyncio.Protocol):
@staticmethod
def accept(key):
@ego008
ego008 / gist:52aa72ffdbd41ff33af99260b0e26f2e
Last active December 26, 2018 11:51 — forked from methane/gist:2185380
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
import time
import tornado
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor # `pip install futures` for python2
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
from tornado import gen
@ego008
ego008 / make_safely_shutdown.py
Created December 26, 2018 12:30 — forked from nicky-zs/make_safely_shutdown.py
Make the tornado httpserver.HTTPServer to be shutdown safely.
# vim: fileencoding=utf-8
import time, signal
from tornado import web, ioloop, options, httpserver
_SHUTDOWN_TIMEOUT = 30
def make_safely_shutdown(server):
io_loop = server.io_loop or ioloop.IOLoop.instance()
def stop_handler(*args, **keywords):
def shutdown():
@ego008
ego008 / test_ws.py
Created January 10, 2019 13:38 — forked from crodjer/test_ws.py
Application to demonstrate testing tornado websockets
'''
Application to demonstrate testing tornado websockets.
Try it wiith: python -m tornado.testing discover
'''
from tornado import testing, httpserver, gen, websocket
from ws import APP
@ego008
ego008 / Huawei_E3372_openwrt.md
Created March 6, 2019 14:44 — forked from bjoern-r/Huawei_E3372_openwrt.md
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update