This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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(...) | |
* } |
OlderNewer