Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# rabbitmq-server RabbitMQ broker
#
# chkconfig: - 80 05
# description: Enable AMQP service provided by RabbitMQ
#
### BEGIN INIT INFO
# Provides: rabbitmq-server
@fanyeren
fanyeren / docker-compile.pl
Last active April 9, 2019 10:07 — forked from mpasternacki/docker-compile.pl
fork from https://gist.github.com/mpasternacki/6660958, the original script is too old on latest docker.
#!/usr/bin/env perl
# fork from https://gist.github.com/mpasternacki/6660958
# the original script is too old on latest docker.
use feature 'switch';
use strict;
use warnings;
use Data::Dumper;
@fanyeren
fanyeren / log4j.xml
Created August 25, 2013 10:50 — forked from lusis/log4j.xml
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: https://github.com/t0xa/gelfj -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>
# This is a mixin module that adds support for tail-recursive
# style programming in Ruby without relying on any true tail
# recursion optimization in the Ruby virtual machine.
#
# Since tail recursion calls are actually deferred until after
# returning from the method that invoked #tail, recursions can
# be "nested" to an unlimited depth without overflowing the
# stack.
#
# The including module can define tail-recursive methods within
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 [email protected], salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/
Originally here: http://finster.co.uk/2010/11/16/virtualbox-piix4_smbus-error/
VirtualBox piix4_smbus Error
1. Check module is being loaded: -
lsmod | grep i2c_piix4
2. If so, blacklist it in /etc/modprobe.d/blacklist.conf, by adding the following to the end of the file :-
@fanyeren
fanyeren / benchmark.pl
Created April 27, 2012 06:47
Benchmarking simple accessors, Moose vs Mouse vs Moo vs Object::InsideOut vs Method::Signatures vs hand-written
#!/usr/bin/env perl
use strict;
use warnings;
# ...........by hand with checks..............
{
package Foo::Manual;
use Carp;