Skip to content

Instantly share code, notes, and snippets.

@pipoket
pipoket / clock.html
Created October 4, 2019 06:22 — forked from sam0737/clock.html
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@pipoket
pipoket / test_echo.py
Created March 24, 2017 05:14
For KAIST 2017 Spring CS341 Socket program test
import sys
DATA = b"\x01\x01\x01\x01\x02\x02\x02\x02\x02\x02\x03\x03\x04\x02\x01\x09\x09\\0"
sys.stdout.write(DATA)
sys.stdout.flush()
@pipoket
pipoket / nginx.conf
Last active May 1, 2017 13:14 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pipoket
pipoket / rasphone.txt
Created August 15, 2015 17:16
Windows VPN Script
[myvpn]
MEDIA=rastapi
Port=VPN2-0
Device=WAN Miniport (IKEv2)
DEVICE=vpn
PhoneNumber=pptp.vpn.address
@pipoket
pipoket / flume.py
Last active August 29, 2015 14:14 — forked from dustin/flume.py
#!/usr/bin/env python
#
# tap -> flume
#
# requires: python thrift bindings + compiled flume thrift binding.
#
import sys
import time
import struct
@pipoket
pipoket / counter.py
Created July 2, 2012 01:29 — forked from ericmoritz/counter.py
A counter stored in Riak that handles conflict resolutions on read
import logging
import riak
log = logging.getLogger(__name__)
class RiakCounter(object):
def __init__(self, bucket, key):
self.bucket = bucket
self.bucket.set_allow_multiples(True)
self.key = key
@pipoket
pipoket / udpserver.py
Created November 25, 2011 07:40
UDP server implementation for gevent. Copied from http://code.google.com/p/gevent/issues/detail?id=50
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
"""UDP/SSL server"""
import sys
import errno
import traceback
from gevent import socket
from gevent import core
from gevent.baseserver import BaseServer
@pipoket
pipoket / gethreading.py
Created November 25, 2011 07:37 — forked from serialx/gethreading.py
gevent getthreading
import gevent, gevent.event
import threading, Queue, collections, time, functools
def _threads_poller_f():
while _OsThread._threads_count:
try:
t, rv, isexc = _OsThread._threads_results.get_nowait()
except Queue.Empty:
gevent.sleep()
else: