This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
subprojects { | |
... | |
apply plugin: 'java' | |
apply plugin: 'scala' | |
sourceCompatibility = 1.8 | |
targetCompatibility = 1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Ridiculously Simple FSM DSL in Scala, similar to AKKA Actor-based FSM syntax | |
* | |
* def MY_STATE(...args...) = state("MY_STATE") { | |
* ... do something on entry ... | |
* events { | |
* case MyEvent => | |
* ... do something on event ... | |
* MY_OTHER_STATE(...) | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/asio/io_context.hpp> | |
#include <boost/asio/post.hpp> | |
#include <boost/asio/signal_set.hpp> | |
#include <boost/exception/diagnostic_information.hpp> | |
#include "logger.hpp" | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install graphite dependencies | |
apt-get install -y python3 python3-pip python3-cairo python3-django | |
apt-get install -y apache2 libapache2-mod-wsgi-py3 | |
# Install graphite | |
pip3 install https://github.com/graphite-project/whisper/tarball/master | |
pip3 install https://github.com/graphite-project/carbon/tarball/master | |
pip3 install https://github.com/graphite-project/graphite-web/tarball/master | |
# Setup a vhost by grabbing the example the graphite team released on their repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xstreamist; | |
@XStreamAlias("my-msg") | |
public class MyXmlMessage { | |
// ... | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import argparse | |
import requests | |
from requests.auth import HTTPBasicAuth | |
from contextlib import closing | |
class PyJmx: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A script to incrementally poll a log file. | |
# Subsequent invocations print lines added since the previous invocation. | |
# An assumption is that log lines begin with a timestamp 23 characters long (see/tweak the TS_LEN variable below). | |
# | |
# The state is stored in the file <original_filename>.seen as a last_line_no + last_timestamp pair last seen. | |
# If the state file is not there, or the line_no in the target file has the last_timestamp | |
# different from the one in the state file, then the file is printed from the line 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:activemq] | |
directory=/path/to/activemq/base | |
command=/path/to/activemq/base/bin/activemq console | |
user=activemq | |
redirect_stderr=true | |
autostart=true | |
autorestart=false | |
stopasgroup=true | |
killasgroup=true | |
stdout_logfile=/path/to/activemq.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object StampedLockSyntax { | |
def syncRead[T](lock: StampedLock)(block: => T): T = { | |
val stamp = lock.readLock() | |
try { | |
block | |
} finally { | |
lock.unlockRead(stamp) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration scan="false" debug="true"> | |
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} > %-5p > %t > %c > %m%n%rEx{full, | |
java.lang.reflect.Method, | |
org.springframework.aop, | |
org.springframework.transaction, | |
org.springframework.security, | |
org.springframework.web, | |
org.springframework.cglib, |
NewerOlder