Skip to content

Instantly share code, notes, and snippets.

@lenew
lenew / shadowsocks-http-proxy.go
Last active July 6, 2017 07:00
shadowsocks-go http proxy
//a simple go shadowsocks http proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"net/http"
"os"
@lenew
lenew / dh.c
Created March 29, 2017 05:50 — forked from cloudwu/dh.c
Diffie-Hellman Key Exchange
// The biggest 64bit prime
#define P 0xffffffffffffffc5ull
#define G 5
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
// calc a * b % p , avoid 64bit overflow
package main
import (
"flag"
"fmt"
"github.com/miekg/dns"
"os"
)
var (
@lenew
lenew / install-redis.sh
Created March 22, 2016 06:24 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)