Skip to content

Instantly share code, notes, and snippets.

View jjuarez's full-sized avatar
🛠️
Fixing almost everything

Javier Juarez jjuarez

🛠️
Fixing almost everything
View GitHub Profile
@jjuarez
jjuarez / Makefile
Created February 26, 2022 07:19
An oppinionated Makefile for python projects
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
RED="\\e[91m"
GREEN="\\e[32m"
BLUE="\\e[94m"
YELLOW="\\e[33m"
REGULAR="\\e[39m"
REPORTS=".coverage-reports"
SRC="app"
VERSION=$(shell cat ${SRC}/__init__.py | head -n 1 | cut -d" " -f 3 | tr -d "'")
@jjuarez
jjuarez / Dockerfile
Created December 21, 2021 16:09
Dockerfile using python poetry
ARG IMAGE_TAG="3.8.12-alpine3.15@sha256:ae21a996ebe902ddc73cff020202d94cb539c8c4426f67636374b32a6f9c3d22"
FROM python:${IMAGE_TAG} AS builder
ARG POETRY_VERSION=1.1.12
# hadolint ignore=DL3013,DL3018
RUN apk add --no-cache \
gcc \
libffi-dev \
musl-dev && \
@jjuarez
jjuarez / medium_clarity_airflow_efs.tf
Created March 5, 2020 11:54
Medium_Clarity_Airflow_EFS_TF
module “efs” {
source = “git::ssh://git@gitlab.clarity.ai/infrastructure/terraform/modules/terraform-aws-efs.git?ref=1.0.2”
partner = var.partner
system = var.system
environment = var.environment
name = var.name
region = var.region
vpc_id = var.vpc_id
subnets = var.subnets
security_groups = [aws_security_group.efs-airflow-dags.id]
#!/usr/bin/env bash
echo "deb http://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04/ ./" | sudo tee /etc/apt/sources.list.d/lutris.list
wget -q https://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04/Release.key -O - | sudo apt-key add -
sudo apt-get update &&
sudo apt-get install lutris -y
sudo apt install libvulkan1 libvulkan1:i386 -y
sudo add-apt-repository ppa:graphics-driver/ppa
sudo apt-get update &&
@jjuarez
jjuarez / mco-examples.sh
Created May 18, 2018 11:59 — forked from marshyski/mco-examples.sh
MCollective Examples
# Swtich to user to use MCO out of the box
sudo -i -u peadmin
# Find all servers in master catalog
mco find
# Find all servers in master catalog and run class reboot
mco find -C reboot
# Find all servers with puppet fact ec2_ami_id
@jjuarez
jjuarez / list_jenkins_plugins.rb
Created January 10, 2018 11:58
This scripts show the list of plugins deployed in a Jenkins instance
#!/usr/bin/env ruby
require 'yaml'
jenkins_server_hiera_config_file_name = File.expand_path('~/workspace/4iq/devops/cm/puppet/modules/puppet_control/data/role/jenkinsserver.yaml')
current_plugin_list = File.expand_path('./jenkins_server_deployed_plugins.lst')
plugins_deployed = YAML.load_file(jenkins_server_hiera_config_file_name)['jenkins_server::plugins'].keys.sort
plugins_self_deployed = [
'credentials',
'swarm'
@jjuarez
jjuarez / opt_parser.rb
Created September 29, 2017 12:32
An example of OptionParser
#!/usr/bin/env ruby
require 'optparse'
class LogParser
def self.parse(log_file, index)
data = []
File.open(log_file).each do |line|
@jjuarez
jjuarez / keybase.md
Created February 1, 2017 09:54
keybase verification

Keybase proof

I hereby claim:

  • I am jjuarez on github.
  • I am jjuarez (https://keybase.io/jjuarez) on keybase.
  • I have a public key ASAq1duHDJQE7PUZ3bQRH7GMcJgRPW4xvfTfHTkoijnBCgo

To claim this, I am signing this object:

#!/usr/bin/env ruby
#
# Vertica status Plugin
#
# This plugin attempts to login to postgres with provided credentials.
#
# Copyright 2015 tuenti Eng (Javier Juarez jjuarez _AT_ tuenti.com)
#
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
@jjuarez
jjuarez / postgresql_backup.sh
Created December 3, 2015 11:01
A PostgreSQL backup between nodes in a streaming replication cluster
#!/bin/bash
DEST_HOST=${1}
DATA_DIRECTORY=${2:-"/srv/data/postgresql-data"}
ARCHIVE_DIRECTORY=${3:-"/srv/data/postgresql-archives"}
[[ -n "${DEST_HOST}" ]] || exit 1
##
# Prepare for a local backup