Skip to content

Instantly share code, notes, and snippets.

@krishnasrinivas
krishnasrinivas / 0_reuse_code.js
Created July 9, 2014 14:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import (
"os"
"syscall"
"unsafe"
)
// data from kernel headers
const (
DT_UNKNOWN = 0
func treeWalk(fsPath, bucket, prefix, marker string, recursive bool, send func) bool {
markerEntry := ""
markerRemaining := ""
markerSplit := []string{}
@krishnasrinivas
krishnasrinivas / libchan-server.go
Created April 5, 2016 14:06
libchan server streams a file
package main
import (
"io"
"log"
"net"
"os"
"github.com/docker/libchan/spdy"
)
@krishnasrinivas
krishnasrinivas / libchan-client.go
Created April 5, 2016 14:07
libchan client - streams to Stdout from remote server
package main
import (
"io"
"log"
"net"
"os"
"time"
"github.com/docker/libchan/spdy"
@krishnasrinivas
krishnasrinivas / remove-all.go
Created April 11, 2016 14:58
remove objects recursively
package main
import (
"fmt"
"log"
"github.com/minio/minio-go"
iptables -t nat -I PREROUTING --src 0/0 --dst 192.168.1.100 -p tcp --dport 80 -j REDIRECT --to-ports 9000
package main
import (
"fmt"
)
type ex struct {}
func (e ex) Error() string {return "wow"}
package main
import (
"fmt"
"log"
"os"
"path"
"runtime"
"strings"
"syscall"