Skip to content

Instantly share code, notes, and snippets.

@davemac30
davemac30 / Dockerfile
Last active March 4, 2016 11:26
demonstrate broken tcp server output behaviour in logstash 2.2
# demonstrate broken tcp server output behaviour in logstash 2.2
#
FROM docker.io/oracle/openjdk
RUN echo -e '[logstash-2.2]\nname=Logstash repository for 2.2.x packages\nbaseurl=http://packages.elastic.co/logstash/2.2/centos\ngpgcheck=0\nenabled=1' > /etc/yum.repos.d/logstash.repo
RUN yum -y install logstash
RUN echo 'output { tcp { port => 1444 host => "0.0.0.0" mode => server } }' > /etc/logstash/conf.d/output_tcp.conf
CMD /opt/logstash/bin/logstash -f /etc/logstash/conf.d
@davemac30
davemac30 / cap_test.c
Created November 2, 2016 16:29
Playing about with Linux capabilities
/* largely taken from the sample code in cap_set_proc(3) */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/capability.h>
#define BUF_LEN 0x10000
char buf[BUF_LEN];
2018/03/13 17:10:03 [INFO] Terraform version: 0.11.3
2018/03/13 17:10:03 [INFO] Go runtime version: go1.9.3
2018/03/13 17:10:03 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.3/bin/terraform", "apply", "-auto-approve"}
2018/03/13 17:10:03 [DEBUG] Attempting to open CLI config file: /Users/xxxx.xxxx/.terraformrc
2018/03/13 17:10:03 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/03/13 17:10:03 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2018/03/13 17:10:03 [INFO] command: empty terraform config, returning nil
2018/03/13 17:10:03 [DEBUG] command: no data state file found for backend config
2018/03/13 17:10:03 [DEBUG] New state was assigned lineage "e0c78146-3d08-43e5-b99e-f838da7bd1e4"
2018/03/13 17:10:03 [INFO] command: backend initialized: <nil>

Keybase proof

I hereby claim:

  • I am davemac30 on github.
  • I am davemac31 (https://keybase.io/davemac31) on keybase.
  • I have a public key ASD-bNwjtaAQG_ckFwOV6l6iOMOsN3fpJ_B2pJIyaQmC8go

To claim this, I am signing this object:

/* example arduino/neopixel code
* (see https://github.com/adafruit/Adafruit_NeoPixel/tree/master/examples for more)
*/
#include <Adafruit_NeoPixel.h>
#define PIXEL_PIN 6
#define PIXEL_COUNT 50
This is a Gist
Cool, huh?
package main
import (
"fmt"
)
func isPrime(n int) bool {
if n <= 1 {
return false
}