Skip to content

Instantly share code, notes, and snippets.

View YannRobert's full-sized avatar
🏠
Working from home

Yann ROBERT YannRobert

🏠
Working from home
  • Paris, France
View GitHub Profile
import java.nio.charset.Charset;
/**
* <p>Provides Base32 encoding and decoding as defined by <a href="http://www.ietf.org/rfc/rfc4648.txt">RFC 4648</a>.
* However it uses a custom alphabet first coined by Douglas Crockford. Only addition to the alphabet is that 'u' and
* 'U' characters decode as if they were 'V' to improve mistakes by human input.<p/>
* <p>
* This class operates directly on byte streams, and not character streams.
* </p>
*
@YannRobert
YannRobert / LoggregatorLoadTestController.java
Last active August 29, 2015 14:13
LGR "Log message output too high. We've dropped 100 messages" investigation
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Nullable;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@YannRobert
YannRobert / BufferMayProduceDuplicatesTest.java
Created November 19, 2014 18:22
RxJava Test demonstrating an issue (duplicate emitions) when using delay(duration) in combination with buffer(count, duration)
package rxjava.issue;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.functions.Action1;
import java.util.List;
@YannRobert
YannRobert / RxJavaBufferWithTimespanBugTest.java
Last active August 29, 2015 14:09
shows that the usage of 2 RxJava buffers with both a timespan and a count will eventually make the events be emitted at a very slow rate to the subscriber
package rxjava.issue;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observer;
import rx.Subscriber;
import rx.functions.Func1;
@YannRobert
YannRobert / sendsoap.sh
Last active August 29, 2015 13:56
poor man's soap client for sepamail webservice
#!/bin/sh
export WS_SERVER=skemqxqxxxx.test.sepamail.eu
#export WS_SERVER=sogefrp0.test.sepamail.eu
#export WS_SERVER=bpcefrppxxx.test.sepamail.eu
#export WS_SERVER=bnpafrppxxx.test.sepamail.eu
#export WS_SERVER=cmcifrpaxxx.test.sepamail.eu
## you should provide a file containing a valid SOAP request
@YannRobert
YannRobert / minimal-sepamail-soap-request.xml
Last active January 4, 2016 21:59
Minimal SEPAmail SOAP request (SOAP 1.2 with sample content)
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header/><env:Body><ns3:sendMissive xmlns:ns3="http://xsd.sepamail.eu/1206/wsdl"><in>aGVsbG8=</in></ns3:sendMissive></env:Body></env:Envelope>
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
@YannRobert
YannRobert / gist:4691758
Created February 1, 2013 14:51
a GLU console-server stderr.log file content to serve as support for an issue report
2013-02-01 09:07:43.253:INFO::jetty-7.2.2.v20101205
2013-02-01 09:07:43.270:INFO::Deployment monitor /<somewhere>/console-server/jetty-distribution-7.2.2.v20101205/webapps at interval 1
2013-02-01 09:07:43.274:INFO::Deployment monitor /<somewhere>/console-server/jetty-distribution-7.2.2.v20101205/contexts at interval 1
2013-02-01 09:07:43.275:INFO::Deployable added: /<somewhere>/console-server/jetty-distribution-7.2.2.v20101205/contexts/console-jetty-context.xml
2013-02-01 09:07:48.728:INFO:/console:Initializing Spring root WebApplicationContext
0 [main] INFO grails.spring.BeanBuilder - [RuntimeConfiguration] Configuring data source for environment: PRODUCTION
824 [main] INFO grails.spring.BeanBuilder - Setting leafExecutorService thread pool size to [6]
1236 [main] INFO grails.spring.BeanBuilder - Registering realm: org.linkedin.glu.console.realms.ShiroLdapRealm
3590 [main] WARN net.sf.ehcache.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml fou
@YannRobert
YannRobert / gist:4557761
Last active December 11, 2015 06:18
Patch proposal for linkedin/glu#196
--- a/utils/org.linkedin.glu.utils/src/main/java/org/linkedin/glu/utils/core/DisabledFeatureProxy.java
+++ b/utils/org.linkedin.glu.utils/src/main/java/org/linkedin/glu/utils/core/DisabledFeatureProxy.java
@@ -39,6 +39,14 @@ public class DisabledFeatureProxy implements InvocationHandler
@Override
public Object invoke(Object o, Method method, Object[] objects) throws Throwable
{
- throw new DisabledFeatureException(_feature);
+ final String methodName = method.getName();
+ if (methodName.equals("hashCode") && method.getParameterTypes().length == 0) {
+ return o.hashCode();
--- linux.rb.ori 2012-09-24 19:20:39.094577648 +0200
+++ linux.rb 2012-09-24 19:41:02.079583990 +0200
@@ -42,14 +42,27 @@
@ui.info I18n.t("vagrant.hosts.linux.nfs_export")
sleep 0.5
+ # as we are potentially asking for a password when using sudo, the user may appreciate some log info
+
nfs_cleanup(id)