Skip to content

Instantly share code, notes, and snippets.

View dky's full-sized avatar
馃崪

dky

馃崪
View GitHub Profile
version: '3.7'
services:
consul-server:
image: consul:1.10.1
network_mode: host
container_name: consul
restart: always
command: 'agent -bind=192.168.4.2 -server -client=0.0.0.0 -bootstrap-expect=1 -node=nyc3-1 -ui -datacenter=nyc3'
client {
enabled = false
servers = ["127.0.0.1"]
}
server {
enabled = true
bootstrap_expect = 1
}
version: '3.7'
services:
nomad:
container_name: nomad
restart: always
image: dkyio/nomad:1.1.3
command: agent
privileged: true
network_mode: host

Keybase proof

I hereby claim:

  • I am dky on github.
  • I am dky (https://keybase.io/dky) on keybase.
  • I have a public key whose fingerprint is B263 DF44 5355 E279 8E70 E4CC 10A4 6019 A1E5 C18C

To claim this, I am signing this object:

@dky
dky / main.go
Created January 16, 2018 13:43 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@dky
dky / install_splunk.sh
Created May 19, 2016 14:39 — forked from stamler/install_splunk.sh
Install Splunk Enterprise 6.2 on CentOS 7 Minimal as a non-root user systemd service and enable syslog on port 514 and http on port 80
#!/bin/bash
# Install Splunk 6.2 on CentOS 7 as a non-root user service that runs on boot with
# systemd. This script also opens the firewall to allow syslog on UDP port 514. Since
# we're running Splunk as non-root, this port is then forwarded to 5514. Configuring a
# syslog input in slunk on UDP 514 will gather this data. Must be run as root
# Create Account
useradd splunk
groupadd splunk
@dky
dky / gist:fd04b0a11b5ecfb85228
Last active August 29, 2015 14:23
Install brew with python and lua
brew install vim --with-lua
@dky
dky / gist:82a00acc0da5809c7b6e
Created June 8, 2015 19:25
check docker containers
#!/bin/bash
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a docker host if all container are running.
# OK - running
# UNKNOWN - Container has non-zero exit code
CONTAINERS=`docker ps | awk '{if (NR!=1) {print}}' | perl -ne '@cols = split /\s{2,}/, $_; printf "%30s %20s %20s\n", $cols[5]'`
#!/bin/bash
# Author: Erik Kristensen
# Email: [email protected]
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@dky
dky / gist:c3d9fe6639410df87017
Created February 4, 2015 16:17
Session cookie php
<?php
header('Content-Type: text/plain');
session_start();
if(!isset($_SESSION['visit']))
{
echo "This is the first time you're visiting this server";
$_SESSION['visit'] = 0;
}
else
echo "Your number of visits: ".$_SESSION['visit'];