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 ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" | |
"strings" | |
) |
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
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"golang.org/x/crypto/ssh" |
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 ( | |
"flag" | |
"golang.org/x/net/websocket" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"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
// Simple groupcache example: https://github.com/golang/groupcache | |
// Running 3 instances: | |
// go run groupcache.go -addr=:8080 -pool=http://127.0.0.1:8080,http://127.0.0.1:8081,http://127.0.0.1:8082 | |
// go run groupcache.go -addr=:8081 -pool=http://127.0.0.1:8081,http://127.0.0.1:8080,http://127.0.0.1:8082 | |
// go run groupcache.go -addr=:8082 -pool=http://127.0.0.1:8082,http://127.0.0.1:8080,http://127.0.0.1:8081 | |
// Testing: | |
// curl localhost:8080/color?name=red | |
package main | |
import ( |
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
select * from hosts; | |
id | access_token_id | cluster_id | data |
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
CREATE TABLE IF NOT EXISTS hosts ( | |
id text, | |
cluster_id bigint, | |
access_token_id bigint, | |
hostname text, | |
updated bigint, | |
tags map<text, text>, | |
master_tags map<text, text>, | |
data map<text, text>, | |
lucene text, |
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
================== | |
WARNING: DATA RACE | |
Read by goroutine 55: | |
runtime.mapaccess1_faststr() | |
/usr/local/Cellar/go/1.6/libexec/src/runtime/hashmap_fast.go:193 +0x0 | |
github.com/resourced/resourced/libmap.(*TSafeMapBytes).Get() | |
/Users/didip/go/src/github.com/resourced/resourced/libmap/libmap.go:34 +0xe9 | |
github.com/resourced/resourced/queryparser.(*QueryParser).dataValue() | |
/Users/didip/go/src/github.com/resourced/resourced/queryparser/queryparser.go:108 +0x9b | |
github.com/resourced/resourced/queryparser.(*QueryParser).replaceDataPathWithValue() |
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
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination IP:80 |
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
tcpdump -e -vv -i any -n port 67 and port 68 |
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
set backspace=2 " backspace in insert mode works like normal editor | |
syntax on " syntax highlighting | |
filetype indent on " activates indenting for files | |
set autoindent " auto indenting | |
set number " line numbers | |
colorscheme desert " colorscheme desert | |
set nobackup " get rid of anoying ~file | |
set ignorecase " Ignore case when searching | |
set hlsearch " Highlight search results | |
set smartcase " When searching try to be smart about cases |
NewerOlder