Skip to content

Instantly share code, notes, and snippets.

@showaltb
showaltb / proxy.yml
Created November 4, 2016 13:14
Ansible playbook to provision a tinyproxy server on an Ubuntu or CentOS (7.1+) host
# provision a tinyproxy server on an Ubuntu or CentOS (7.1+) host
- hosts: proxies
become: true
roles:
- geerlingguy.firewall
vars:
firewall_allowed_tcp_ports: [ 22, 8888 ]
@showaltb
showaltb / define_method.rb
Created November 22, 2018 17:38
Example of using define_method in a mixin to define a method in an including class/module
module MyMixin
def self.included(other)
other.instance_eval do
define_method :bar do
puts 'bar called'
end
end
end
end