Skip to content

Instantly share code, notes, and snippets.

🇫🇷
⁉️ 🅰️ 🐍 🐳 ☸️ ☯️

Alexandre Garnier zigarn

🇫🇷
⁉️ 🅰️ 🐍 🐳 ☸️ ☯️
Block or report user

Report or block zigarn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View resume.json
{
"basics": {
"name": "Alexandre Garnier",
"label": "IT Consultant",
"picture": "https://www.zigarn.com/avatar.jpg",
"website": "https://www.zigarn.com",
"summary": "IT consultant, DevOps thinking addict.",
"location": {
"city": "Paris",
"countryCode": "FR"
@zigarn
zigarn / Vagrantfile
Last active Jul 29, 2018
Vagrantfile mDNS
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby expandtab shiftwidth=2 :
# Add time logging
def $stdout.write string
log_datas=string
if log_datas.gsub(/\r?\n/, '') != ''
log_datas=::Time.now.strftime('%FT%T%z')+' '+log_datas.gsub(/\r\n/, '\n')
end
super log_datas
@zigarn
zigarn / 01-docker-tls.sh
Last active Apr 29, 2019
Generate Docker certificates for training on TLS
View 01-docker-tls.sh
# Configuration
export PUBLIC_DNS=<public hostname>
export PUBLIC_IP=<public host IP>
export PRIVATE_IP=<private host IP>
mkdir docker-ca
chmod 0700 docker-ca/
cd docker-ca/
# CA key
View Windows_symlink.md
View git_log_path_bug.sh
#!/bin/sh
git init --q repo
cd repo
python -c "import random; print '\n'.join([' '.join([word.replace('\n', '') for word in random.sample(list(open('/usr/share/dict/words')), 10)]) for _ in range(50)])" >> file
git add file
git commit -qm "Initial commit"
sed -i '15s/[eiouy]/a/' file
git commit -aqm "Change line 15 on master"
View git_find_duplicates.sh
git ls-tree -r HEAD^{tree} \ # list files
| grep -v '^120000 ' \ # ignore symlinks
| cut -d " " -f 3- \ # remove columns 1 and 2 (mode and type)
| sort -k1 -k2 \ # sort
| awk 'BEGIN { FS = " " } { count[$1]++; if (count[$1] == 1) {first[$1] = $0;}; if (count[$1] == 2) {print "-"; print first[$1];}; if (count[$1] > 1) {print} }' # list duplicates
View register.py
#
# script to register Python 2.6 or later for use with win32all
# and other extensions that require Python registry settings
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
# modified by Alexandre Garnier to also work for Python 3
View fk_deps.sql
select
src_cc.owner as src_owner, src_cc.table_name as src_table, src_cc.column_name as src_column,
dest_cc.owner as dest_owner, dest_cc.table_name as dest_table, dest_cc.column_name as dest_column,
c.constraint_name
from
all_constraints c
inner join all_cons_columns dest_cc on c.r_constraint_name = dest_cc.constraint_name and c.r_owner = dest_cc.owner
inner join all_cons_columns src_cc on c.constraint_name = src_cc.constraint_name and c.owner = src_cc.owner
where
c.constraint_type = 'R'
You can’t perform that action at this time.