Skip to content

Instantly share code, notes, and snippets.

View thydel's full-sized avatar

Thierry Delamare thydel

  • Epiconcept
  • Paris France
View GitHub Profile
@thydel
thydel / mini.sh
Last active March 14, 2022 23:01
bash pseudo namespace and remote execution lib
#!/bin/bash
# pseudo namespace and remote execution lib
shopt -s expand_aliases
################ bootstrap
std.fail () { unset -v fail; : "${fail:?${FUNCNAME[1]} $@}"; }
std.assert () { $@ || std.fail "$@"; }
@thydel
thydel / vsphere_info.py
Created May 7, 2018 12:48 — forked from deviantony/vsphere_info.py
VMWare Vsphere info in Python using pyvmomi
#!/usr/bin/env python
import pyVmomi
import argparse
import atexit
import itertools
from pyVmomi import vim, vmodl
from pyVim.connect import SmartConnect, Disconnect
import humanize
@thydel
thydel / fix_eoi.py
Created February 26, 2018 13:05 — forked from bcyrill/fix_eoi.py
Python script to inject the EOI marker into panoramic photos created by the S7 camera. In addition the script allows to dump the Samsung specific data that is added to the image
#!/usr/bin/python
# The Samsung trailer format is based on the implementation from ExifTool
# http://www.sno.phy.queensu.ca/~phil/exiftool/
import mmap
import struct
import os
import sys
@thydel
thydel / infra-gitignore.txt
Last active January 24, 2017 17:51
gitignore skeleton for typical infra playbook
*~
.cache/
.retry/
.hide/
roles/
log/
tmp/
ext/
@thydel
thydel / .gitignore
Last active March 23, 2017 18:11
github helper
*~
.mailmap
@thydel
thydel / gist-helper.mk
Last active June 24, 2020 08:14
gist helper
#!/usr/bin/make -f
make := $(lastword $(MAKEFILE_LIST))
$(make): pass-dummy;
SHELL := bash
.DEFAULT_GOAL := main
main:; @date
####
@thydel
thydel / ssh-config-github
Created January 3, 2017 11:10
Use multiple github accounts
Host *.github.com
Hostname github.com
Host thydel.github.com
IdentityFile ~/.ssh/id_thydel
Host thyepi.github.com
IdentityFile ~/.ssh/id_thyepi
Host *.gist.github.com
@thydel
thydel / init-play-dir.yml
Last active March 9, 2017 11:05
Init playbook dir helper
#!/usr/bin/env ansible-playbook
---
- hosts: localhost
gather_facts: True
vars:
use_filter_plugins: False
use_ssh_config: False
ansible_managed_for_copy: Ansible managed
@thydel
thydel / ansible.mk
Last active March 15, 2017 22:26
Use ansible from git helper
#!/usr/bin/make -f
top:; @date
Makefile:;
# get various ansible versions
base := ~/usr/ext
version := devel
@thydel
thydel / ln-log.mk
Last active March 15, 2022 14:01
Link log from deep to flat
top:; @date
log := find /space/log -name '*.log'
base := cut -d/ -f4-
apache-links := sed -e 's;\(.*\)/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_\2;'
php-links := sed -e 's;\(.*\)/php/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_php_\2;'
apache := $(log) | grep -v /php/ | $(base) | $(apache-links)
php := $(log) | grep /php/ | $(base) | $(php-links)