Skip to content

Instantly share code, notes, and snippets.

View valentin2105's full-sized avatar

Valentin Ouvrard valentin2105

View GitHub Profile
@valentin2105
valentin2105 / curl-k8s-internal-pod.sh
Created February 19, 2024 23:02
curl Kube-API from a pod via service-account
curl https://${KUBERNETES_SERVICE_HOST} \
--header "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
#!/bin/bash
mkdir -p Configs ||true
python3 wg.py status |grep 'Client:' | while read a b c
do
python3 wg.py config $b | sed "s/b'//g; s/\\\\n/\n/g" > Configs/$c.conf
done
@valentin2105
valentin2105 / portainer.sh
Last active July 10, 2023 01:35
Install Portainer
docker volume rm portainer_data
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 \
--name portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:latest
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@valentin2105
valentin2105 / volume_provision.sh
Created November 3, 2017 22:23
Kubernetes Auto GlusterFS PV creation
#!/bin/bash
glusterName=glusterfs-cluster
glusterEP=10.240.0.10
glusterNode01Path=gluster01:/storage-pool
glusterNode02Path=gluster02:/storage-pool
while true; do
check=$(kubectl get pvc --all-namespaces --no-headers |grep Pending | head -1)
@valentin2105
valentin2105 / http-tls.go
Created June 16, 2017 02:38
tls Go base/http
// main.go
package main
import (
"crypto/tls"
"log"
"net/http"
)
@valentin2105
valentin2105 / ferm-docker.conf
Created May 5, 2017 09:42
Ferm for Docker (IPv4 only)
# -*- shell-script -*-
#
# Configuration file for ferm(1).
#
# Chain policies
# We define our Docker IPv4 ranges
@def $DOCKER_RANGE = (172.16.0.0/12);
# We drop INPUT/FORWARD by default and ACCEPT output
@valentin2105
valentin2105 / iterm2-solarized.md
Created December 25, 2016 23:46 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)

Solarized

@valentin2105
valentin2105 / letsencrypt-auto
Last active November 9, 2016 23:59
certbot install
#!/bin/sh
#
# Download and run the latest release version of the Certbot client.
#
# NOTE: THIS SCRIPT IS AUTO-GENERATED AND SELF-UPDATING
#
# IF YOU WANT TO EDIT IT LOCALLY, *ALWAYS* RUN YOUR COPY WITH THE
# "--no-self-upgrade" FLAG
#
# IF YOU WANT TO SEND PULL REQUESTS, THE REAL SOURCE FOR THIS FILE IS
@valentin2105
valentin2105 / ha-wordpress.service
Last active March 19, 2021 09:09
High-Available Wordpress PoC on Docker Swarm 1.12.x with MariaDB Galera cluster.
#! /bin/bash
wordpressPath=/srv/wp01
wordpressName=wordpress01
wordpressPwd=pAssw0rd
wordpressUrl=wordpress01.example.com
##################################
mkdir -p "$wordpressPath"/db