Skip to content

Instantly share code, notes, and snippets.

View lgfa29's full-sized avatar

Luiz Aoqui lgfa29

View GitHub Profile
job "${NOMAD_JOB_NAME}" {
datacenters = ["dc1"]
group "cache" {
network {
port "db" {
to = 6379
}
}
#!/usr/bin/env bash
function nomad_curl {
cmd=(curl --silent -H "X-Nomad-Token: $NOMAD_TOKEN")
if [[ -n "$NOMAD_CACERT" ]]; then
cmd+=(--cacert "$NOMAD_CACERT" --key "$NOMAD_CLIENT_KEY" --cert "$NOMAD_CLIENT_CERT")
fi
"${cmd[@]}" "$@"
}
job "hashicups" {
datacenters = ["dc1"]
group "hashicups" {
network {
port "http" {
static = 19090
}
port "metrics" {
provider "google" {
project = "..."
region = "us-central1"
zone = "us-central1-a"
}
locals {
my_list_from_map = [for k, v in var.my_map : "${k}.${v}"]
}
#!/usr/bin/env python
import shutil
from mininet.cli import CLI
from mininet.net import Mininet
from mininet.topo import SingleSwitchTopo
from mininet.util import pmonitor
servers_count = 3
(function(dragClass, dropZoneId) {
//
// Classes
//
// Point is a representation of (X, Y) coordinates
function Point(x, y) {
this.x = x;
this.y = y;
}
artifact
@lgfa29
lgfa29 / minecraft.hcl
Created March 26, 2020 15:52
Nomad job for running a Minecraft server
job "minecraft" {
datacenters = ["dc1"]
group "minecraft" {
volume "minecraft" {
type = "host"
source = "minecraft"
}
task "eula" {
@lgfa29
lgfa29 / README.md
Last active December 4, 2019 18:22

How to use it

  1. Create a GitHub Personal Access Token with the read:org permission.
  2. Copy the contents of bookmarklet.js and replace the placeholders with your specific values.
  3. Add a new bookmark to your browser using that as the URL.
[
{
"id": "cbb0ae9a.092cd8",
"type": "http in",
"z": "9358b649.b981c8",
"name": "",
"url": "/search",
"method": "get",
"upload": false,
"swaggerDoc": "",