Skip to content

Instantly share code, notes, and snippets.

Yann ROBERT YannRobert

  • Paris, France
Block or report user

Report or block YannRobert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@YannRobert
YannRobert / save-load-docker-images.sh
Last active Sep 3, 2019 — forked from mmrko/save-load-docker-images.sh
Script to (selectively) save/load multiple Docker images
View save-load-docker-images.sh
#!/usr/bin/env bash
# Script to (selectively) save/load multiple Docker images to/from a directory.
# Run ./save-load-docker-images.sh for help.
set -e
directory=$PWD
filter=""
compress=0
@YannRobert
YannRobert / fail2ban-allstatus.sh
Created Dec 21, 2015 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
View fail2ban-allstatus.sh
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@YannRobert
YannRobert / 1-openssl-connect-shows-issue.log
Last active Oct 8, 2015
TLS certificate issue with carbon.hostedgraphite.com:20030
View 1-openssl-connect-shows-issue.log
# openssl s_client -connect carbon.hostedgraphite.com:20030
CONNECTED(00000003)
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.hostedgraphite.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.hostedgraphite.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.hostedgraphite.com
verify error:num=21:unable to verify the first certificate
View ConnectionFactorySettersTest.java
import com.rabbitmq.client.ConnectionFactory;
import org.junit.Test;
public class ConnectionFactorySettersTest {
// considering the default value for handshakeTimeout is 10000 and the default value for connectionTimeout is 0
// this test is failing
// if we set the connectionTimeout to a higher value than the default value of handshakeTimeout, the test will fail
View docker-issue-14396-docker-package.sh
#!/bin/sh
set -e
set -x
dnf install -y fail2ban
curl -O https://get.docker.com/rpm/1.7.1/fedora-22/RPMS/x86_64/docker-engine-1.7.1-1.fc22.x86_64.rpm
rpm -i ./docker-engine-1.7.1-1.fc22.x86_64.rpm
@YannRobert
YannRobert / named.conf
Created Jul 3, 2015
named.conf for a forwarding only naming server (to be used as the nameserver by localhost, in order to cache queries)
View named.conf
//
// named.conf
//
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
@YannRobert
YannRobert / 20-3proxy.conf
Last active Jul 19, 2019
working 3proxy configuration for a personal usage proxy
View 20-3proxy.conf
# /etc/fail2ban/jail.d/20-3proxy.conf
[3proxy]
enabled = true
filter = 3proxy
action = iptables[name=3proxy, port=3128, protocol=tcp]
logpath = /var/log/3proxy/3proxy.log*
maxretry = 3
bantime = 3600 ; 1 hour
findtime = 3600 ; 1 hour
@YannRobert
YannRobert / init-graphite-container-volumes.sh
Last active Mar 1, 2016
initialisation of volumes for graphite container hopsoft/graphite-statsd
View init-graphite-container-volumes.sh
#!/bin/sh
set -e
set -x
LOG_DIR=$HOME/graphite-volumes/var-log
DATA_DIR=$HOME/graphite-volumes/graphite-storage
VOLUMES_INIT_CONTAINER_NAME=graphite-volumes-init
@YannRobert
YannRobert / IssueInRxJavaDefensiveCodeTest.java
Created Mar 30, 2015
Does the defensive code in RxJava "merge" operator could be improved?
View IssueInRxJavaDefensiveCodeTest.java
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import rx.Observable;
import rx.Observer;
import rx.subjects.PublishSubject;
import rx.subjects.Subject;
import java.util.concurrent.CountDownLatch;
View CrockfordBase32.java
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>
*
You can’t perform that action at this time.