Skip to content

Instantly share code, notes, and snippets.

@geekdadley
geekdadley / crawl.py
Created July 29, 2018 10:11
如何批量从letpub.com.cn上查询期刊的影响因子、分区等信息
from __future__ import print_function
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import bs4
import sys
# https://www.peterbe.com/plog/best-practice-with-retries-with-requests
def requests_retry_session(
retries=3,
backoff_factor=0.3,
@geekdadley
geekdadley / test_oraclize.sol
Created July 22, 2018 16:40
encrypted oraclize calling
pragma solidity ^0.4.18;
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
import "github.com/Arachnid/solidity-stringutils/strings.sol";
contract TestRoll is usingOraclize {
using strings for *;
string public lastresult;
string public lasturl;
function playerRollDice() public
{
@geekdadley
geekdadley / smuggling.js
Last active March 1, 2017 16:34
中行偷渡的油猴脚本
// ==UserScript==
// @name 中行偷渡
// @namespace http://tampermonkey.net/
// @version 0.2
// @description 自行阅读、自行修改、后果自负
// @author duduzhu
// @match https://apply.mcard.boc.cn/*
// @grant none
// ==/UserScript==
//2017.3.1 使用方法 随便点一个什么普通卡开始申请,无论页面出现什么空白,都继续下一步即可
@geekdadley
geekdadley / aliyuntunnel
Last active August 29, 2015 14:00
Service config of auto start a ssh tunnel
#!/bin/sh
# chkconfig: 2345 20 80
# description: auto build ssh tunnel towards aliyun.wangnan.me
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
@geekdadley
geekdadley / windows_uuid
Created February 15, 2014 03:28
运行Windows的电脑上获得唯一ID
wmic
csproduct list full
diskdrive get serialnumber, mediatype, model
diskdrive get signature, mediatype, model (winxp)
@geekdadley
geekdadley / 报菜名
Last active February 23, 2021 13:12
马志明 报菜名 贯口 文本
【贯口部分:空格为词语间隔,逗号为停顿,句号为大气口且带重音,具体请参考视频音频】
甲:哎,您是,说相声的吧。
乙:没错。
甲:看着你可有点儿面熟。
乙:认识我?
@geekdadley
geekdadley / catch.pl
Created January 21, 2014 13:03
摘取文本log中形如表格的两组对应数字
use strict;
while(<>)
{
if($_ =~ m/\|.*?(\d*) \|.*\|.*?(\d*) \|/)
{
if($1 or $2)
{
print("$1 $2\n");
}
}
@geekdadley
geekdadley / download_youku
Last active December 27, 2015 08:59
Use flvcd to automatically download youku page in a batch.
#!/usr/bin/perl
# download flv pieces and put them at current dir with name as 01,02,03,etc.
# So less than 100 pieces are expected
use strict;
if(@ARGV != 1)
{
print "download_youku <URL>\n";
exit 1;
}
@geekdadley
geekdadley / AutoDialPPPoE.vbs
Last active December 24, 2015 23:48
Windows pppoe 自动拨号上网
CreateObject("WScript.Shell").run"Rasdial 宽带连接 0355czad01042342 654321",0
@geekdadley
geekdadley / 301.Redirect
Created September 18, 2013 17:14
to redirect to another site with 301 response
RewriteEngine on
RewriteRule ^(.*)$ http://www.wangnan.me/$1 [R=301,L]