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
knife search node "chef_environment:yyy AND roles:identity_server" | |
10 items found | |
Node Name: <node name 1> | |
Environment: yyy | |
FQDN: xxx | |
IP: xxx | |
Run List: role[identity_server], role[media_server], role[push_gw_server], role[survey_server], role[survey_ui_server], role[tracking_server], role[subscriber_server], role[transcoder_server] | |
Roles: identity_server, base, proxy_server, media_server, push_gw_server, survey_server, survey_ui_server, tracking_server, subscriber_server, transcoder_server | |
Recipes: madme-base, madme-iptables, madme-prometheus::node_exporter, madme-haproxy, madme-java8, madme-apps, madme-apache2, madme-ui-apps::default, madme-base::default, ntp::default, runit::default, build-essential::default, build-essential::_rhel, sudo::default, madme-base::geo-ip-database, ark::default, madme-base::geo-ip-city-database, madme-base::geo-ip-city-asia-pacific-database, madme-base::common-configuration, madme-base::s3events, madme-iptables::default, madme-haproxy::default, madm |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<!-- add your stuff --> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<configuration> |
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
/** | |
* Strategy for rendering a {@link OAuth2Exception} in cases where they cannot be rendered by the Spring dispatcher | |
* servlet (i.e. usually in a filter chain). | |
* | |
* @author <blame someone> | |
* | |
*/ | |
public interface OAuth2ExceptionRenderer { | |
void handleHttpEntityResponse(HttpEntity<?> responseEntity, ServletWebRequest webRequest) throws Exception; | |
} |
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
/** | |
* If authentication fails and the caller has asked for a specific content type response, this entry point can send one, | |
* along with a standard 401 status. Add to the Spring Security configuration as an {@link AuthenticationEntryPoint} in | |
* the usual way. | |
* | |
* @author Dave Syer | |
* | |
*/ | |
public class OAuth2AuthenticationEntryPoint extends AbstractOAuth2SecurityExceptionHandler implements | |
AuthenticationEntryPoint { |
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
protected def uncaughtExceptionHandler: Thread.UncaughtExceptionHandler = | |
new Thread.UncaughtExceptionHandler() { | |
def uncaughtException(thread: Thread, cause: Throwable): Unit = { | |
cause match { | |
case NonFatal(_) | _: InterruptedException | _: NotImplementedError | _: ControlThrowable ⇒ log.error(cause, "Uncaught error from thread [{}]", thread.getName) | |
case _ ⇒ | |
if (settings.JvmExitOnFatalError) { | |
try { | |
log.error(cause, "Uncaught error from thread [{}] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled", thread.getName) | |
import System.err |
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
def receiveMessage(remoteMessage: RemoteMessage): Unit = { | |
val remoteDaemon = provider.remoteDaemon | |
try { | |
remoteMessage.recipient match { | |
case `remoteDaemon` ⇒ | |
if (useUntrustedMode) log.debug("dropping daemon message in untrusted mode") | |
else { | |
if (provider.remoteSettings.LogReceive) log.debug("received daemon message [{}]", remoteMessage) | |
remoteMessage.payload match { |
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
Original embed link: | |
<script src="https://gist.github.com/iggyzap/6357900.js"></script> | |
One that works with embed function: | |
<iframe src="https://gist.github.com/iggyzap/6357900.js"></iframe> |
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
import akka.actor.*; | |
import java.lang.reflect.Field; | |
@OnApplicationStart(async = false) | |
public class AkkaBootstrap extends Job { | |
@Override | |
public void doJob() throws Exception { | |
ActorSystem system = Akka.getActorSystem(); //Akka there is custom plugin | |
// hack to use correct classloader so separate servers will be able to |
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
import akka.actor.*; | |
import akka.actor.ActorCell; | |
import akka.actor.ActorContext; | |
import org.jmock.Expectations; | |
import org.jmock.auto.Mock; | |
import org.jmock.integration.junit4.JUnitRuleMockery; | |
import org.jmock.lib.concurrent.Synchroniser; | |
import org.jmock.lib.legacy.ClassImposteriser; | |
import org.junit.AfterClass; | |
import org.junit.Before; |
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
import com.google.common.collect.AbstractIterator; | |
import java.util.BitSet; | |
import java.util.Iterator; | |
/** | |
* Iterable over BitSet, will represent a snapshot view of given bitset at time | |
* of obtaining iterator. | |
*/ | |
public class BitSetIterable implements Iterable<Integer> { |
NewerOlder