Skip to content

Instantly share code, notes, and snippets.

@hggh
hggh / gist:1115895
Created July 30, 2011 19:30
activeMQ for MCollective
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
@hggh
hggh / deploy.rb
Created October 17, 2012 18:21
Capistrano recipe for repositories with sub directories
require 'capistrano/recipes/deploy/strategy/remote_cache'
module ::Capistrano
module Deploy
module Strategy
class RemoteCache < Remote
def copy_repository_cache
logger.trace "copying the cached version to #{configuration[:release_path]}"
if copy_exclude.empty?
directory = File.join(repository_cache, 'symfony')
run "cp -RPp #{directory} #{configuration[:release_path]} && #{mark}"
@hggh
hggh / graylog2.md
Last active January 6, 2023 12:18
Graylog2 Debian Packages

WARNING

These packages are obsolete! Please use the official packages from http://www.Graylog2.org

=================================================

@hggh
hggh / ldirectord.cf
Created December 27, 2013 08:57
Graylog2 Server <=> Ldirectord <=> ipvsadm (LVS)
virtual=1.1.1.1:12201
real=10.10.10.100:12201 masq
real=110.10.10.200:12201 masq
protocol=udp
scheduler=rr
checkport=12900
request="/system"
service=http
httpmethod=GET
receive="graylog2-server"
@hggh
hggh / graylog2.drl
Created February 10, 2014 20:45
Graylog2 Drools Rule File
import org.graylog2.plugin.Message
rule "delete message 1"
when
m : Message( message matches "^PHP Deprecated: getChildren.*" && getField("facility") == "php-error-logs")
then
m.setFilterOut(true);
end
@hggh
hggh / crontab-checker.rb
Created March 20, 2014 09:40
crontab checker in ruby
#!/usr/bin/ruby
require 'cron-spec'
File.read("/tmp/cron").split("\n").each do |line|
next if line =~ /^#/ or line =~ /^$/
data = line.split(" ")
cron_time = data[0..4].join(" ")
@hggh
hggh / haproxy_curconn_
Created May 17, 2014 12:03
haproxy curconns with instance support
#!/usr/bin/env perl
# haproxy_curconn_l1 symlink in etc/munin/plugins
use strict;
use IO::Socket::UNIX;
my $ha_name;
if ($0 =~m /haproxy_maxconn_(.*)/ ) {
$ha_name = $1;
}
@hggh
hggh / INSTALL.md
Last active August 29, 2015 14:04
Puppetboard Debian Packages
#!/bin/bash
unknown_os ()
{
echo "Unfortunately, your operating system distribution and version are not supported by this script."
echo "Please email support@packagecloud.io and we will be happy to help."
exit 1
}
curl_check ()
@hggh
hggh / fastledwithmqtt.ino
Created March 12, 2016 23:33
FastLED Crashes MQTT
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "FastLED.h"
// UPDATE
const char* ssid = ".....";
const char* password = "....";
const char* mqtt_server = "192.168.0.1";