Skip to content

Instantly share code, notes, and snippets.

@dikkini
dikkini / unixhttpc.go
Created Dec 17, 2020 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
View unixhttpc.go
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@dikkini
dikkini / Huawei_E3372_openwrt.md
Created Aug 8, 2020 — forked from bjoern-r/Huawei_E3372_openwrt.md
How to use a Huawei E3372 on OpenWRT
View Huawei_E3372_openwrt.md

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
@dikkini
dikkini / connection_factory.py
Created Oct 18, 2017 — forked from danielrichman/connection_factory.py
nicer postgres connection class & flask postgres
View connection_factory.py
class PostgreSQLConnection(psycopg2.extensions.connection):
"""
A custom `connection_factory` for :func:`psycopg2.connect`.
This
* puts the connection into unicode mode (for text)
* modifies the :meth:`cursor` method of a :class:`psycopg2.connection`,
facilitating easy acquiring of cursors made from
:cls:`psycopg2.extras.RealDictCursor`.
"""
@dikkini
dikkini / boot.js
Created Nov 9, 2015 — forked from jdxcode/boot.js
zero-downtime node.js app runner
View boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run