Skip to content

Instantly share code, notes, and snippets.

View denzuko's full-sized avatar
💬
twitter.com/denzuko

Dwight Spencer (denzuko@mastodon.social) denzuko

💬
twitter.com/denzuko
View GitHub Profile
@rueycheng
rueycheng / GNU-Make.md
Last active June 2, 2024 10:56
GNU Make cheatsheet

Docker Swarm with Macvlan, Consul and Autoscaling

TL;DR:

This will get you routable containers with IPs on your existing subnets, advertising to Consul. They will also be scalable and placed across a cluster of Swarm hosts. It's assumed that you are already running Consul, so if not, there are a ton of tutorials out there. It's also assumed you know how to install Docker and various Linux kernels.

Bonus: We add an autoscaling API called Orbiter (https://gianarb.it/blog/orbiter-the-swarm-autoscaler-moves).

I just want to run containers, like now, on my existing infrastructure and networks!

So you have an existing environment. You use Consul for service discovery. Life is good. Containers are now a thing and you want to work them in without having to worry about overlay networking or reverse proxies. You also don't want to add extra latency (as some naysayers could use it as fuel to kill your hopes and dreams). Lastly, you don't have a lot of time to invest in a complex orchestration tool, such a

@boiyama
boiyama / docker-compose.yml
Last active November 24, 2021 16:05
docker-compose.yml configuring GitLab with Container Registry, Pages, and CI
version: '2'
services:
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce:latest
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
## GitLab configuration settings
##! Check out the latest version of this file to know about the different
@mattdell
mattdell / deploy.sh
Created March 13, 2017 11:31
Deploy to Heroku using Drone CI
# This script is designed to work with Drone IO for Continuous Integration
#
# Drone secret requirements
# HEROKU_API_KEY - Your Heroku API key
# HEROKU_LOGIN - Your Heroku login, probably your email address
# HEROKU_GIT_URL - Your Heroku git url (e.g. - https://git.heroku.com/{your-app-name}.git)
#
# Add a drone secret with the Drone CLI
# drone secret add --image=<image> <org/repo> <secret> <value>
@strangeman
strangeman / provisionViaSemaphore.groovy
Last active November 2, 2023 20:09
Semaphore API Call Snippet for Jenkins
echo "DEBUG: got project_id ${project_id} and template_id ${template_id}"
withCredentials([[$class: 'StringBinding', credentialsId: 'semaphore-token', variable: 'bearer']]) {
httpRequest acceptType: 'APPLICATION_JSON', consoleLogResponseBody: true, contentType: 'APPLICATION_JSON', customHeaders: [[name: 'Authorization', value: "Bearer ${env.bearer}"]], httpMode: 'POST', requestBody: """{
\"template_id\": ${template_id},
\"debug\": false,
\"dry_run\": false,
\"playbook\": \"\",
\"environment\": \"\"
}""", url: "https://ansible.ourdomain.com/api/project/${project_id}/tasks"
}
@johnwalicki
johnwalicki / Node-RED-StockQuote-sampleflow.png
Last active December 11, 2019 13:04 — forked from dceejay/README.md
Stock Price Alerts
Node-RED-StockQuote-sampleflow.png
#-------------------------------------------------------------------------------
#
# Rippled Server Instance Configuration Example
#
#-------------------------------------------------------------------------------
#
# Contents
#
# 1. Server
#
@thinkhy
thinkhy / store_pcap.go
Last active May 22, 2024 22:13
Read pcap file generated by tcpdump and store ip packet info to InfluxDB
package main
/* file: readPcap.go
* brief: read pcap file with gopacket package
* date: 2017-02-20
* creator: thinkhy
* reference: http://www.devdungeon.com/content/packet-capture-injection-and-analysis-gopacket
* TODO:
* 2017-02-22 Extract URL from HTTP packet
*/
@bernardoVale
bernardoVale / docker-compose.yml
Last active April 24, 2019 21:02
Traefik with ssl
version: '2'
services:
traefik:
image: traefik
command: -c /dev/null --web --docker --docker.domain=docker.localhost --logLevel=DEBUG --entryPoints="Name:https Address::443 TLS:/certs/server.crt,/certs/server.key;/certs_br/server.crt,/certs_br/server.key" --entryPoints="Name:http Address::80 Redirect.EntryPoint:https"
ports:
- "80:80"
- "8080:8080"
@jbergler
jbergler / draw-map.R
Last active May 14, 2021 23:46
Mapping Google location history using InfluxDB & R
require(influxdb)
require(OpenStreetMap)
results <- influxdb_query(
'localhost', '8086', 'my-database', '', '',
'SELECT * FROM "data.google.location_history" WHERE time >= \'2013-09-01\' AND time < \'2017-01-01\''
)
map <- openmap(
c(51.40,-0.5),