Skip to content

Instantly share code, notes, and snippets.

@lenew
lenew / socks5.go
Last active November 1, 2022 04:11
Transparent socks5 server with route mark
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
"syscall"
@lenew
lenew / AppleIAPVerifyServer.go
Last active March 17, 2018 18:19
Apple IAP Receipt Extract Tool
/*
* A Http Server to verify an Apple IAP Receipt
* Return with Receipts data
* Usage Example: curl -X POST http://127.0.0.1:5000/verifyReceipt -d '{"receipt-data":"apple receipt base64 data"}'
*/
package main
import (
"crypto/rsa"
"crypto/x509"
//**********************************************************************************
//
//OpenSSLKey
// .NET 2.0 OpenSSL Public & Private Key Parser
//
// Copyright (C) 2008 JavaScience Consulting
//
//***********************************************************************************
//
// opensslkey.cs
@lenew
lenew / go2proxy.go
Last active November 1, 2017 06:14
go2proxy
/**
* simple tcp proxy with timeout failover
* thanks to:
* https://github.com/xtaci/kcptun
* https://github.com/jpillora/go-tcp-proxy
*/
package main
import (
"flag"
//simple tool can forward a 'listen:port' to 'forward:port' though a 'socks5://server:port'
//usage socks5-forward listen:port forward:port socksurl
package main
import (
"io"
"log"
"net"
"os"
"net/url"
@lenew
lenew / tun-ping-linux.py
Created September 29, 2017 16:35 — forked from glacjay/tun-ping-linux.py
Reading/writing Linux's TUN/TAP device using Python.
import fcntl
import os
import struct
import subprocess
# Some constants used to ioctl the device file. I got them by a simple C
# program.
TUNSETIFF = 0x400454ca
TUNSETOWNER = TUNSETIFF + 2
@lenew
lenew / CreateValidateJWT.cs
Created September 21, 2017 10:46 — forked from bschapendonk/CreateValidateJWT.cs
How to create and validate a JWT using System.IdentityModel.Tokens.Jwt
using System;
using System.IdentityModel.Tokens;
using System.Security.Claims;
using System.Security.Cryptography;
namespace CreateValidateJWT
{
class Program
{
static void Main(string[] args)
*.cn
.163.com
.126.net
.csdn.net
.jd.com
.alicdn.com
.tanx.com
.mmstat.com
.360buy.com
.360buyimg.com
@lenew
lenew / Makefile
Created August 13, 2017 08:31
realtek r8168 driver module for OpenWRT or LEDE
#Download realtek r8168 linux driver from official site [http://www.realtek.com/downloads/downloadsView.aspx?PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3]
#Unpack source file
#Replace orginal Makefile with this file
#Put this source to 'package' folder of OpenWRT/LEDE SDK
#Build(make menuconfig, make defconfig, make)
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=r8168
using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Text;
namespace JwtTest
{
class Program
{
static void Main(string[] args)