Skip to content

Instantly share code, notes, and snippets.

View rdeavila's full-sized avatar

Rodrigo de Avila rdeavila

View GitHub Profile
@rdeavila
rdeavila / pd-event.sh
Created June 13, 2023 20:03 — forked from alperkokmen/pd-event.sh
Simple script to trigger, acknowledge, and resolve incidents via PagerDuty Integration API.
#!/bin/bash
CONTENT_TYPE="application/json"
DESCRIPTION="bad things™ are happening"
URL="https://events.pagerduty.com/generic/2010-04-15/create_event.json"
if [ $# -ne 3 ]; then
echo "Usage: pd-event.sh [TYPE] [SERVICE KEY] [INCIDENT KEY]"
echo " - TYPE: [t]rigger | [a]cknowledge | [r]esolve"
echo " - SERVICE KEY: unique identifier for service"
@rdeavila
rdeavila / create-startssl-cert-bundle.sh
Last active August 26, 2015 22:30 — forked from david50407/create-startssl-cert-bundle.sh
Read a SSL certificate issued by StartSSL and bundle intermediate certificates into it so it works everywhere
#!/bin/bash
set -eo pipefail
cert_file="$1"
if [ -z "$cert_file" ]; then
echo "Usage: create-startssl-cert-bundle CERTIFICATE_FILE" >&2
echo >&2
echo "Bundles StartSSL's intermediate certs and writes combined certificate to stdout" >&2
exit 1

Port Forwarding in Yosemite


####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

rdr pass on lo0 inet proto tcp from any to 127.0.0.2 port 80 -> 127.0.0.1 port 40070
@rdeavila
rdeavila / dump.js
Created March 27, 2014 14:22 — forked from oodavid/dump.js
/**
* DUMP
*
* Dumps a variable in a readable form to the console, this is a recursive function
* so be careful of nested references that may cause it to overflow... (untested for that)
*
* @v ANYTHING [Any variable]
* @name STRING [The name of the variable, optional, used internally when looping objects and arrays]
* @spacing STRING [The prefix spacing, used internally when looping objects and arrays]
*/
@rdeavila
rdeavila / shmsetup.sh
Last active August 29, 2015 13:56 — forked from jodell/shmsetup.sh
Calcula as configurações de kernel shared memory
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Gera linhas de configuração que podem ser adicionadas ao sysctl
# com base no total de RAM do sistema. A saída
# permite até 50% da memória física para ser alocada como
# shared memory.
# No Linux, você pode usar desta forma (como root):
#
# ./shmsetup >> /etc/sysctl.conf
@rdeavila
rdeavila / java-7-ppa.sh
Last active December 26, 2015 08:28 — forked from anonymous/java-7-ppa.sh
Este pacote fornece o Oracle Java JDK 7 (que inclui Java JDK, JRE e o plugin Java para navegadores). Não é possível instalar apenas o Oracle JRE - o PPA fornece apenas o pacote completo. Fonte: Fonte: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
#!/bin/bash
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer oracle-java7-set-default