Skip to content

Instantly share code, notes, and snippets.

package main
import "net"
import "bufio"
func main() {
c,err := net.Dial("unix", "/tmp/echo.sock")
if err != nil {
panic(err.Error())
}
package main
import "net"
import "bufio"
import "time"
func echoServer(c net.Conn) {
buffrw := bufio.NewWriter(c)
for {
_, err := buffrw.WriteString("Test\n")
#!/bin/bash
set -e
function waitfor {
SEC=$1
MSG=$2
while [ $SEC -gt 0 ]; do
printf "\r$MSG $SEC \r"
sleep 1
SEC=$((SEC - 1))
@bartmeuris
bartmeuris / Dockerfile
Created December 23, 2014 15:34
Irssi Docker container
# Mount an external volume on /irssi for persistent storage
FROM ubuntu:14.04
MAINTAINER Bart Meuris
RUN apt-get update && \
apt-get -y install irssi irssi-scripts && \
useradd irssi && \
mkdir -p /home/irssi && \
chown -R irssi:irssi /home/irssi && \
### Keybase proof
I hereby claim:
* I am bartmeuris on github.
* I am bartmeuris (https://keybase.io/bartmeuris) on keybase.
* I have a public key whose fingerprint is A603 7806 2CEE E930 061B 46FB 0FA4 CF8D C34E 135C
To claim this, I am signing this object:
FROM ubuntu:14.04
MAINTAINER Bart Meuris
RUN apt-get update && \
apt-get -y install irssi irssi-scripts && \
useradd irssi && \
mkdir -p /home/irssi && \
chown -R irssi:irssi /home/irssi && \
mkdir /config && \
chown irssi:irssi /config && \
@bartmeuris
bartmeuris / gist:5955728
Last active December 19, 2015 12:29
Load JSON from a file in a Vagrant config file while defining a default structure. The file is created if it doesn't exist containing the specified default structure. No error checking is performed.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'json'
def load_json_default(filename, defaultstruct)
if File.exist?(filename)
json = File.read(filename)
data = JSON.parse(json)
else
data = defaultstruct
user@win10:~/proj$ time ./test.sh > /dev/null
real 2m17.271s
user 0m5.406s
sys 2m16.094s
user@win10:~/proj$
$ ./vsphere-influxdb-go -debug
2016/11/16 15:08:08 Starting : vsphere-influxdb-go
2016/11/16 15:08:08 connecting to vcenter: x.x.x.x
2016/11/16 15:08:08 Successfully connected to Influx
2016/11/16 15:08:08 Querying vcenter
2016/11/16 15:08:08 Setting up query inventory of vcenter: x.x.x.x
2016/11/16 15:08:08 connecting to vcenter: x.x.x.x
([]types.ManagedObjectReference) (len=40 cap=40) {
(types.ManagedObjectReference) HostSystem:host-163,
@bartmeuris
bartmeuris / ZFS-Storage-Stats.json
Created November 16, 2016 14:23
Grafana zfs storage stats dashboard
{
"__inputs": [
{
"name": "DS_TELEGRAF",
"label": "telegraf",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}