Skip to content

Instantly share code, notes, and snippets.

View aputs's full-sized avatar

Allan Ralph Hutalla aputs

  • Earth
  • Philippines
View GitHub Profile
@jpetazzo
jpetazzo / README.md
Last active August 21, 2019 17:55
Give network superpowers to docker

Unionize: network superpowers for your docker containers

Unionize lets you connect together docker containers in arbitrarily complex scenarios.

Note: I recommend to use https://github.com/jpetazzo/pipework instead.

  • pipework is a better name than unionize
  • it's hosted on a "real" github repo instead of a small gist :-)

Now if you want Unionize, it's still here. Just check those examples.

@gevans
gevans / encryption-decryption.rb
Created July 16, 2013 00:24
A couple examples of using asymmetric RSA signing and encryption using Ruby's OpenSSL libraries.
require 'openssl'
key = OpenSSL::PKey::RSA.new(2048)
p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@tnolet
tnolet / gist:7361441
Last active December 5, 2018 02:48
Install collectd 5.4 on Centos 6.x and make it spit out cool metrics. Copied from http://linuxdrops.com/install-collectd-statistics-collecter-on-centos-rhel-ubuntu-debian/ and tweaked for your and my pleasure. For all other cool options, check the provided link.
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz
tar zxvf collectd-5.4.0.tar.gz
{% extends 'base.html' %}
{% import 'macros.html' as macros %}
{% block content %}
<div class="row">
<div class="col-xs-12 col-md-3 col-sm-4 col-sm-offset-4 col-md-offset-4 col-lg-3 col-lg-offset-4">
<div class="login-message">
Login to AwesomeService!
</div>
{% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login',
class_='login-form') %}
@moltar
moltar / rc
Created December 26, 2013 19:01
Make cpanm cache tar balls locally. Put this line in your .bashrc or .zshrc file.
export PERL_CPANM_OPT="--cascade-search --save-dists=$HOME/.cpanm/cache --mirror=$HOME/.cpanm/cache --mirror=http://search.cpan.org/CPAN"
@jjongsma
jjongsma / packer-config
Last active December 18, 2023 15:15
Process YAML and write Packer JSON to STDOUT
#!/usr/bin/python
#
# Usage: packer-config my-template.yaml | packer build -
#
# Constructs a Packer JSON configuration file from the specified YAML
# template file and writes it to STDOUT.
#
# The YAML template format adds some flexibility and readability by
# adding comments and an !include directive, allowing for the
# following template syntax:
@acdha
acdha / custom-log-filtering-and-formatting.py
Created February 26, 2014 21:19
Example of how to filter or apply custom formatting using Python's logging library
#!/usr/bin/env python
# encoding: utf-8
from pprint import pformat, pprint
import logging
class PasswordMaskingFilter(logging.Filter):
"""Demonstrate how to filter sensitive data:"""
(ns foobar.search
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [<! chan put!] :as a]
[reagent.core :as reagent]
[reagent.ratom :refer [atom]]))
; Source: https://gist.github.com/Deraen/946ac9e6c6211c83f1e9
(defn debounce [in ms]
"Creates a channel which will change put a new value to the output channel