Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am torras on github.
  • I am danit (https://keybase.io/danit) on keybase.
  • I have a public key ASBn9Ald0yG-MlZ-QovkvoXelnfZOXtdrnq2etpAz328mgo

To claim this, I am signing this object:

@dnlmengs
dnlmengs / vagrant.py
Last active May 5, 2017 11:37
A tweaked ansible dynamic inventory for vagrant when using ssh proxies (ex: vagrant libvirt). Original taken from the official ansible repo. All credits to the original creators.
#!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
ansible.inventory_file = "./provision/inventory/vagrant.py"
source 'https://rubygems.org'
# Specify your gem's dependencies in vagrant-libvirt.gemspec
gemspec
group :development do
# We depend on Vagrant for development, but we don't add it as a
# gem dependency because we expect to be installed within the
# Vagrant environment itself using `vagrant plugin`.
if ENV['VAGRANT_VERSION']
@dnlmengs
dnlmengs / vimeo_downloader.sh
Last active February 23, 2017 10:28
Things like this happen. Only working until vimeo changes the way it gets the video files again.
#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: $0 vimeo_id filename"
exit 1
fi
# Set the user agent ID to use
USER_AGENT="Mozilla/5.0"
GET="wget -U '${USER_AGENT}' -q -O -"