Skip to content

Instantly share code, notes, and snippets.

View levysantanna's full-sized avatar
😎

Levy Sant'Anna levysantanna

😎
  • Red Hat
  • Brazil
View GitHub Profile
@neilalbrock
neilalbrock / splitmysqldump.pl
Created April 1, 2012 19:39
Split MySQL dump into a file per database
#!/usr/bin/perl -w
#
# splitmysqldump - split mysqldump file into per-database dump files.
use strict;
use warnings;
my $dbfile;
my $dbname = q{};
my $header = q{};
while (<>) {
@melpomene
melpomene / lagrange.py
Created April 24, 2012 19:27
Lagrange interpolation in python
import numpy as np
import matplotlib.pyplot as plt
import sys
def main():
if len(sys.argv) == 1 or "-h" in sys.argv or "--help" in sys.argv:
print "python lagrange.py <x1.y1> .. <x_k.y_k>"
print "Example:"
print "python lagrange.py 0.1 2.4 4.5 3.2"
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active December 5, 2024 12:01
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@xero
xero / irc.md
Last active January 31, 2025 15:06
irc cheat sheet
@genaromadrid
genaromadrid / ca_validation.md
Last active July 16, 2024 11:28
Validate a Certificate against a Certificate Authority using OpenSSL

Certificate CA Validation

The easy way

To validate a certificate agains a certificate authority you just have to run

openssl verify -trusted ca_root.pem -untrusted intermediate_ca.pem certificate.pem

You'll see a 'OK' message at the end of the output

@alces
alces / ansible_local_playbooks.md
Last active February 18, 2025 04:19
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@pulecp
pulecp / heal_gluster.sh
Last active August 31, 2024 10:22
This script looks for gluster volumes, checks their heal statuses and tries to fix all the unhealed files/dirs.
#!/bin/bash
# thanks to Niels de Vos (https://gist.github.com/nixpanic/5460521), this script
# is based on his one
RED='\033[1;31m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color
@djoreilly
djoreilly / ovs-cheat.md
Last active January 30, 2025 19:13
OVS cheat sheet

DB

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl list interface vxlan-ac000344
ovs-vsctl --columns=options list interface vxlan-ac000344
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl -f csv --no-heading --columns=_uuid list controller
ovs-vsctl -f csv --no-heading -d bare --columns=other_config list port
@MichaelCurrie
MichaelCurrie / Dropzone with Python 3
Last active December 11, 2024 18:22
Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server
#Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server
@kairoaraujo
kairoaraujo / example.txt
Created October 10, 2017 19:29
Example -m setup for AIX with facts_devices
172.16.100.28 | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"172.16.100.28"
],
"ansible_all_ipv6_addresses": [
"::1%1"
],
"ansible_apparmor": {
"status": "disabled"