Skip to content

Instantly share code, notes, and snippets.

@border
border / Makefile
Created January 9, 2014 10:33
md5 by openssl
gcc -std=gnu99 -o sslmd5 sslmd5.c -I/home/work/public/third-64/openssl/include -L/home/work/public/third-64/openssl/include -lcrypto
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char** tokenize(const char* input)
{
printf("%s\n", input);
char* str = strdup(input);
int count = 0;
int capacity = 10;
@border
border / mahonia-gbk.diff
Created December 9, 2013 14:44
mahonia 默认没有支持GB2312编码, 但是支持GBK, 由于GBK编码完全兼容GB2312, 自己在GBK的代码里面注册一个GB2312就可以完美支持了. https://code.google.com/p/mahonia
~GOPATH/src/code.google.com/p/mahonia hg diff
diff -r 420ce60cb671 gbk.go
--- a/gbk.go Fri Jul 19 13:15:30 2013 -0700
+++ b/gbk.go Mon Dec 09 22:27:42 2013 +0800
@@ -12,6 +12,15 @@
return encodeGBKRune
},
})
+ RegisterCharset(&Charset{
+ Name: "GB2312",
@border
border / gocookies.go
Created December 7, 2013 07:27
go cookiejar demo
package main
import (
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
)
var gCurCookies []*http.Cookie
@border
border / homeinns.go
Last active December 29, 2015 18:09
homeinns 2000w by golang + mongo
package main
import (
"bufio"
"bytes"
"io"
"os"
"strings"
"time"
commit 8eed215edb5f1cd086e185d09c1b771015193ccc
Author: Jiang Bian <borderj@gmail.com>
Date: Wed Nov 20 19:21:52 2013 +0800
Zxing Camera in Portrait mode
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index db60cba..11a4cc8 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@border
border / dev.sh
Last active January 18, 2018 03:39
- 贵厂的 ssh 自动登录脚本 dev.sh - smb auto mount scipt for mac: mount.sh
#!/usr/bin/expect
#
# Auto Login script Relay And Dev Server For XXX
#
set tokenprepass "Token PIN"
set relayhost "OOXX@xxx.com"
set server "OOXX@SERVER_HOST"
set password "HOST_PASSWD"
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
@border
border / geturl.sh
Last active December 28, 2015 10:08
通过grep获取网页的URL信息
cat citylist.txt| grep -o -E 'href="([^"#]+)"' | cut -d '"' -f2 | sort | uniq
cat citylist.txt| grep -o -E 'http://([a-z]+).XXX.com' | sort | uniq
@border
border / macwifi.sh
Created November 5, 2013 14:01
mac mavericks 10.9 wifi program
~ cat bin/macwifi.sh
#!/bin/bash
while true
do
ifconfig en1 down
sleep 2
ifconfig en1 up
sleep 120
done