Skip to content

Instantly share code, notes, and snippets.

Roberto Aguilar rca

  • NYC
Block or report user

Report or block rca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rca / vault-env
Created Aug 29, 2019
Converts key/value pairs returned by a vault command into environment variables
View vault-env
#!/usr/bin/env python3.6
Converts key/value pairs returned by a vault command into environment variables
import json
import sys
'access_key': 'AWS_ACCESS_KEY_ID',
'secret_key': 'AWS_SECRET_ACCESS_KEY',
rca / flush_dns
Created Feb 5, 2019
Flushes local DNS cache on MacOS X
View flush_dns
set -e
sudo killall -HUP mDNSResponder
rca / rancher-exec
Created Jan 25, 2019
Execute a command within a container running in Rancher k8s
View rancher-exec
set -e
set -x
SCRIPT_NAME=$(basename $0)
if [ -z "$4" ]; then
echo "${SCRIPT_NAME} <env> <namespace> <pod name> <command> [args]" 1>&2
exit 1
View gist:07cb74c350d6be278249db6136faa7f7
class Foo:
def __init__(self, x=[]):
self.x = x
f = Foo()
rca / docker-service-ports
Created Mar 21, 2018
Script to list service ports and get next available port
View docker-service-ports
#!/usr/bin/env python3.6
import argparse
import logging
import re
import shlex
import sh
PORT_RE = re.compile(r':(?P<port>\d+)->')
rca / docker-networks
Last active Jul 13, 2018
Lists all docker networks sorted by their subnet address
View docker-networks
#!/usr/bin/env xonsh
import json
import re
import sys
from tabulate import tabulate
def sorted_alnum(l, key=None):
rca / git_whitespace
Created Feb 13, 2018
get rid of whitespace in your uncommitted work
View git_whitespace
#!/usr/bin/env python2.7
Ensure new lines added to git do not have whitespace
import os
import sys
import time
import traceback
from optparse import OptionParser
rca / mpm_prefork.conf
Created Aug 25, 2017
MySQL and Apache configuration on a small DigitalOcean Droplet for a low-traffic Wordpress site
View mpm_prefork.conf
# /etc/apache2/mods-enabled/mpm_prefork.conf
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 3
rca / embed.js
Created Apr 5, 2017
embed.js file for grafana dashboard embedding
View embed.js
/*! grafana - v3.0.0-pre1 - 2016-04-10
* Copyright (c) 2016 Torkel Ödegaard; Licensed Apache-2.0 */
!function(){"use strict";function a(a){var b=0;if(a.offsetParent)for(;;){if(b+=a.offsetTop,!a.offsetParent)break;a=a.offsetParent}else a.y&&(b+=a.y);return b}function b(b){if(b&&-1!==c.grafanaUrl.indexOf(b.origin)&&"grafana-resize""px"),"grafana-scroll"{var d=a(e);window.scrollTo(0,d)}}var c=window.GrafanaEmbed||{},d=document.getElementById("grafana-dashboard"),e=document.createElement("iframe");["grafanaUrl","embedUrl","dashnav"].forEach(function(a){window[a]&&(c[a]=c[a]||window[a])});var f=c.queryParams||{};f.embed=!0,c.embedUrl&&(f.embed_url=encodeURIComponent(c.embedUrl));var g=c.grafanaUrl+"/dashboard/db/"+c.dashboard,h=Object.keys(f);if(h.length>0){g+="?";for(var i=0;i<h.length;i++){i>0&&(g+="&");var j=h[i];g+=j+"="+f[j]}}e.src=g,"grafana-embed-frame",e.width="100%",e.height="0px",e.frameBorder="0
You can’t perform that action at this time.