Skip to content

Instantly share code, notes, and snippets.

@pmoranga
pmoranga / puppet-firewall-docker.pp
Created February 8, 2016 23:55
Make puppetlabs-firewall works with docker smoothly
class my_fw::pre {
# Disable due to selective purges of firewallchain
# resources { "firewall":
# purge => true
# }
# Avoid removing Docker rules:
firewallchain { 'FORWARD:filter:IPv4':
purge => true,
@mattheworiordan
mattheworiordan / cli.rb
Created January 9, 2015 12:21
Thor with subcommands that work correctly with help
#!/usr/bin/env ruby
require 'thor'
class SubCommandBase < Thor
def self.banner(command, namespace = nil, subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
def self.subcommand_prefix
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@kkszysiu
kkszysiu / gist:247c42dc9fd1d34a70a1
Last active June 24, 2021 03:52
Torchlight Linux
If you want to play on HumbleBundle edition of Torchlight you need old libSDL2 library.
Someone forgotten about that.
With latests libSDL2 it won't work. You will have issues with mouse pointer.
Cursor will have black outline. You won't be able to click on anything etc.
So I prepared modified libSDL2 lib which will able you to play this game with no issues.
https://drive.google.com/file/d/0B1WBC6JhUyLKZDRrTkxMVzA3S28/edit?usp=sharing
That's those libSDL libs. You need to copy it to lib64 dir where you've installed Torchlight, in my case it was /home/kkszysiu/.games/Torchlight/lib64/
@brablc
brablc / postfix_grok_pattern
Last active September 27, 2020 20:10
Logstash example configuration for parsing Postfix mail log files
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374:
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
POSREAL [0-9]+(.[0-9]+)?
DELAYS (%{POSREAL}[/]*)+
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT}
STATUS sent|deferred|bounced|expired
#!/bin/bash
#
# works on centOS 6.3 x86_64
#
# yum update repo
yum -y update
# install needed modules (from normal repo)
@pcolazurdo
pcolazurdo / Execute logstash
Last active December 2, 2016 09:20
LogStash configuration Sample
java -cp . logstash.runner agent -f logstash.conf -- web --backend elasticsearch:///?local
@chetan
chetan / yardoc_cheatsheet.md
Last active May 4, 2024 11:12
YARD cheatsheet