This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew cleanup | |
brew remove mcrypt | |
rm /usr/local/etc/php/5.3/conf.d/ext-mcrypt.ini | |
brew install mcrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.config/upstart/shadowsocks-local.conf | |
description "ShadowSocks Local Service" | |
author "Larry Li <[email protected]>" | |
# start/stop/restart/status shadowsocks-local | |
start on starting xsession-init | |
exec ~/bin/shadowsocks-local -c=~/bin/config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go build -ldflags "-s -w" -o index.cgi cgi.go | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/cgi" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GOARCH=arm GOOS=linux GOCHAR=5 go build -ldflags "-s -w" -o github-webhook-pull.cgi github-webhook-pull.go | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"net/http/cgi" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"errors" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rsa-pkcs [-hash sha1] [-key id_rsa] -sign "foobar" | |
// rsa-pkcs [-hash sha1] [-pub id_rsa.pub] -verify "sign_data" "foobar" | |
package main | |
import ( | |
_ "code.google.com/p/go.crypto/md4" | |
_ "code.google.com/p/go.crypto/ripemd160" | |
"crypto" | |
_ "crypto/md5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// echo {"a":"b"} | go run json-fmt.go [-prefix ""] [-indent " "] | |
// go run json-fmt.go [-prefix ""] [-indent " "] {\"a\":\"b\"} | |
// go run json-fmt.go [-prefix ""] [-indent " "] -file data.json | |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
. "gist.github.com/9521299.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
. "gist.github.com/9521299.git" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package offers a function that die err message if err not nil. | |
// | |
// import . "gist.github.com/9521299.git" | |
// Die(err, something...) | |
// | |
package gist9521299 | |
import ( | |
"fmt" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
. "gist.github.com/9521299.git" | |
"github.com/kr/beanstalk" | |
"time" | |
) | |
func main() { |
OlderNewer