Skip to content

Instantly share code, notes, and snippets.

View athurg's full-sized avatar
🐵

Athurg Gooth athurg

🐵
View GitHub Profile
@athurg
athurg / gist:802494
Created January 30, 2011 03:30
eth0 configure
eth0 Link encap:Ethernet HWaddr 00:24:1D:B6:5B:8B
inet6 addr: fe80::224:1dff:feb6:5b8b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:140048 errors:0 dropped:0 overruns:0 frame:0
TX packets:64283 errors:0 dropped:0 overruns:0 carrier:5
collisions:0 txqueuelen:1000
RX bytes:81735052 (77.9 Mb) TX bytes:7832158 (7.4 Mb)
Interrupt:42
@athurg
athurg / dbm.c
Created March 25, 2011 05:07
a example code for gdbm using
/* db_add.c: storing
written by rock <[email protected]>, 1999.11.29
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gdbm.h>
#define datum_set(um, buf) { um.dptr = buf; um.dsize = strlen(buf); }
@athurg
athurg / js_enter_detect.html
Created October 20, 2011 13:59
用于检测回车键的Javascript代码
<script>
function cb(obj)
{
var div;
div = document.getElementById("adiv");
div.innerHTML=obj.name+" enter :";
if (event.keyCode==13)
div.innerHTML+="Return";
else
div.innerHTML+=event.keyCode;
@athurg
athurg / vswr.py
Created December 25, 2011 11:30
vswr and rp traslate
## fileencoding=gbk ##
from math import *
import sys
def vswr_to_rp(vswr):
'''Translate VSWR to Return Power'''
rl=20*log10((vswr+1)/(vswr-1))
rp=pout/pow(10,rl/10)
return rp
<?php
namespace Enveesoft\Utils;
class Alipay
{
public static function notifyVerify($partner, $notify_id)
{
$uri = 'https://mapi.alipay.com/gateway.do?service=notify_verify';
$uri .= '&partner='.$partner;
<?php
header('Content-Type:text/html; charset=utf-8');
if (!isset($_GET['email']) || !isset($_GET['password'])) {
echo 'Need Params!';
die();
}
echo <<<EOF
<form>
Email:<input name='email' value='{$_GET['email']}' />
<?php
date_default_timezone_set('Asia/Chongqing');
if ($argc==1) {
echo "Use default file name /var/log/secure\n";
$fname = array('/var/log/secure');
} else {
$fname = (array_slice($argv,1));
}
getpwnam SELECT login_name,'x',user_id+'10000',user_id+'10000','Joe User',CONCAT('/home/',login_name),'/bin/aspshell' \
FROM user \
WHERE login_name='%1$s' \
LIMIT 1
getpwuid SELECT login_name,'x',user_id+'10000',user_id+'10000','Joe User',CONCAT('/home/',login_name),'/bin/aspshell' \
FROM user \
WHERE user_id='%1$u'-10000 \
LIMIT 1
getspnam SELECT login_name,password,'','','','','','','' \
FROM user \
@athurg
athurg / WXRDecoder.php
Last active December 19, 2015 12:39
用于解析Wordpress导出的WXR格式的工具。可输出为PHP数组或者SQL语句。
<?php
class WXRDecoder
{
protected $_parser;
protected $_ns;
public $posts=array();
public $tags=array();
public $post_table = 'tbl_posts';
threads = []
status=[]
30.times {|i| status[i]=false}
chars=['-', "\\", '|', '/', '-', "\\", '|', '/']
puts ''
inprocess=true
threads << Thread.new do
while inprocess
chars.each do |char|