Skip to content

Instantly share code, notes, and snippets.

View yogeek's full-sized avatar

Guillaume Dupin yogeek

View GitHub Profile
@yogeek
yogeek / zsh_aliases
Last active May 18, 2022 12:27
K8S utils
# kube-ps1
export KUBE_PS1_SYMBOL_USE_IMG=true
#---------------------------------------------------------
# Aliases
#---------------------------------------------------------
alias k='kubectl'
alias kc='kubectx'
alias kn='kubens'
alias kgp='kubectl get po'
@yogeek
yogeek / velero-pod-previous-log.txt
Created August 3, 2021 08:23
Velero github #4003
time="2021-08-03T07:00:57Z" level=info msg="setting log-level to INFO" logSource="pkg/cmd/server/server.go:172"
time="2021-08-03T07:00:57Z" level=info msg="Starting Velero server v1.6.2 (8c9cdb9603446760452979dc77f93b17054ea1cc)" logSource="pkg/cmd/server/server.go:174"
time="2021-08-03T07:00:57Z" level=info msg="No feature flags enabled" logSource="pkg/cmd/server/server.go:178"
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/crd-remap-version
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/pod
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/pv
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg
initContainers:
- command:
- sh
- -c
- id; whoami; mkdir /tmp/bench; /bin/thanosbench block plan -p continuous-365d-tiny
--max-time=6h | /bin/thanosbench block gen --output.dir /tmp/bench; cp -r /tmp/bench/*
/prometheus
image: quay.io/thanos/thanosbench:v0.2.0-rc.1
name: prom-init-thanosbench
volumeMounts:
@yogeek
yogeek / github-cli.sh
Last active April 26, 2021 17:29
github-cli.sh
#########
# Setup #
#########
# Install `gh` CLI
# - With https://github.com/asdf-vm/asdf :
asdf plugin add github-cli
asdf install github-cli latest
@yogeek
yogeek / grafana-plugins.log
Created August 10, 2020 15:27
China test
ubuntu@ip-10-20-102-176:~$ curl -L https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.0/download -o p.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 140 100 140 0 0 170 0 --:--:-- --:--:-- --:--:-- 170
100 469k 0 469k 0 0 60341 0 --:--:-- 0:00:07 --:--:-- 50094
ubuntu@ip-10-20-102-176:~$ curl -L https://grafana.com/api/plugins/camptocamp-prometheus-alertmanager-datasource/versions/0.0.8/download -o cp.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
@yogeek
yogeek / crash.log
Created August 10, 2020 10:37
Terraform crash provider-aws 3.1.0
2020/08/10 11:33:54 [INFO] Terraform version: 0.12.29
2020/08/10 11:33:54 [INFO] Go runtime version: go1.12.13
2020/08/10 11:33:54 [INFO] CLI args: []string{"/home/user/.tfenv/versions/0.12.29/terraform", "plan", "-var", "tag_repository_url=git@XXXXX.git", "-var", "tag_commit_id=018fa1bb0e6014dd23bed805ba1624965fa2c3a4", "-var", "account_id=XXXXX", "-var-file=images.tfvars"}
2020/08/10 11:33:54 [DEBUG] Attempting to open CLI config file: /home/user/.terraformrc
2020/08/10 11:33:54 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/08/10 11:33:54 [DEBUG] checking for credentials in "/home/user/.terraform.d/plugins"
2020/08/10 11:33:54 [INFO] CLI command args: []string{"plan", "-var", "tag_repository_url=git@XXXXX.git", "-var", "tag_commit_id=018fa1bb0e6014dd23bed805ba1624965fa2c3a4", "-var", "account_id=XXXXX", "-var-file=images.tfvars"}
2020/08/10 11:33:54 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 3112734546
2020/08/10 11:33:54 [TRACE] Preserving existing state
#!/bin/bash
REPOS=$(aws ecr describe-repositories --query 'repositories[].repositoryName' --output text)
for repo in $REPOS; do
TAGS=$(aws ecr list-images --repository-name $repo --query 'imageIds[].imageDigest' --output text)
for tag in $TAGS; do
echo "Deleting image: $tag"
aws ecr batch-delete-image --repository-name $repo --image-ids imageDigest=$tag
done
done
@yogeek
yogeek / zsh_aliases
Created March 14, 2019 09:28
ALIASES
# Personnal aliases
#
######
# Go
######
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
####################
@yogeek
yogeek / journalctl
Created January 28, 2020 13:45
System
# Clear all journactl logs
journalctl --rotate
journalctl --vacuum-time=1s
# Clear only archived logs
journalctl --vacuum-time=2d
journalctl --vacuum-size=50M
@yogeek
yogeek / prometheus-adapter.yaml
Created November 14, 2019 18:52 — forked from rekcah78/prometheus-adapter.yaml
prometheus-adapter helm chart values
rbac:
create: true
prometheus:
url: http://linkerd-prometheus.linkerd.svc.cluster.local
port: 9090
rules:
default: false
custom:
- seriesQuery: 'response_latency_ms_bucket{namespace!="",pod!=""}'
resources: