This file contains hidden or 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
@@ -0,0 +1,29 @@ | |
package main | |
import ( | |
"fmt" | |
"github.com/journeymidnight/yig-billing/helper" | |
pb "github.com/journeymidnight/yig-billing/mapreduce/proto" | |
"google.golang.org/grpc" | |
"net" | |
) |
This file contains hidden or 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 model | |
import ( | |
"database/sql/driver" | |
"encoding/json" | |
"errors" | |
) | |
type JSON []byte |
This file contains hidden or 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
drop table if exists clusters; | |
create table clusters ( | |
id varchar(64) not null default '', | |
pool varchar(16) not null default '', | |
weight int not null default 0, | |
primary key (id, pool) | |
); | |
drop table if exists buckets; | |
create table buckets ( |
This file contains hidden or 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 ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" | |
"io" |
This file contains hidden or 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
// get the original destination for the socket when redirect by linux iptables | |
// refer to https://raw.githubusercontent.com/missdeer/avege/master/src/inbound/redir/redir_iptables.go | |
// | |
const ( | |
SO_ORIGINAL_DST = 80 | |
IP6T_SO_ORIGINAL_DST = 80 | |
) | |
func getOriginalDst(clientConn *net.TCPConn) (rawaddr []byte, host string, newTCPConn *net.TCPConn, err error) { | |
if clientConn == nil { |
This file contains hidden or 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" | |
"time" | |
ma "github.com/multiformats/go-multiaddr" | |
) | |
var addrs = []string{ | |
"/ip4/127.0.0.1/tcp/4001/ipfs/QmPdJvfK74MknGSYS2E54EEzKcEY6c19D8BzcCPbW7Sjna", |
This file contains hidden or 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 ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func main() { |
This file contains hidden or 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/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"io" | |
) |
This file contains hidden or 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
================== | |
WARNING: DATA RACE | |
Read by goroutine 18: | |
github.com/funny/sync.(*monitor).diagnose() | |
/root/go/src/github.com/funny/sync/deadlock.go:95 +0x5e | |
github.com/funny/sync.(*monitor).wait() | |
/root/go/src/github.com/funny/sync/deadlock.go:89 +0x3a5 | |
github.com/funny/sync.(*RWMutex).RLock() | |
/root/go/src/github.com/funny/sync/deadlock.go:45 +0x3e | |
github.com/influxdb/influxdb/meta.(*Store).Leader() |
This file contains hidden or 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
import os | |
import sys | |
print 'pid,pgid,sid', os.getpid(), os.getpgid(0), os.getsid(0) | |
pid = os.fork() | |
if pid > 0: | |
sys.exit(0) | |
print 'pid,pgid,sid', os.getpid(), os.getpgid(0), os.getsid(0) |
NewerOlder