Skip to content

Instantly share code, notes, and snippets.

View iwanbk's full-sized avatar
🎯
Focusing

Iwan Budi Kusnanto iwanbk

🎯
Focusing
View GitHub Profile
@iwanbk
iwanbk / NOTE.md
Created November 23, 2018 13:53 — forked from tcnksm/NOTE.md
Small note of gRPC Best Practice @ CoreOSFest 2017
@iwanbk
iwanbk / psql-srv.py
Created August 27, 2018 23:34 — forked from matteobertozzi/psql-srv.py
postgres "server" wire protocol example
# th30z@u1310:[Desktop]$ psql -h localhost -p 55432
# Password:
# psql (9.1.10, server 0.0.0)
# WARNING: psql version 9.1, server version 0.0.
# Some psql features might not work.
# Type "help" for help.
#
# th30z=> select foo;
# a | b
# ---+---
# The upstream server doesn't need a prefix! no need for wss:// or http:// because nginx will upgrade to http1.1 in the config below
upstream yeomanserver {
server localhost:3000;
}
server {
listen 443;
server_name legionofevil.org;
root html;
@iwanbk
iwanbk / client.py
Created May 1, 2012 10:18 — forked from stevvooe/client.py
A minimal python to go json-rpc implemention, sans HTTP
import json
import socket
s = socket.create_connection(("127.0.0.1", 5090))
s.sendall(json.dumps(({"id": 1, "method": "Hello.Hello", "params": ["hello"]})))
print s.recv(4096)
@iwanbk
iwanbk / gevent-multiprocess.py
Created April 23, 2012 09:28 — forked from denik/gevent-multiprocess.py
gevent-multiprocess
import sys
from gevent import server
from gevent.baseserver import _tcp_listener
from gevent.monkey import patch_all; patch_all()
from multiprocessing import Process, current_process, cpu_count
def note(format, *args):
sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args))