Skip to content

Instantly share code, notes, and snippets.

@lintianzhi
lintianzhi / encrypt.go
Created August 15, 2014 02:43
gpg encript
package main
import (
// "bytes"
"code.google.com/p/go.crypto/openpgp"
"github.com/qiniu/log"
"io/ioutil"
"os"
)
@lintianzhi
lintianzhi / xx
Created July 23, 2014 02:33
no image log
10073 ~/tmp » curl -v -o /dev/null -H "Host: mxycforum.u.qiniudn.com" http://iovip.qbox.me/2014-07-22-af9ef033c73595ca9b260326fa19c6b6\?imageMogr/v2/auto-orient/thumbnail/750/ccffff
* Adding handle: conn: 0x7fe142804600
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fe142804600) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to iovip.qbox.me port 80 (#0)
* Trying 183.136.139.17...
@lintianzhi
lintianzhi / noreq
Last active August 29, 2015 14:04
no X-* header
10012 ~/tmp » curl -v -o /dev/null http://mxycforum.u.qiniudn.com/2014-07-22-af9ef033c73595ca9b260326fa19c6b6\?imageMogr/v2/auto-orient/thumbnail/750/c
* Adding handle: conn: 0x7fe101004600
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fe101004600) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to mxycforum.u.qiniudn.com port 80 (#0)
* Trying 180.153.176.136...
@lintianzhi
lintianzhi / MPChannel_api.md
Last active August 29, 2015 14:03
MPChannel_api
POST /givememp
Content-Type: application/json

{"id": "my_id", "phone": 2345, "longtitude": "123.1123", "latitude", "323.231"}

200 OK
Content-Type: application/json

{"results": [...]}
@lintianzhi
lintianzhi / itbl.go
Last active August 29, 2015 14:01
itbl
//http://play.golang.org/p/nRZP1YHQaB
package main
import "fmt"
import "strconv"
func main() {
fmt.Println("Hello, playground")
itbl := 435746972
package main
import (
"runtime/debug"
"time"
)
func main() {
m := int64(1024*1024) * 100
package main
import (
"fmt"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")
package main
import (
"fmt"
"math/rand"
"strings"
"time"
)
var (
@lintianzhi
lintianzhi / av.md
Last active August 29, 2015 13:56
参考

七牛转码引导

在七牛上面使用转码功能,我们根据客户的实际场景提供了一些转码的建议。

转码的容器

  1. mp4
    • mp4 容器的兼容性在所有的浏览器,移动设备里面是最好的
    • 默认使用H.264视频编码器,acc音频编码器
  2. webm
func SetTimeout(client *Client, t int) (err error) {
timeout := time.Duration(t) * time.Second
dialTimeout := func(network, addr string) (net.Conn, error) {
return net.DialTimeout(network, addr, timeout)
}
if client.Transport == nil {
client.Transport = &http.Transport{
Dial: dialTimeout,