Skip to content

Instantly share code, notes, and snippets.

didip / shell_output.go
Last active July 21, 2020 05:01 — forked from hivefans/shell_output.go
get the realtime output for a shell command in golang|-|{"files":{"shell_output.go":{"env":"plain"}},"tag":"bigdata"}
package main
import (
didip / gist:5df46cdcf3f41b8d67cfce66afc1427c
Created July 5, 2020 04:32 — forked from devinodaniel/gist:8f9b8a4f31573f428f29ec0e884e6673
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
didip / go_example_websocket_novnc
Created July 21, 2019 19:12 — forked from bit4bit/go_example_websocket_novnc
Example: Go Websocket binary proxy noVnc
package main
import (
didip / groupcache.go
Created October 9, 2018 20:58 — forked from fiorix/groupcache.go
Simple groupcache example
// Simple groupcache example:
// Running 3 instances:
// go run groupcache.go -addr=:8080 -pool=,,
// go run groupcache.go -addr=:8081 -pool=,,
// go run groupcache.go -addr=:8082 -pool=,,
// Testing:
// curl localhost:8080/color?name=red
package main
import (
select * from hosts;
id | access_token_id | cluster_id | data
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,
didip / gist:bd8b49f6b18fa6ee4190
Created March 14, 2016 00:40
go run -race trace
Read by goroutine 55:
/usr/local/Cellar/go/1.6/libexec/src/runtime/hashmap_fast.go:193 +0x0*TSafeMapBytes).Get()
/Users/didip/go/src/ +0xe9*QueryParser).dataValue()
/Users/didip/go/src/ +0x9b*QueryParser).replaceDataPathWithValue()
didip / gist:533a3a76abba0b6404d9
Created November 5, 2015 17:23
Redirect outbound traffic to another ip:port
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination IP:80
didip /
Created November 2, 2015 18:58
Monitor DHCP traffic using TCPDUMP
tcpdump -e -vv -i any -n port 67 and port 68
didip / .vimrc
Created October 21, 2015 06:05
Didip's minimal .vimrc
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