This file contains 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
cd /root |
This file contains 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
def getimg(self): | |
imgurl = request.args.get('imgurl','') | |
if len(imgurl) == 0: | |
return '<form action="/twip/getimg" method="get"><input type="text" size="50" name="imgurl" /> <input type="submit" value="submit" />' | |
urlobj = urllib2.urlopen(imgurl) | |
header = urlobj.info() | |
headers = {} | |
headers['Content-Type'] = header.get('Content-Type','image/png') | |
content = urlobj.read() | |
status = urlobj.getcode() |
This file contains 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
#/usr/bin/python | |
#coding: utf-8 | |
global_ip_dict = [[[] for col in range(256)] for row in range(256)] | |
#input:apnic|CN|ipv4|112.0.0.0|4194304|20081215|allocated | |
#output:addr1,addr2,addr3,addr4,ip_num | |
def analyseLine(ip_line): | |
ip_str_list = ip_line.split('|') | |
if len(ip_str_list) < 7: |
This file contains 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 | |
if [ ! -e /tmp/dnsip.txt ] ; then | |
ping mydomain.f3322.org -c1 | grep PING | awk '{ print $3 }' | sed 's/[()]//g' > /tmp/dnsip.txt | |
fi | |
mydnsip=$(head -1 /tmp/dnsip.txt) | |
curl -s http://icanhazip.com > /tmp/ip.txt | |
myip=$(head -1 /tmp/ip.txt) |
This file contains 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
# Title: base64 encode content | |
# Author: xixitalk http://xixitalk.github.io | |
# Description: base64 encode twice and decode at browser with javascript | |
# | |
# Syntax: | |
# {% base64_block %} | |
# This text will be encoded twice with base64 | |
# {% endbase64_block %} | |
# | |
# Output: |
This file contains 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
global | |
ulimit-n 51200 | |
defaults | |
log global | |
mode tcp | |
option dontlognull | |
balance roundrobin | |
option persist | |
timeout connect 10000 | |
timeout client 150000 |
This file contains 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
[peername] | |
proto = nacltai | |
proto_publickey = LOCAL_PUBKEY | |
proto_privatekey = REMOTE_PRIKEY | |
local = tuntap | |
local_interface = tunnel | |
local_tunmode = 1 | |
peer = udp | |
peer_localaddr = REMOTE_IP | |
peer_localport = 8000 |
This file contains 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
SINT32 txsem_count_init(Semaphore *ptxSem) | |
{ | |
UINT32 i = 0; | |
UINT32 semCount = 0; | |
UINT32 Count = 0; | |
semCount = GetSemaphoreCount(ptxSem); | |
Count = SEM_INIT_NUM - semCount; | |
if (Count > 0) |
This file contains 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
#define BEGIN_MAGIC 0x3a3a3a3a | |
#define END_MAGIC 0x5a5a5a5a | |
void *mymalloc(unsigned int size) | |
{ | |
char *ptr = (char *)malloc(size+12); | |
unsigned int *ptmp = NULL; | |
if(NULL == ptr) | |
return NULL; |
This file contains 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
#define STACK_FIND_SIZE 2048 //find from SP to SP+STACK_FIND_SIZE | |
void funcStackCheck(unsigned long *psp, unsigned long lr) | |
{ | |
if(psp && (*psp != lr)) | |
{ | |
assert(0); | |
} | |
} |
OlderNewer