Skip to content

Instantly share code, notes, and snippets.

View gthieleb's full-sized avatar
:octocat:
Volunteering

gthieleb

:octocat:
Volunteering
View GitHub Profile
@gthieleb
gthieleb / convert-and-test.sh
Last active December 11, 2022 22:51 — forked from filipenf/convert-and-test.sh
Script to convert an ansible vault into a yaml file with encrypted strings
#!/bin/bash
#Vault password is 1
echo "Converting vault to yaml format:"
ansible-vault decrypt --output - vault | python ./convert_vault.py > new-vault.yml
echo "Decrypting a variable from the converted vault"
ansible localhost -i localhost, -e @new-vault.yml -m debug -a 'var=secret' --ask-vault-pas
@gthieleb
gthieleb / selenium-hub.nomad
Created July 25, 2021 21:41
Nomad jobfile for selenium hub nodes using consul
job "selenium-hub" {
region = "global"
datacenters = ["dc1"]
type = "service"
priority = 50
update {
stagger = "10s"
max_parallel = 1
}
@gthieleb
gthieleb / manage-pass.ps1
Created January 17, 2021 18:47
powershell password file
## 1. If file does not exist create file and encrypt password.
## 2. Else Read decrypted password and print on screen.
## 3. Additionally set password to clipboard.
$PASSFILE = "$HOME\pass.txt"
If (!(Test-Path $PASSFILE)) {
$sstring = Read-Host "Enter a password for user account: " -AsSecureString
$secure = $sstring | ConvertFrom-SecureString
$secure | Out-File $PASSFILE
} Else {
@gthieleb
gthieleb / schema.yml
Created July 30, 2020 22:38
petstore schema
openapi: 3.0.3
info:
title: ''
version: 0.0.0
paths:
/api/animals/:
get:
operationId: api_animals_list
description: ''
tags:
@gthieleb
gthieleb / exif2date.py
Created June 27, 2017 07:23
Set mtime/atime for photos extracted from exif time date
#!/usr/bin/env python
import sys
import exifread
import time
from os import path, utime
k = 'EXIF DateTimeOriginal'
for fn in sys.argv[1:]:
@gthieleb
gthieleb / gist:5d7494ec545edcdfb4f2a9df80efe275
Created November 23, 2016 13:50
Using npm inside virtualenv
# credits @Marco Louro (https://lincolnloop.com/blog/installing-nodejs-and-npm-python-virtualenv/)
$ workon myvirtualenv
$ curl http://nodejs.org/dist/node-latest.tar.gz | tar xvz
$ cd node-v*
$ ./configure --prefix=$VIRTUAL_ENV
$ make install
@gthieleb
gthieleb / gist:87d9c9a4c717a1625926918e59a37840
Last active September 9, 2016 06:17
ansible pointing to another hosts file
# since 2.x use inventory
cat > ~/.ansible.cfg << EOF
[defaults]
inventory = ~/.ansible/hosts
EOF
test -d ~/.ansible || mkdir ~/.ansible
# put your hosts here
cat > ~/.ansible/hosts << EOF
[vms]
@gthieleb
gthieleb / gist:53274c94d361c807ccb04aab0cc9c316
Created August 30, 2016 08:39
ansible dependencies on rhel 7
gcc
automake
python-devel
openssl-devel
glibc-devel
libffi-devel