Generarates inventory for ansible from etcd using python-etcd library.
The script assumes etcd.ini to be present alongside it. To choose a different path, set the ETCD_INI_PATH environment variable:
export ETCD_INI_PATH=/path/to/etcd.ini
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Statistics::Gtest; | |
use Statistics::Distributions; | |
use Data::Dumper; | |
# | |
# Just set up some basics |
// http://www.olark.com/spw/2011/08/you-can-list-a-directory-with-8-million-files-but-not-with-ls/ | |
#define _GNU_SOURCE | |
#include <dirent.h> /* Defines DT_* constants */ | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <sys/syscall.h> |
1) Enter Developer Mode | |
Disclaimer. I will take no responsibility if you somehow brick your chrome book. You should only attempt the following if you are familiar with embedded system hackery :) | |
With the laptop turned off, hold down the escape and refresh keys, then press the power key | |
The device is now in Recovery Mode, pressing Ctrl-D will enable Developer Mode. | |
Confirm the action by pressing Enter. |
#!/usr/bin/env python | |
""" | |
# Original Author: Tyler Lesmann | |
# Original Source: http://www.tylerlesmann.com/2009/apr/27/copying-databases-across-platforms-sqlalchemy/ | |
# TODO: Look at https://gist.github.com/thoas/1589496 if any | |
# "sequencing" issues come in to play. | |
#!/usr/bin/env python | |
import argparse | |
import json | |
from ipalib import api | |
def initialize(): | |
''' | |
This function initializes the FreeIPA/IPA API. This function requires |
/* | |
* tiny_IRremote | |
* Version 0.2 July, 2016 | |
* Christian D'Abrera | |
* Fixed what was originally rather broken code from http://www.gammon.com.au/Arduino/ | |
* ...itself based on work by Ken Shirriff. | |
* | |
* This code was tested for both sending and receiving IR on an ATtiny85 DIP-8 chip. | |
* IMPORTANT: IRsend only works from PB4 ("pin 4" according to Arduino). You will need to | |
* determine which physical pin this corresponds to for your chip, and connect your transmitter |
#!/bin/bash | |
HYPERTHREADING=1 | |
function toggleHyperThreading() { | |
for CPU in /sys/devices/system/cpu/cpu[0-9]*; do | |
CPUID=`basename $CPU | cut -b4-` | |
echo -en "CPU: $CPUID\t" | |
[ -e $CPU/online ] && echo "1" > $CPU/online | |
THREAD1=`cat $CPU/topology/thread_siblings_list | cut -f1 -d,` |
#!/usr/bin/env python | |
from xml.etree import ElementTree as ET | |
import pprint as pp | |
import argparse | |
from collections import defaultdict | |
# From http://stackoverflow.com/questions/2148119/how-to-convert-an-xml-string-to-a-dictionary-in-python/10077069#10077069 | |
def etree_to_dict(t): | |
d = {t.tag: {} if t.attrib else None} |
""" | |
PathType | |
A helper type for input validation in argparse for paths. | |
This provides a convienent way to check the paths type, existance, and | |
potentially use "-" to reference stdin or stdout. | |
This class is provided as an alternative to argparse.FileType(), which | |
does not open the path, only validates it and supports directories. |