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" | |
"os" | |
) | |
func IncorrectCloseFile(json_data []byte) { | |
//create json file | |
json_file, err := os.Create("sample.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
package main | |
import ( | |
"errors" | |
"fmt" | |
"time" | |
) | |
func main() { | |
check(extractTime(nil)) |
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
packet main | |
import "fmt" | |
func HexPacket(raw []byte) { | |
idx := 0 | |
for ; idx < len(raw)-16; idx += 16 { | |
fmt.Printf("%04X: ", idx) | |
for i := 0; i < 16; i++ { | |
fmt.Printf("%02X ", raw[idx+i]) |
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
apiVersion: networking.istio.io/v1alpha3 | |
kind: DestinationRule | |
metadata: | |
name: some_microservice | |
spec: | |
host: some_microservice_host | |
trafficPolicy: | |
connectionPool: | |
tcp: | |
maxConnections: 10 |
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
/* | |
how to build (based on docker image golang:1.10): | |
$ apt-get update -qq && \ | |
apt-get install -y pkg-config libpcap-dev curl cmake patch git libnuma-dev linux-source-4.9 libzmq3-dev unzip clang llvm libelf-dev && \ | |
apt-get install -y --no-install-recommends bsdtar | |
# Prepare kernel and compile/install netmap/dpdk | |
$ cd /usr/src && \ | |
bsdtar xJf linux-source-4.9.tar.xz && \ |
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
/* | |
$ ./chanBench | |
Use Channel | |
Use Channel runs 1014856858 in 5 seconds, average 202971371 calls/s | |
Use Atomic | |
Use Channel runs 16146198617 in 5 seconds, average 3229239723 calls/s | |
*/ | |
package 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 main | |
import ( | |
"fmt" | |
) | |
type Small interface { | |
Foo(int) int | |
} |
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
#!/bin/bash | |
# ssh -i <ssh_key> azureuser@<acs_fqdn> bash install-omsagent.sh -w <oms_wid> -s <oms_sharedkey> -ssh=</path/to/ssh-key-file> | |
while [[ $# -gt 0 ]]; do | |
key="$1" | |
case "$key" in | |
-w) | |
OMS_WORKSPACE="$2" | |
shift | |
;; |
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" | |
) | |
type NameFn func() string | |
func delegate(name string) func() string { | |
return func() string { |
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" | |
"reflect" | |
) | |
type Docs struct { | |
Github string | |
Linkedin string |
NewerOlder