Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# primary name server ips | |
primary=(192.0.2.2 2001:db8:1::53) | |
# secondary name server ips | |
secondary=(192.0.2.3 2001:db8:2::53) | |
#salt for NSEC3 | |
salt=$(head -c 512 /dev/urandom | sha1sum | cut -b 1-16) |
This was moved to https://github.com/jtyr/ansible-ini_inventory |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
# -*- coding: utf-8 -*- | |
from flask import Flask, request, render_template, current_app | |
from flask_wtf import Form | |
from wtforms.validators import DataRequired | |
from wtforms import SelectField, SelectMultipleField, SubmitField | |
app = Flask(__name__) |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os/exec" | |
"time" | |
) | |
func run(timeout int, command string, args ...string) string { |
#!/usr/bin/env python | |
# stolen from http://stackoverflow.com/questions/27590039/running-ansible-playbook-using-python-api | |
import os | |
import sys | |
from collections import namedtuple | |
from ansible.parsing.dataloader import DataLoader | |
from ansible.vars import VariableManager | |
from ansible.inventory import Inventory |
#settings for vm | |
#name of vm to current directory | |
vm_prefix = Pathname.new(Dir.getwd).basename.to_s | |
vm_folder = "vagrant-vsphere/#{vm_prefix}" | |
vm_number = 3 | |
vm_ram = 1024 | |
vm_cpu = 2 | |
vm_datastore = "sas" | |
#scripts |
This program, in the form of a configuration script and a main script, allows for complicated Gmail search queries to be used as filters. It also lets you do more advanced stuff you can't do with ordinary filters, like label based on whether an email contains a specific kind of attachment.
Main
as the title for the new script. This will be for the main script.main.gs
from this gist to that file.Config
as the title for the new script. This will be for configuration.As of writing, this is only possible with my fork of pandas, but hopefully it will make its way into the main pandas stable branch.
The purpose of the fork is to let you specify a custom html formatter for individual columns in a data frame.
In this example we create a formatting function which takes a numpy array and returns a string of the form <img src='--base64-encoded-data'/>
. This means that the numpy array is displayed as an image.
Below is the code we use to define our custom format function. Note that the function takes a single element from the data frame and returns and html string::