Skip to content

Instantly share code, notes, and snippets.

View Signorini's full-sized avatar

Felipe Klerk Signorini Signorini

View GitHub Profile
---
// kubectl apply -f svc-v1.yml
kind: Service // can be a loadbalance, ingress or a simple nodeport
spec:
selector:
version: 1.0.0 // The magic
@Signorini
Signorini / recreate.yaml
Last active August 21, 2019 15:03
reacreate deploy
---
apiVersion: apps/v1
kind: Deployment
spec:
strategy:
type: Recreate

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Signorini
Signorini / submitCachetMetrics.py
Created July 11, 2018 14:27
Fetch a metric query JSON from DataDog and submit it to a Cachet server so it can be graphed.
#! /usr/bin/python
from datadog import initialize, api
import requests
import time
# DataDog bootstrap
options = {
'api_key': 'yourkeyhere',
'app_key': 'yourkeyhere'
}
rabbitmq:
hostname: "discovery-rabbit"
image: rabbitmq:3-management
ports:
- "15672:15672"
- "5672:5672"
mongodb:
image: mongo
volumes:
@Signorini
Signorini / python.yml
Created June 28, 2018 21:58
Microservice - Maestro Server
discovery:
image: maestroserver/discovery-maestro
ports:
- "5000:5000"
environment:
- "CELERY_BROKER_URL=amqp://rabbitmq:5672"
- "MAESTRO_DATA_URI=http://data:5010"
depends_on:
- rabbitmq
- data
@Signorini
Signorini / client_maestro.yml
Created June 28, 2018 21:56
Client - Maestro Server
client:
image: maestroserver/client-maestro
ports:
- "80:80"
environment:
- "API_URL=http://localhost:8888"
- "STATIC_URL=http://localhost:8888/static/"
depends_on:
- server
server:
image: maestroserver/server-maestro
ports:
- "8888:8888"
environment:
- "MAESTRO_MONGO_URI=mongodb/maestro-client"
- "MAESTRO_DISCOVERY_URI=http://discovery:5000"
- "MAESTRO_REPORT_URI=http://reports:5005"
- "SMTP_PORT=25"
- "SMTP_HOST=maildev"
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@Signorini
Signorini / openstack_setup.sh
Created May 30, 2018 20:39
OpenStack Setup
#!/bin/bash
if [[ $(whoami) != 'root' ]]; then echo "Run as root"; exit; fi
apt-get update && apt-get install git -y
cd /usr/local/src || echo "/usr/local/src does not exist"
git clone -b stable/newton https://github.com/openstack-dev/devstack.git
cd devstack || exit
sed -i 's/HOST_IP=${HOST_IP:-}/HOST_IP=`dig +short myip.opendns.com @resolver1.opendns.com`/g' stackrc
./tools/create-stack-user.sh
echo "[[local|localrc]]
disable_service n-net