Skip to content

Instantly share code, notes, and snippets.

Avatar

Vandeputte Brice boly38

View GitHub Profile
@boly38
boly38 / README.md
Last active Nov 29, 2021
Use KeePass from command line (KPScript plugin) in order to generate project secrets file
View README.md

Use Keepass to store and generates env file

Scripts

  • keepassEnv.sh is linux-compatible (also git bash for windows works)
  • keepassEnv.bat is windows-compatible (could be improved)
  • keepassCheckout.sh is linux-compatible and allow to read multiple files in one shoot

each script may be self-documented

Usage

@boly38
boly38 / rabbitStateAndPurge.sh
Last active Aug 13, 2019
shell script to state and purge RabbitMQ queues using RabbitMQ Management HTTP API (https://pulse.mozilla.org/api/) and Jq JSON Processor (https://stedolan.github.io/jq/) #rabbitmq #purge #bash #script #jq #json
View rabbitStateAndPurge.sh
#!/bin/bash
#
# This Gist is under MIT License
#
# Copyright 2018 Orange - Brice Vandeputte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
@boly38
boly38 / NetUtils.java
Last active Feb 10, 2019
Java Simple Socket Check
View NetUtils.java
package com.github.gist.it;
import java.net.InetSocketAddress;
import java.net.Socket;
public class NetUtils {
/**
* check if a given server is listening on a given port in the limit of timeoutMs
* @param serverHost server hostname (or ip)
@boly38
boly38 / ldjson_1_article_N_comments_using_graph.json
Created Jul 5, 2018
Repeating Comment in JSON-LD Article (Schema.org specifications)
View ldjson_1_article_N_comments_using_graph.json
{
"@context": "http://schema.org",
"@graph": [
{
"@type": "Article",
"@id": "/articles/foobar",
"url" : "https:\/\/exemple.com/article?id=1234",
"author" :{"@type" : "Person","name" : "Didier"},
"image" : "https:\/\/exemple.com/article.jpg",
"mainEntityOfPage" : "https:\/\/exemple.com",
@boly38
boly38 / ldjson_escape_room.html
Last active Jun 28, 2018
Gist describing constraint for ld-json string value
View ldjson_escape_room.html
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>json slash try</title></head>
<body>
I am a sample html body
with embedded ld+json (between lines X and X')<br/>
@boly38
boly38 / getCertificate.sh
Created Oct 20, 2017
quennec.fr/trucs-astuces getCertificate.sh
View getCertificate.sh
#!/bin/sh
# source d'origine: src: https://www.quennec.fr/trucs-astuces/syst%C3%A8mes/gnulinux/commandes/openssl/openssl-r%C3%A9cup%C3%A9rer-un-certificat-distant
# améliorations:
# - quitter après 2 secondes
# - report du stdout
HOST=$1
PORT=${2:-443}
openssl s_client -connect ${HOST}:${PORT} > .workout &
View EnvBasedProxyRoutePlanner.java
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.conn.SchemePortResolver;
import org.apache.http.impl.conn.DefaultRoutePlanner;
import org.apache.http.protocol.HttpContext;
import org.slf4j.LoggerFactory;
/**
* ***[recommended]**** Use System default planner like this :
@boly38
boly38 / Code.gs
Created Jul 30, 2015
Google appscript to delete mail older thant N days and having a given label
View Code.gs
function deleteOldMailFromTag() {
// push this function onto https://script.google.com/
// to make a dry run, set sendReport to true, and removeMail to false.
//
// common config
var sendReport = true; // send script execution log by email
var removeMail = false; // set it to true only after strong tests :)
var tag = 'myLabel';
var minAge = '30d';
View MANIFEST.MF
Manifest-Version: 1.0
Created-By: Brice (by hand)
Build-Jdk: 1.4.2_19
Specification-Title: XStream Core and Jettison
Specification-Vendor: XStream Jettison
Implementation-Title: XStream Core
Implementation-Version: 1.4.2
Implementation-Vendor-Id: com.thoughtworks.xstream
Implementation-Vendor: XStream
Specification-Version: 1.4
@boly38
boly38 / Readme.md
Last active Dec 27, 2015
a maven profile called "stats" used to log some maven lifecycle steps
View Readme.md

"stats" maven profile

this profile simply append step datetime in a file called stats.log

Installation

  • add stats profile to your pom.xml