Skip to content

Instantly share code, notes, and snippets.

View thomaspoignant's full-sized avatar

Thomas Poignant thomaspoignant

View GitHub Profile
package com.tpoi.monitoring.service;
import java.time.Instant;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* HitCounter count the number of request in a specific range of time.
*/
{ "schemas":
["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":[
{
"op":"add",
"path":"members",
"value":[
{
"display": "Babs Jensen",
"$ref":
const {compileSorter} = require('scim-query-filter-parser');
const {performance} = require('perf_hooks');
const request = require('request');
const scimUsersFile = 'https://gist.githubusercontent.com/thomaspoignant/471a159501bd4eb7b3499d38f81f927d/raw/bac8e75141e24adf4a372c56ebf0adc78578058f/scimUsers.json';
request.get(scimUsersFile, function (error, response, body) {
if (!error && response.statusCode === 200) {
const scimUsers = JSON.parse(body);
[
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "id_1",
"userName": "thomas",
"name": {
"familyName": "Poignant",
"givenName": "Thomas"
#!/bin/bash
BITBUCKET_BASE_URL=https://bitbucket.xxxx.fr
CURL_RESULT=$(curl -u $USER:$PASSWORD $BITBUCKET_BASE_URL/rest/api/1.0/projects\?limit\=100 | jq -c .values)
FOLDERS=$(echo $CURL_RESULT | jq -r '.[]' | jq -r .key)
for KEY in $FOLDERS
do
mkdir $KEY
cd $KEY
REPO_IN_FOLDER=$(curl -u $USER:$PASSWORD $BITBUCKET_BASE_URL/rest/api/1.0/projects/$KEY/repos\?limit\=100 | jq -r .values[] | jq .links | jq -c '.clone[]' | jq -r .href | grep https)
@thomaspoignant
thomaspoignant / gist:d873a544ebd488687b207138a29d55c4
Created January 10, 2019 11:16
pour lancer react-native sur windows 10
npm install --global --production windows-build-tools
Console tools !
https://remysharp.com/2018/08/23/cli-improved
@thomaspoignant
thomaspoignant / update-ecs-services-count.sh
Created August 29, 2018 14:48
Update the number of container in ECS
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "Usage : ${0} <Environement> <Classifier> <Desired number of Services instances>"
echo " Envionnement : dev / qua / pre / ppd / for"
echo " Classifier : 1 or 2"
return
fi
#Bind input parameters
# This command allow to connect to a database threw a bastion
# dns.db.instance = dns to the db instance
# user = user to connect via ssh on the bastion
# dns.bastion = dns to connect the bastion
ssh -i /path/ssh_key/dev.pem -N -L 5432:dns.db.instance:5432 user@dns.bastion
@thomaspoignant
thomaspoignant / automatic_proxy_setup_from_zscaller.sh
Created July 17, 2018 12:55
Get your proxy configuration in bash directly from zscaller .pac file
PROXY=http://$(curl -q http://pac.zscalertwo.net/XXX/proxypac-prod.pac 2>/dev/null | grep "PROXY" | grep -oP "\b(?:\d{1,3}\.){3}\d{1,3}\b:[0-9]*" | head -n 1)
echo "SETTING PROXY : $PROXY"
export HTTP_PROXY=$PROXY
export HTTPS_PROXY=$PROXY
export http_proxy=$PROXY
export https_proxy=$PROXY