Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / main_test.go
Last active April 24, 2024 15:11
TestContainers - Forward test
package tcgot
import (
"context"
"errors"
"fmt"
"io"
"log"
"net/http"
"strings"
@JulienBreux
JulienBreux / aliases.sh
Last active September 7, 2023 04:13
Kubernetes term aliases
# Used to run minikube shortly
alias mk="minikube"
# Used to run kubectl shortly
alias k="kubectl"
# Used to get ...
alias kg="kubectl get"
# Used to get all pods
@JulienBreux
JulienBreux / _etc_nginx_sites-enabled_default
Last active June 28, 2023 15:58
Istio Minimal Config To External HTTPS
server {
# listen 80 default_server;
# listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/self-signed.conf;
root /var/www/html;
@JulienBreux
JulienBreux / Dockerfile
Last active May 14, 2022 21:31
Multi-stage builds example
# @see https://github.com/JulienBreux/tuto-go-docker-ms
FROM golang:1.9-alpine as builder
WORKDIR /go/src/github.com/JulienBreux/tuto-go-docker-ms/
RUN apk --update add ca-certificates
# RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM scratch
@JulienBreux
JulienBreux / tracing-jaeger-ok.overlay.yaml
Last active February 7, 2022 11:44
Istio tracing Jaeger for ASM example
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
meshConfig:
enableTracing: true
defaultConfig:
tracing:
sampling: 100
values:
@JulienBreux
JulienBreux / BlockTags.php
Created April 2, 2012 22:41
PrestaShop 1.5.x - Module override in themes
<?php
/**
* Example of override of Block Tags module
*
* @version 1.0.0
* @author Julien BREUX <julien.breux@prestashop.com>
*/
class BlockTagsTheme extends BlockTags
{
//...
@JulienBreux
JulienBreux / CKA.md
Last active July 1, 2021 11:59
CKA-07-2021 - Certification Kubernetes Administrator

JSON Path

Get restart count from container name

$.status.containerStatuses[?(@.name == 'xxx-container')].restartCount

Print node addresses

$.items[*].status.addresses[?(@.type=="InternalIP")].address
@JulienBreux
JulienBreux / go1.16-golang.md
Created February 20, 2021 11:04
How to get Go (golang) 1.16 without wasting time

How to get Go (golang) 1.16 without wasting time

go get golang.org/dl/go1.16
go1.16 download

go1.16 version

@JulienBreux
JulienBreux / Dockerfile
Created February 10, 2015 07:09
Docker + Rails + Redis + Postgres
# base on latest ruby base image
FROM ruby:latest
# update and install dependencies
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libpq-dev nodejs apt-utils postgresql-client
# setup app folders
RUN mkdir /sample
WORKDIR /sample
@JulienBreux
JulienBreux / read-access.sql
Last active February 18, 2020 17:24 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT CONNECT ON DATABASE _database_name_ TO readaccess;
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO readaccess;
-- Grant access to future tables