Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
What's happening?

Sajal Kayan sajal

💭
What's happening?
View GitHub Profile
View rbdinfo.go
package main
import (
"log"
"github.com/ceph/go-ceph/rados"
"github.com/ceph/go-ceph/rbd"
)
func main() {
View pilse-5.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net"
"net/http"
"net/http/httptest"
View buggy-also.go
package main
import (
"sync"
"time"
)
// cache allows manipulating cached data.
type cache struct {
// Concurrent access control to maps
View cnc crash
Dec 8 09:56:00 pulse cnc[3886]: 2016/12/08 09:56:00 warning: libgeoip lookup failed for ip '10.1.9.1'
Dec 8 09:56:00 pulse cnc[3886]: 2016/12/08 09:56:00 warning: libgeoip lookup failed for ip '192.168.2.254'
Dec 8 09:56:00 pulse cnc[3886]: 2016/12/08 09:56:00 warning: libgeoip lookup failed for ip '192.168.1.1'
Dec 8 09:56:00 pulse cnc[3886]: 2016/12/08 09:56:00 warning: libgeoip lookup failed for ip '10.0.1.254'
Dec 8 09:56:00 pulse cnc[3886]: 2016/12/08 09:56:00 (geoipdb) cache miss for 58.221.26.69
Dec 8 09:56:00 pulse cnc[3886]: fatal error: 2016/12/08 09:56:00 (geoipdb) cache miss for 217.170.0.244
Dec 8 09:56:00 pulse cnc[3886]: concurrent map writes
Dec 8 09:56:00 pulse cnc[3886]: goroutine 1936 [running]:
Dec 8 09:56:00 pulse cnc[3886]: runtime.throw(0x8b944e, 0x15)
Dec 8 09:56:00 pulse cnc[3886]: #011/usr/local/go/src/runtime/panic.go:566 +0x95 fp=0xc4209e1b08 sp=0xc4209e1ae8
@sajal
sajal / 16808.go
Created Sep 16, 2016
reproduction for Go issue #16808
View 16808.go
package main
import (
"log"
"net"
"net/http"
"os"
"os/exec"
"strconv"
"time"
View keybase.md

Keybase proof

I hereby claim:

  • I am sajal on github.
  • I am sajal (https://keybase.io/sajal) on keybase.
  • I have a public key whose fingerprint is A668 BBFE 438C BEDA 7BB6 3925 3964 90AC BF15 828F

To claim this, I am signing this object:

@sajal
sajal / README.md
Created Mar 27, 2015
Web browser example for RIPE ATLAS DNS
View README.md

First run

npm install -g browserify
npm install -g native-dns-packet
browserify main.js > bundle.js
@sajal
sajal / ripe_abuf.js
Created Mar 27, 2015
Node.js example for RIPE ATLAS DNS result
View ripe_abuf.js
var Packet = require('native-dns-packet');
var buf = new Buffer("f2+AgAABAAEAAAAAA3d3dwRyaXBlA25ldAAAAQABwAwAAQABAAA3+gAEwQAGiw==", 'base64');
var p = Packet.parse(buf)
console.log(p)
@sajal
sajal / ripe_abuf.go
Created Mar 27, 2015
Decode RIPE ATLAS DNS results.
View ripe_abuf.go
package main
import (
"encoding/base64"
"fmt"
"github.com/miekg/dns"
)
func main() {
//Decode base64 to binary
@sajal
sajal / .config
Created Feb 25, 2015
gccgo on WT1520
View .config
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_ppc40x is not set
# CONFIG_TARGET_realview is not set
# CONFIG_TARGET_arm64 is not set
# CONFIG_TARGET_sunxi is not set