Skip to content

Instantly share code, notes, and snippets.

View barmic's full-sized avatar

Michel barmic

  • Grenoble
View GitHub Profile
@barmic
barmic / helm-namespace.md
Created March 29, 2023 06:39
Description helm

Notre situation actuelle c'est que notre code est déployé dans un namespace sun-dev, mais les releases helm2 sont stockées dans le namespace default.

 helm2 list
NAME   	REVISION	UPDATED                 	STATUS  	CHART                   	APP VERSION	NAMESPACE
sun-dev	3362    	Tue Mar 28 16:32:46 2023	DEPLOYED	sun-2023.13.03280830-sid	           	default

Helm préconise particulièrement, depuis que tiller n'est plus là, de stocker les releases dans le même namespace que le code (Changes since helm2).

@barmic
barmic / chalenge.py
Created August 25, 2022 20:53
python chalenge
def find_quadruplet_sum(numbers, target):
'''
Finds four integers within `numbers` whose sum amounts to
exactly `target`, and returns them.
There will always be a valid quadruplet, and the same number
can be picked several times.
'''
for a in numbers:
for b in numbers:
@barmic
barmic / .gitconfig
Last active December 9, 2021 16:11
Git configuration
[user]
name = Michel Barret
[alias]
st = status --short --branch
co = checkout
br = branch
brv = branch -vv
pushf = push --force-with-lease
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset' --abbrev-commit
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
#!/bin/zsh
c=$(git branch | grep -c -- "$1")
if [[ "$c" -eq 1 ]]; then
git checkout $(git branch | grep -- "$1")
else
echo "Pattern \"$1\" is ambigus"
git branch | grep --color -- "$1"
fi
@barmic
barmic / HealthCheck.java
Last active January 20, 2023 08:19
Healthcheck
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HealthCheck {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
@barmic
barmic / test
Last active April 14, 2021 15:07
<PCR ... Type="THIS">
<MD>
<V ... ATTR="FOO" ...>42</Value>
</MD>
</PCR>
@barmic
barmic / cd.sh
Created July 9, 2020 14:01
zsh quick tips
setopt AUTOCD # Faire un cd sans cd
# Permet d'ajouter les répertoires dans les quels on navigue dans une pile
# de manière automatique. S'utilise avec cd -<tab> (cd -2 permet d'aller dans l'avant dernier dossier parcouru)
setopt AUTO_PUSHD
setopt PUSHDMINUS
# permet de créer un racourcis vers un dossier à utiliser ~plouf
hash -d plouf="${HOME}/fold1/fold2/fold3/"
@barmic
barmic / autofill.js
Last active August 14, 2020 06:46
userscript
// ==UserScript==
// @name AutoFill Push
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://qlf-sun-admin.sfr.com/sun/push/ng/bundles/*/campaigns/add/*
// @match https://sun-admin.sfr.com/sun/push/ng/bundles/*/campaigns/add/*
// @match https://dev-sun-admin.inovatel.com/sun/push/ng/bundles/*/campaigns/add/*
// @grant none
@barmic
barmic / tarsnap.sh
Created April 13, 2020 14:25
Tarsnap config
#!/bin/bash
# install in /etc/NetworkManager/dispatcher.d/02tarsnap
IF=$1
STATUS=$2
RETENTION_DAYS=7
RETENTION_COUNT=5
[[ "$STATUS" != 'up' ]] && exit
@barmic
barmic / doodle.txt
Created December 19, 2019 08:48
Doodle Noël 2020
Non je rigole on va attendre un peu tout de même ;)