Skip to content

Instantly share code, notes, and snippets.

View yinheli's full-sized avatar
👋
我在寻找新的工作机会,欢迎和我联系

yinheli yinheli

👋
我在寻找新的工作机会,欢迎和我联系
View GitHub Profile
@yinheli
yinheli / README.md
Created September 7, 2013 02:22 — forked from chuangbo/README.md

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"

@yinheli
yinheli / v2ex_daily.go
Last active December 2, 2019 20:49
领取 v2ex 每日奖励 golang
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strings"
)
// Copyright 2012 Junqing Tan <ivan@mysqlab.net> and The Go Authors
// Use of this source code is governed by a BSD-style
// Part of source code is from Go fcgi package
// Fix bug: Can't recive more than 1 record untill FCGI_END_REQUEST 2012-09-15
// By: wofeiwo
package fcgiclient
import (
@yinheli
yinheli / grace.go
Created February 23, 2014 05:07 — forked from rcrowley/grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
@yinheli
yinheli / update_qqwry_ip.sh
Last active August 29, 2015 13:56
定时更新 qqwry 纯真 ip 的 shell 脚本
#!/bin/bash
# update qqwry ip data
# suggest cron:
# 30 5 * * 3,5 /full_path/update_qqwry_ip.sh >> /full_path/update_qqwry_ip.log
# @author yinheli
# @update 2014-02-23
script_dir=`dirname $0`
# check unrar
@yinheli
yinheli / dnspod_ip.go
Created March 17, 2014 17:37
通过 dnspod 获取本机出口ip
package main
import (
"fmt"
"net"
"time"
)
func main() {
conn, err := net.DialTimeout("tcp", "ns1.dnspod.net:6666", time.Second*2)
@yinheli
yinheli / gist:35ae411758692a609890
Created June 5, 2014 17:55
beego orm 数据的配置文件
链接数据库 uri
username:passworkd@tcp(host:port)/dbname?charset=utf8&loc=Asia%2FShanghai
@yinheli
yinheli / ecb.go
Last active November 9, 2022 11:33
golang 标准库不支持 AES/ECB/PKCS5Padding issues: https://code.google.com/p/go/issues/detail?id=5597 别人的补丁. https://codereview.appspot.com/7860047/
package main
import (
"crypto/cipher"
)
type ecb struct {
b cipher.Block
blockSize int
}
// Package leakybuf provides leaky buffer.
// It's based on the example in Effective Go.
package main
type LeakyBuf struct {
bufSize int // size of each buffer
freeList chan []byte
}
// NewLeakyBuf creates a leaky buffer which can hold at most n buffer, each
@yinheli
yinheli / AESUtil.java
Created July 7, 2014 02:29
AES/ECB/PKCS5Padding
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
/**
* @author yinheli
*/
public class AESUtil {