Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Poignant thomaspoignant

View GitHub Profile
View tunnel_thew_bastion.sh
# 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 Aug 29, 2018
Update the number of container in ECS
View update-ecs-services-count.sh
#!/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
@thomaspoignant
thomaspoignant / gist:d873a544ebd488687b207138a29d55c4
Created Jan 10, 2019
pour lancer react-native sur windows 10
View gist:d873a544ebd488687b207138a29d55c4
npm install --global --production windows-build-tools
View il_part_avec_toutes_les_sources.sh
#!/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)
View scimUsers.json
[
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "id_1",
"userName": "thomas",
"name": {
"familyName": "Poignant",
"givenName": "Thomas"
View sortTest.js
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);
View scim_patch_request_example.json
{ "schemas":
["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":[
{
"op":"add",
"path":"members",
"value":[
{
"display": "Babs Jensen",
"$ref":
View HitCounter.java
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 Jun 11, 2020
Test your scim integration using api-scemario
View scim-scenario-run.sh
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" \