Skip to content

Instantly share code, notes, and snippets.

View evangwt's full-sized avatar
🎯
Focusing

evangwt

🎯
Focusing
View GitHub Profile
@evangwt
evangwt / notifyAddrChange.go
Created January 16, 2021 09:39 — forked from KatelynHaworth/notifyAddrChange.go
A simple go program leveraging the Window API to listen for IPv4 network address change events
package main
import (
"log"
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
@evangwt
evangwt / ddns.go
Created January 12, 2021 02:08 — forked from wendal/ddns.go
golang的dns缓存, 含流量统计
package ddns
import (
"log"
"net"
"sync"
)
var (
dnsLock = &sync.Mutex{}
@evangwt
evangwt / eval-hello.sh
Created March 31, 2019 14:07 — forked from bpo/eval-hello.sh
Redis Lua examples
redis-cli EVAL "$(cat hello.lua)" 0
@evangwt
evangwt / example.php
Created January 21, 2016 07:04 — forked from dimzon/example.php
Persisting PHP sessions into mongodb (allows NLB without affinity)
<?php
// all default values
MongoSessionPersistence::create()
->connect()
->register();
// connect to concrete server/db
MongoSessionPersistence::create()
->connect('mongodb://mongo_server:27017', 'databaseName')
->useLifeTime(60*60) // lifetime=1 hour
#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A