Skip to content

Instantly share code, notes, and snippets.

View benoitMariaux's full-sized avatar
🏠
Working from home

Benoît Mariaux benoitMariaux

🏠
Working from home
  • Amazon Web Services
  • Paris - France
View GitHub Profile
@benoitMariaux
benoitMariaux / bedrock.py
Created December 6, 2023 16:12
Amazon Bedrock invocation example in Python
import json
import boto3
my_session = boto3.session.Session()
my_region = my_session.region_name
# check you are in us-east-1 region (for now)
print(my_region)
bedrock_runtime = boto3.client('bedrock-runtime')
@benoitMariaux
benoitMariaux / assume-role.sh
Created September 6, 2022 13:42
AWS, assume a role for CLI usage
#!/bin/bash
YOUR_ACCOUNT=XXX
YOUR_ROLENAME=XXXXXXX
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN
OUT=$(aws sts assume-role --role-arn arn:aws:iam::$YOUR_ACCOUNT:role/$YOUR_ROLENAME --role-session-name aaa);\
@benoitMariaux
benoitMariaux / purge.py
Created April 7, 2021 22:08
Remove all Cloudformation Stacks, but make empty ECR repositories before
import botocore, boto3
ecr = boto3.client('ecr')
repos = ecr.describe_repositories()
for repo in repos['repositories']:
images = ecr.list_images(repositoryName=repo['repositoryName'])
if bool(images['imageIds']) == True:
ecr.batch_delete_image(
# Give me next n sprints for JIRA
import datetime
# First, edit here
first_sprint = 'Sprint 9: 0210-1610'
current_sprint_number = 9
current_sprint_start = datetime.datetime(2019, 10, 2)
current_sprint_end = datetime.datetime(2019, 10, 16)
######################################################

Keybase proof

I hereby claim:

  • I am benoitmariaux on github.
  • I am benoitmariaux (https://keybase.io/benoitmariaux) on keybase.
  • I have a public key ASBH2UFzVX68F1XAnfS87WqDcDzZ3HcY4WU52O-svY4xUQo

To claim this, I am signing this object:

function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
UPDATE ecomm_tax SET value = 0.1, name="TVA 10 %" WHERE value = 0.07 OR value = 0.1;
UPDATE ecomm_tax SET value = 0.2, name="TVA 20 %" WHERE value = 0.196 OR value = 0.2;
# Annuler les corrections pour Blondel
UPDATE ecomm_product SET tax_id = 109 WHERE tax_id = 117 AND site_id = 1260;
DELETE FROM ecomm_tax WHERE id = 117 AND site_id = 1260;
#######################################
# Si T.T.C doit rester identique
SET @site := 1260; # Changer cette valeur
127.0.0.1 testweb.fr
127.0.0.1 basesite.testweb.fr
127.0.0.1 inscription.testweb.fr admin.testweb.fr
127.0.0.1 old-major.testweb.fr napolean.testweb.fr snowball.testweb.fr squealer.testweb.fr
127.0.0.1 minimus.testweb.fr
Symfony > doctrine:migrations:migrate
Application Migrations
WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)y
Migrating up to 20131203165923 from 20131108083116
++ migrating 20131129111111