Skip to content

Instantly share code, notes, and snippets.

View jbarotin's full-sized avatar
😃

Jérôme BAROTIN jbarotin

😃
  • Lorient, France
View GitHub Profile
@jbarotin
jbarotin / SeaweedCaseTest.java
Created September 6, 2021 16:00
Sensitive test case
package seaweedfs.client;
import org.junit.Test;
import java.io.IOException;
import java.util.List;
public class SeaweedCaseTest {
@jbarotin
jbarotin / SeaweedWriteTest.java
Last active August 26, 2021 08:34
Unit test KO for check size on java client of seaweed
package seaweedfs.client;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class SeaweedWriteTest {
@Test
@jbarotin
jbarotin / Perf.java
Last active July 13, 2021 15:55
This objet help to highlight a "memory leak" of the seaweedfs java client (launch with args "100 50" for example)
package seaweed.test;
import seaweedfs.client.FilerClient;
import seaweedfs.client.SeaweedOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@jbarotin
jbarotin / seaweedfs.py
Last active May 7, 2021 12:16
Seaweedfs filer REST API cli
import requests
import sys
import configparser
import json
import pathlib
#
# cli that aim to query the filer REST API
# setup a ~/.seaweedfs.cfg
#
#!/usr/bin/python3
# this script aim to renew an ovh dyndns record
# it musts be executed in cron.
# first it check if DNS is up-to-date
# and then if necessary update the IP
#
# it needs two python packages : requests and dnspython
@jbarotin
jbarotin / ExampleTimer.java
Last active April 10, 2020 18:58
"Full" implementation of "Scheduling messages to self" example Akka 2.6.4
package s4e.scheduler;
import akka.actor.typed.ActorRef;
import akka.actor.typed.ActorSystem;
import akka.actor.typed.Behavior;
import akka.actor.typed.Terminated;
import akka.actor.typed.javadsl.AbstractBehavior;
import akka.actor.typed.javadsl.ActorContext;
import akka.actor.typed.javadsl.Behaviors;
import akka.actor.typed.javadsl.Receive;
@jbarotin
jbarotin / reboot_scaleway_baremetal.py
Created February 4, 2019 08:44
Scrtipt that aim to reboot a Scaleway bare metal instance
# -*- encoding: utf-8 -*-
#
# This script aim to reboot list of scaleway baremetal instance
#
# prerequisite are the following :
# - scw cli installed and can be found in PATH
# - root ssh key access without password
# - vm os is debian based
# - python 3.6 minimum
#
@jbarotin
jbarotin / Expr.g4
Created May 9, 2017 12:57
A big antlr4 file grammar description that not work
grammar Expr;
prog: (formula NEWLINE)* ;
formula: expr (LOGICAL expr)*;
expr : expr_real
| '(' expr_real ')';
expr_real : 'A' OPERATOR A_value
| 'A' IN '(' A_value (',' A_value )* ')'
'B' OPERATOR B_value