This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
type Response struct { | |
url string | |
result string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
MYSQL_HOST=127.0.0.1 | |
MYSQL_PORT=3306 | |
MYSQL_ROOT_PWD=mysql123 | |
# 数据库名字默认为radius,建议不改 | |
MYSQL_RADIUS_USER=freeradius | |
MYSQL_RADIUS_PWD=freeradius123 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# 需要预先修改一下变量 | |
RADIUS_USER=your_username | |
RADIUS_PASSWORD=your_very_secure_password | |
RADIUS_NAS_PASSWORD=testing123 | |
# 安装必要的软件包, freeradius-2.1.12+dfsg-1.2ubuntu8 | |
apt-get install -y freeradius | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 需要预先修改一下变量 | |
VPN_USER=your_username | |
VPN_PASSWORD=your_very_secure_password | |
# 安装必要的程序 | |
apt-get update | |
apt-get install pptpd -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN | |
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise). | |
# With minor modifications, this script *can also be used* on dedicated servers | |
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. | |
# | |
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN | |
# YOUR AMAZON EC2 INSTANCE STARTS! | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <process.h> | |
#include <iostream> | |
void work1(void* p) | |
{ | |
while (1) { | |
printf("hello world"); | |
_sleep(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gevent | |
from gevent import monkey;monkey.patch_all() | |
import socket | |
def handle_client(csock): | |
while True: | |
data = csock.recv(1024) | |
csock.sendall(data) | |
csock.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net" | |
import "fmt" | |
import "sync" | |
import "os" | |
var wg sync.WaitGroup | |
var addr *net.TCPAddr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"bufio" | |
) | |
func handleConnection(conn net.Conn) { | |
reader := bufio.NewReader(conn) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
-- polynomial: 0x104c11db7 | |
-- 根据MSB-first的crc polynomial,生成单字节表 | |
-- http://en.wikipedia.org/wiki/Cyclic_redundancy_check | |
-- http://www.cnblogs.com/esestt/archive/2007/08/09/848856.html | |
-- 这个算法对于crc64应该也是一样的 | |
--]] | |
local polynomial = 0x04c11db7 | |
local length = 32 |