Skip to content

Instantly share code, notes, and snippets.

View angrycub's full-sized avatar

Charlie Voiselle angrycub

View GitHub Profile
@angrycub
angrycub / docker.md
Created October 15, 2020 23:47
Enabling pre-Nomad 0.12 Docker mount behavior for dev agents

Create a configuration file and a sample job.

docker.hcl

plugin "docker" { 
  config {
     volumes {
       enabled = true
     } 
@angrycub
angrycub / example.nomad
Created October 7, 2020 19:57
Using the mac_address configuration for a Docker task
job "example" {
datacenters = ["dc1"]
group "cache" {
task "redis" {
driver = "docker"
config {
image = "redis:3.2"
mac_address = "A0:97:FA:13:93:03"
@angrycub
angrycub / fabio-system.nomad
Created March 19, 2018 16:27
Nomad Job Description for Fabio with Consul Registration
job "fabio" {
datacenters = ["dc1"]
type = "system"
update {
stagger = "5s"
max_parallel = 1
}
group "linux-amd64" {
task "fabio" {
constraint {
@angrycub
angrycub / instructions.md
Created November 29, 2017 23:20
Resetting ink subsystem on HP Color Inkjet 5180

Resetting HP Color Inkjet 5180

Ink Error 0xc18a0206

Please perform the below steps:

  1. Press and hold the “left arrow” key, then press the “Setup” key and release both keys.

Display should say “Enter Special Key Combo”

@angrycub
angrycub / Dockerfile
Last active September 14, 2017 21:23
Nomad Job File for http-echo based on Windows Nano Server
FROM microsoft/nanoserver
ENV HTTP_ECHO_DOWNLOAD_URL "https://github.com/hashicorp/http-echo/releases/download/v0.2.3/http-echo_0.2.3_windows_amd64.zip"
ENV HTTP_ECHO_PORT 8080
ENV HTTP_ECHO_STRING "Hello World"
RUN powershell.exe -Command ; \
$handler = New-Object System.Net.Http.HttpClientHandler ; \
$client = New-Object System.Net.Http.HttpClient($handler) ; \
$client.Timeout = New-Object System.TimeSpan(0,30,0) ; \

HOWTO: Clean Up Nomad Data Directory

Issue

When attempting to remove all of the data in the Nomad data directory, several directories and files are unable to be deleted. Many messages are logged to the console like:

rm: cannot remove ‘alloc/736f61b9-d7dc-cb73-0dd1-76b1b2ba032d/nomad-ui/secrets’: Device or resource busy
rm: cannot remove ‘alloc/ddcf5a78-5497-f4a4-a101-221fc4e0180b/fabio/alloc’: Device or resource busy
rm: cannot remove ‘alloc/ddcf5a78-5497-f4a4-a101-221fc4e0180b/fabio/secrets’: Device or resource busy

Job Anti-Affinity in Action

Overview

This guide will walk you through creating and executing a job that will demonstrate Nomad's job anti-affinity rules and, in clusters with memory limited Nomad clients, filtering based resource exhaustion.

Sample Environment

  • One Nomad Server Node
  • Three Nomad Client Nodes
    • 768 MB RAM total (providing 761 MB RAM in nomad node-status -self)
@angrycub
angrycub / pinger.erl
Created May 9, 2017 18:14 — forked from lukebakken/pinger.erl
Ping Riak nodes
-module(pinger).
-export([ping/1,
ping/3,
pinglist/4,
pingall/0,
pingall/1,
pingall/2
]).
@angrycub
angrycub / Build a ring using riak_core_claim_sim
Created October 18, 2016 15:57
This will enable a ring to be created using riak_core_claim_sim. These rings could then be used to bootstrap a cluster without having to do the join steps.
RingSize = 32,
FirstNodeName = 'riak@127.0.0.1',
NewRing = riak_core_claim_sim:run([
{ring, riak_core_ring:fresh(RingSize, FirstNodeName)},
{target_n_val,4},
{wants,{riak_core_claim,wants_claim_v3}},
{choose,{riak_core_claim,choose_claim_v3}},
{cmds, [[
{join, 'riak@127.0.0.2'},
{join, 'riak@127.0.0.3'},