Skip to content

Instantly share code, notes, and snippets.

View thiagoalmeidasa's full-sized avatar

Thiago Almeida thiagoalmeidasa

View GitHub Profile
@thiagoalmeidasa
thiagoalmeidasa / deploy.yaml
Created January 15, 2016 03:45 — forked from mblarsen/deploy.yaml
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
# Create a durable, direct exchange called "syslog" from RabbitMQ UI
$ rabbitmqctl add_vhost syslog
$ rabbitmqctl set_permissions -p syslog enyo ".*" ".*" ".*"
# /etc/syslog-ng/syslog-ng.conf
```
log { source(src); destination(d_rabbit); };
destination d_rabbit {
@thiagoalmeidasa
thiagoalmeidasa / jinja_variables_types.yml
Created May 4, 2018 13:50 — forked from spiette/jinja_variables_types.yml
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@thiagoalmeidasa
thiagoalmeidasa / celery.sh
Created July 11, 2018 19:40 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@thiagoalmeidasa
thiagoalmeidasa / redis-dump-keys.sh
Created October 2, 2018 20:47 — forked from jozsefs/redis-dump-keys.sh
dump redis keys with value (human readable values, not using the DUMP from redis). TBH if you have 10k+ keys this will take a lot of time
redis-cli keys \* | while read key; do value="`redis-cli get "$key"`"; echo "$key: $value"; done
@thiagoalmeidasa
thiagoalmeidasa / vagrant.py
Created June 12, 2019 08:39 — forked from d-a-n/vagrant.py
dynamic ansible vagrant inventory file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
### A simple helper script for using ansible and vagrant together.
# Usually you don't need an inventory file for vagrant, since one is created
# automatically. But if you want to give your vagrant host a special group
# or assign some variables, this script becomes handy.
#
# Use it like this:
# 1) create a file e.g ansible/inventories/vagrant.py and paste the content of this gist
@thiagoalmeidasa
thiagoalmeidasa / Jenkinsfile
Created November 13, 2019 11:37 — forked from teeks99/Jenkinsfile
Jenkinsfile with e-mail
pipeline {
agent any
stages {
stage('Build'){
steps {
echo "Running job: ${env.JOB_NAME}\nbuild: ${env.BUILD_ID} - ${env.BUILD_URL}\nblue ocean: ${env.RUN_DISPLAY_URL}"
}
}
}
@thiagoalmeidasa
thiagoalmeidasa / ducky.md
Created June 29, 2020 21:06 — forked from schmich/ducky.md
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@thiagoalmeidasa
thiagoalmeidasa / molecule-3-up.sh
Created July 20, 2020 06:28 — forked from geerlingguy/molecule-3-up.sh
Molecule 3.0 update script with all the little changes I had to make.
#!/bin/bash
#
# Update things to be compatible with Molecule 3.0.
#
# This script is NOT idempotent, and should never be run again.
exit 1
export LINT_STRING="lint: |
set -e
yamllint .
@thiagoalmeidasa
thiagoalmeidasa / local-k8s.sh
Created April 23, 2021 22:28 — forked from tom-butler/local-k8s.sh
Local kubernetes cluster using k3d, with pvc support
#!/bin/bash
# Install k3d
k3d --version || wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
# verify it
k3d check-tools
# create a volume and cluster
docker volume create kube-volume