Skip to content

Instantly share code, notes, and snippets.

didip / shell_output.go
Last active Jul 21, 2020 — forked from hivefans/shell_output.go
get the realtime output for a shell command in golang|-|{"files":{"shell_output.go":{"env":"plain"}},"tag":"bigdata"}
View shell_output.go
package main
import (
didip / gist:5df46cdcf3f41b8d67cfce66afc1427c
Created Jul 5, 2020 — forked from devinodaniel/gist:8f9b8a4f31573f428f29ec0e884e6673
Generate SSH RSA Private/Public Key pair with Golang
View gist:5df46cdcf3f41b8d67cfce66afc1427c
// 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 Jul 21, 2019 — forked from bit4bit/go_example_websocket_novnc
Example: Go Websocket binary proxy noVnc
View go_example_websocket_novnc
package main
import (
didip / groupcache.go
Created Oct 9, 2018 — forked from fiorix/groupcache.go
Simple groupcache example
View groupcache.go
// 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 (
View select * from hosts
select * from hosts;
id | access_token_id | cluster_id | data
View hosts.cql
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,
View gist:bd8b49f6b18fa6ee4190
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 Nov 5, 2015
Redirect outbound traffic to another ip:port
View gist:533a3a76abba0b6404d9
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination IP:80
didip /
Created Nov 2, 2015
Monitor DHCP traffic using TCPDUMP
tcpdump -e -vv -i any -n port 67 and port 68
didip / .vimrc
Created Oct 21, 2015
Didip's minimal .vimrc
View .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