Skip to content

Instantly share code, notes, and snippets.

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

yinheli yinheli

👋
我在寻找新的工作机会,欢迎和我联系
View GitHub Profile
@yinheli
yinheli / SSLPoke.java
Created December 14, 2016 03:55 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@yinheli
yinheli / SampleSM.java
Created July 31, 2014 07:27
银联mac算法, 示例
// 示例代码
class SampleSM {
...
public byte[] generateUnpayMACImpl(byte[] data, SecureDESKey kd)
throws SMException {
data = ISOUtil.concat(data, new byte[8]);
int len = data.length - data.length % 8;
if (data.length != len) {
@yinheli
yinheli / run.sh
Created March 25, 2016 17:12 — forked from andreas-marschke/run.sh
Small example LUA script for wg/wrk using a tiny JSON implementation(http://regex.info/blog/lua/json) to log test results to a file.
# Example usage with several configuration sets as in multiple connections durations and threads.
# You may go take the rest of the day off while this will run ;)
for duration in 10s 1m 10m 1h
do
for connections in 100 200 300 400 500 600
do
for thread in 1 2 3 4 5
do
wrk -d$duration -c$connections -t$thread -s wrk-script.lua http://localhost:4001/beacon/0001/demo-load-test/test/web
@yinheli
yinheli / file
Created February 25, 2016 07:42
freedom_public
{"0.15388708864338696":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEywWiPIt/xn6y9RmhhJ2u29WhuNE3mxct\r\nmBPun89q3vI2bsDDXT6yc8QBslPaE3XWXkr7N1ykXrwgjpVfAAkVBs3/AAAACDxn\r\naXRodWI+wv8AAACNBBATCAA//wAAAAWCVs6wWv8AAAACiwn/AAAACZDcNlEK8wxb\r\nef8AAAAFlQgJCgv/AAAAA5YBAv8AAAACmwP/AAAAAp4BAAA+XwD+LqIXxuH0i4Wo\r\nPstbZGTGrcvuKKqaXdd6JhCRhnO+u5wBAITxX5G9VZU6p3Pybw1y0e5h4jkieDND\r\nrT7ItECBfTbuzv8AAABWBAAAAAASCCqGSM49AwEHAgMElSBHEyqPc7+b+quUZmMN\r\nNd21FQoyt2BVfwgH7FRttkwgDg0/Rp8hv9Ym+D0qCV/7qfcZX0exkutY9eG0iXz4\r\nFQMBCAfC/wAAAG0EGBMIAB//AAAABYJWzrBa/wAAAAmQ3DZRCvMMW3n/AAAAApsM\r\nAAA49AEAydCVMjqGeAfzETbZv5dtZ+LoSQopNAYjSG5Gekc2biQA+wf6XQe8j1vt\r\n0Myv/BNzCpqHSlBUAwTicWrqKYJ+PBB7\r\n=q6fo\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"}
@yinheli
yinheli / start-ss.sh
Created February 3, 2016 07:58
本地使用 ss
#!/bin/bash
# @author yinheli
workdir=$(cd $(dirname $0); pwd)
cd $workdir
wan_ip="104.224.129.180"
wan_port="1988"
dns_port="53"
ignore_list="ignore.list"
@yinheli
yinheli / download_jdk7.sh
Last active January 7, 2016 18:43
下载 jdk 最新版本
wget --no-check-certificate \
-O server-jre-7u80-linux-x64.tar.gz \
--header "Cookie: oraclelicense=a" \
http://download.oracle.com/otn-pub/java/jdk/7u80-b15/server-jre-7u80-linux-x64.tar.gz
@yinheli
yinheli / zip_file.go
Created December 24, 2015 10:00
zip 打包文件, 向 zip 文件追加文件: 方式是创建新的, 拷贝旧的, 同时增加新的
// zip_file
package main
import (
"archive/zip"
"os"
"io"
)
func main() {
@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 / ssh_client.go
Created November 11, 2015 03:15 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@yinheli
yinheli / sshtunnel.go
Created November 11, 2015 03:06 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"