Skip to content

Instantly share code, notes, and snippets.

View rezen's full-sized avatar

Andres Hermosilla rezen

View GitHub Profile
@rezen
rezen / aws_actions.txt
Last active June 16, 2023 10:55
It's nice having a list of AWS IAM actions
account:DisableRegion
account:EnableRegion
account:ListRegions
activate:CreateForm
activate:GetAccountContact
activate:GetContentInfo
activate:GetCosts
activate:GetCredits
activate:GetMemberInfo
activate:GetProgram
@rezen
rezen / wp.filter.php
Created August 18, 2012 17:05
Filter Image insert for WordPress
function xf_insert_image( $html, $id, $caption, $title, $align, $url )
{
$html5 = "<figure id='post-$id media-$id' class='align-$align'>";
$html5 .= "<img src='$url' alt='$title' />";
$html5 .= "<figcaption>$caption</figcaption>";
$html5 .= "</figure>";
return $html5;
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = new OpenAPI\Client\Configuration;
$config->setHost('http://localhost/v1.40');
$apiInstance = new OpenAPI\Client\Api\ContainerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client([
@rezen
rezen / README.md
Created July 31, 2018 20:36
Serverless lambda hack for python

The serverless-offline module handles node.js modules, but sls invoke will handle modules for python. So just create a node.js module with the same name as the python module, and a method with the same same which calls sls invoke ... and wallah!

#!/usr/bin/env bash
# @author Andres Hermosilla
# @notes
# Jenkins ssl
# http://balodeamit.blogspot.com/2014/03/jenkins-switch-to-ssl-https-mode.html
# https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins
# @todo
# - Setup security with LDAP
# - Add optional systems such as selenium
@rezen
rezen / template.conf
Last active May 11, 2018 18:17
Example upstart for centos /etc/init/template.conf
# Below are some good links for reference
# https://gist.github.com/c4milo/940909
# https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/
# http://upstart.ubuntu.com/cookbook/
# http://serverfault.com/questions/321375/passing-arguments-to-upstart-job
author "Andres Hermosilla <an2dres5m@gmail.com>"
description "Update Example Config"
# Set variables
env upstart_name=template
#!/usr/bin/env bash
set -e
format_text=1
if [[ "$@" == *"--nofmt"* ]]; then
format_text=0
fi
image="$1"
'use strict';
/**
* https://github.com/SalesforceEng/secure-filters
*
* @description
* Frequently strings are dirty and need to
* have some HTML removed. Often times you may
* want to control the filtering a bit more, for
* example removing all elements except anchors.
@rezen
rezen / m2crypto-certificates.py
Created April 5, 2017 18:50 — forked from eskil/m2crypto-certificates.py
Example of generating CA certs and CA signed certs using python m2crypto.
"""
Tools for creating a CA cert and signed server certs.
Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py
The mk_temporary_xxx calls return a NamedTemporaryFile with certs.
Usage ;
# Create a temporary CA cert and it's private key
cacert, cakey = mk_temporary_cacert()