Skip to content

Instantly share code, notes, and snippets.

View jparrill's full-sized avatar
🏡
Working from Home!

Juan Manuel Parrilla Madrid jparrill

🏡
Working from Home!
View GitHub Profile
@jparrill
jparrill / keybase.md
Created December 5, 2017 10:20
Keybase

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jparrill
jparrill / dyn-json-inv.py
Last active November 16, 2018 15:29
API Mocked for Dyn Inventory Generation
#!/usr/bin/python
import json
import requests
import argparse
import ConfigParser
import random
import re
from os.path import realpath
from os.path import dirname
import os
@jparrill
jparrill / README.md
Created December 20, 2016 10:33
Mapping key-value from ini file based on a pattern into a hash

Copy the Ini file into your home folder and execute this from CLI

Input:

ansible-playbook -i inv mapper.yml -v --extra-vars "pattern=port"

Output:

Using /etc/ansible/ansible.cfg as config file
@jparrill
jparrill / copy_config_files.rb
Last active August 29, 2015 14:28
A custom Puppet function to create a copy of files in a path without desired extension. Path=./<module>/lib/puppet/parser/functions/copy_config_files.rb.
require 'find'
require 'fileutils'
module Puppet::Parser::Functions
newfunction(:copy_config_files) do |args|
function_notice(["Using copy_config_files script..."])
## Get all files with extension as follows
config_files = []
Find.find(args[1]) do |path|
config_files << path if path =~ /.*\.template$/
@jparrill
jparrill / rhel_6_workshop.sh
Last active August 29, 2015 14:21
Shell script for RHEL 6 workshop
#!/bin/bash
#
# backup Startup script for the workshop
#
# chkconfig: 24 86 15
# description: awakes a workshop script
# processname: backup
#
### BEGIN INIT INFO
# Provides: backup
@jparrill
jparrill / stress.py
Created May 11, 2015 14:48
Stress python script
from multiprocessing import Pool
def f(x):
# Put any cpu (only) consuming operation here. I have given 1 below -
while True:
x * x
# decide how many cpus you need to load with.
no_of_cpu_to_be_consumed = 1
@jparrill
jparrill / Vagrantfile
Last active December 30, 2019 01:56
Vagrantfile for storage creation
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Dummy Vagrantfile
VAGRANTFILE_API_VERSION = "2"
BOX_MEM = ENV['BOX_MEM'] || "1024"
BOX_CORE = ENV['BOX_CORE'] || "1"
BOX_NAME = ENV['BOX_NAME'] || "nrel/CentOS-6.5-x86_64"
@jparrill
jparrill / irssi.basics
Last active September 25, 2017 07:11
IRSSI Cheatsheet
## Basics
/connect irc.nullirc.net
/server add -network <name> <url> <port>
/join <channel>
/alias <name> /action ...
## xmpp
yum install irssi-xmpp
irssi
/load xmpp
@jparrill
jparrill / yum_update_report.sh
Last active June 6, 2018 17:56
Yum update checker with severities RHEL/CentOS/Fedora
#!/bin/bash
#####
## Author: jparrill@redhat.com
## Dept: Consulting/Infrastructure
## Detail: Script to check updates and their severity
## Example: yum_update_report.sh -s Moderate
#####
function validations ()
{