Skip to content

Instantly share code, notes, and snippets.

View thomaspoignant's full-sized avatar

Thomas Poignant thomaspoignant

View GitHub Profile
# 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 / 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
Console tools !
https://remysharp.com/2018/08/23/cli-improved
@thomaspoignant
thomaspoignant / gist:d873a544ebd488687b207138a29d55c4
Created January 10, 2019 11:16
pour lancer react-native sur windows 10
npm install --global --production windows-build-tools
#!/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)
[
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "id_1",
"userName": "thomas",
"name": {
"familyName": "Poignant",
"givenName": "Thomas"
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:api:messages:2.0:PatchOp"],
"Operations":[
{
"op":"add",
"path":"members",
"value":[
{
"display": "Babs Jensen",
"$ref":
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.
*/
@thomaspoignant
thomaspoignant / scim-scenario-run.sh
Last active June 11, 2020 12:59
Test your scim integration using api-scemario
api-scenario run \
--scenario=scim-scenario.json \
--variable="auth:token" \
--variable="SCIMBaseURL:http://localhost:3000"\
--variable="InvalidUserEmail:invalid@invalid.com" \
--variable="UserIdThatDoesNotExist:id_invalid" \
--variable="randomEmail:random@valid.com" \
--variable="randomUsername:randomUsername" \
--variable="randomGivenName:randomGivenName" \
--variable="randomFamilyName:randomFamilyName" \