Skip to content

Instantly share code, notes, and snippets.

View sjeandeaux's full-sized avatar
👤

Stephane Jeandeaux sjeandeaux

👤
View GitHub Profile
@sjeandeaux
sjeandeaux / github-action-docker.yaml
Created September 9, 2022 07:47
Github Action and Google Workload Identity
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v2
- id: auth
uses: google-github-actions/auth@v0.8.1
@sjeandeaux
sjeandeaux / command-lines.sh
Created May 25, 2021 13:40
useful command lines
# generate an uuid
uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '\n' | pbcopy
@sjeandeaux
sjeandeaux / postgresql.md
Last active July 20, 2021 17:41
postgresql

Queries

SELECT state, 
       pid,
       timezone('Europe/Paris', query_start), 
       usename, 
       substring(query,1, 20)
FROM pg_stat_activity
WHERE 
@sjeandeaux
sjeandeaux / main.go
Last active September 12, 2019 18:43
Flatten an array. You can play with it here => https://play.golang.org/p/Y2PbROlvyNF
package main
import (
"fmt"
"reflect"
)
//flatten it flattens the array
//It returnes the flatten array.
func flatten(toFlatten []interface{}) []interface{} {
@sjeandeaux
sjeandeaux / keytool-sslserver-import.sh
Created April 27, 2019 02:25
Import certificate from server (hostname and port)
server=google.com
server=443
alias=alias
password=changeit
keytool -printcert -sslserver ${server}:${port} -rfc > tempfile
keytool -import -noprompt -alias ${alias} -keystore knox.jks -storepass ${password} < tempfile
{
"name": "yum-proxy",
"type": "groovy",
"content": "def request = new groovy.json.JsonSlurper().parseText(args); repository.createYumProxy(request.name, request.url);"
}
%echo Generating a basic OpenPGP key
Key-Type: RSA
Key-Length: 2048
Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: Sponge Bob
Name-Comment: Patrick
Name-Email: bob.sponge@squarepants.com
Expire-Date: 666
passphrase: a best passphrase
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
set -o xtrace
@sjeandeaux
sjeandeaux / Makefile
Created May 6, 2018 14:58
Makefile and help
help: ## this help
@grep -hE '^[a-zA-Z_-]+.*?:.*?## .*$$' ${MAKEFILE_LIST} | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
goal1: ## goal1 the goal#
echo goal1
goal2: goal1 ## goal2 the goal#
echo goal2
@sjeandeaux
sjeandeaux / Makefile
Created February 22, 2018 21:02
Makefile AWS lambda golang
SRC_DIR=
BUILD_VERSION=$(shell cat VERSION.txt)
#Default application or lambda
APPL?=<your lambda in cmd>
######## commom
PKGGOFILES=$(shell go list ./... | grep -v /vendor/)
CMD_TO_BUILD := ${sort ${dir ${wildcard ./cmd/*/}}}