Skip to content

Instantly share code, notes, and snippets.

View barmic's full-sized avatar

Michel barmic

  • Grenoble
View GitHub Profile
@barmic
barmic / test
Last active April 14, 2021 15:07
<PCR ... Type="THIS">
<MD>
<V ... ATTR="FOO" ...>42</Value>
</MD>
</PCR>
@barmic
barmic / HealthCheck.java
Last active February 16, 2025 22:49
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()
#!/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 / .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' -
@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 / 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).