Skip to content

Instantly share code, notes, and snippets.

View thiagoalmeidasa's full-sized avatar

Thiago Almeida thiagoalmeidasa

View GitHub Profile
@thiagoalmeidasa
thiagoalmeidasa / ctest-to-junit.xsl
Created December 11, 2019 14:20
ctest-to-junit.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<testsuites>
<xsl:variable name="buildName" select="//Site/@BuildName"/>
<xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/>
<xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status='failed'])" />
<xsl:variable name="numberOfErrors" select="count(//Site/Testing/Test[@Status='error'])" />
@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 / 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 / aws-policy-ec2-with-limits.js
Created May 28, 2019 13:12
aws policy ec2 with limits
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "AllowEC2CreationWithTagLimit",
"Effect": "Allow",
"Action": [
"ec2:RunInstances"
],
"Resource": "arn:aws:ec2:eu-central-1:111122223333:instance/*",
"Condition": {
@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 / 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 / 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
# 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 {

Keybase proof

I hereby claim:

  • I am thiagoalmeidasa on github.
  • I am thiagoalmeida (https://keybase.io/thiagoalmeida) on keybase.
  • I have a public key ASAdhr_KkmzR2t2uyT6YAzNU-3lobvZH8xCMuCSncbe5mQo

To claim this, I am signing this object:

{
"interface": "0.0.0.0:4984",
"adminInterface": "0.0.0.0:4985",
"log":[
"REST",
"Shadow",
"CRUD",
"CRUD+",
"HTTP",
"HTTP+",