Skip to content

Instantly share code, notes, and snippets.

View briancline's full-sized avatar

Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
@Sam-Martin
Sam-Martin / Test Kitchen Add Vagrant Disks.md
Last active March 21, 2020 03:52
Test Kitchen VagrantFile.rb to add disks & test_helper.bash to format them

Use these two files to add disks to your VMs (here adding three disks) when Kitchen spins up Vagrant boxes.

  • test_helper.bash (add to your bats test with load test_helper)
  • vagrantfile.rb (add to your .kitchen.yml using)
---
driver:
  name: vagrant
  vagrantfiles: 
 - vagrantfile.rb
@mattgray
mattgray / .kitchen.local.yml
Created December 23, 2014 17:10
Test Kitchen .kitchen.local.yml to enable Virtualbox Vagrant backend to use Host DNS for VPN
driver:
name: vagrant
customize:
natdnshostresolver1: 'on'
@gilv
gilv / migration_from_file_system
Created July 31, 2014 06:52
migration_from_file_system
'''
Created on Dec 16, 2013
@author: Gil Vernik
'''
from swiftclient import client as c
import os
import tempfile
import random
@alistairncoles
alistairncoles / Example CLI usage
Last active January 6, 2019 01:16
keystone v3 setup
EXAMPLE:
(keystone-v3-setup.sh script will perform first few steps using role 'admin')
# Create a domain named d1 (note use of --os-url and --os-token to manage keystone)
anc@u128:~$ openstack --os-url http://u132.localdomain:5000/v3 --os-identity-api-version 3 --os-token=ADMIN domain create d1
+---------+----------------------------------------------------------------------------------------+
| Field | Value |
+---------+----------------------------------------------------------------------------------------+
@gavinhungry
gavinhungry / nginx-tls.conf
Last active March 11, 2024 14:51
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@hitsumabushi
hitsumabushi / default
Last active September 21, 2020 09:12
Preseed Files : working with Wheezy & Ubuntu 14.04
# D-I config version 2.0
default debian/7.4/amd64/boot-screens/vesamenu.c32
prompt 1
timeout 300
menu title - Boop Menu -
label Debian-7.4
menu label ^0 Debian 7.4
#include debian/7.4/amd64/boot-screens/menu.cfg
kernel debian/7.4/amd64/linux
@sudorandom
sudorandom / import_stuff.py
Created March 5, 2014 23:56
Multi Multiple Import
PARSERS = [('pkg_resources', 'parse_version'), ('distutils.version', 'StrictVersion')]
def get_parse_fn():
for parser_module, parser in PARSERS:
try:
return getattr(importlib.import_module(parser_module), 'parser')
except ImportError:
pass
raise Exception("Couldn't find a thing to do the thing")
@einnocent
einnocent / dotdictify.py
Last active July 24, 2017 20:05
Modified Python Dotdictify
# turn dict into an object that allows access to nested keys via dot notation
# from http://stackoverflow.com/questions/3797957/python-easily-access-deeply-nested-dict-get-and-set
# made three modifications:
# --added `get()` method
# --added `if not dict.__contains__...` to `__contains__()`
# --can now accept None as key
class dotdictify(dict):
def __init__(self, value=None):
if value is None:
pass
@jasonjohnson
jasonjohnson / python.md
Last active August 29, 2015 13:55
A collection of resources for learning Python.

Introduction

The best way to learn Python is to write Python, but these guides will provide an excellent starting point for the library landscape, coding standards, and community. This is by no means comprehensive! Once this is in an actual repository I will gladly accept relevant modifications.

Guides

The Hitchhiker’s Guide to Python!

"This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis."

@goldsmith
goldsmith / python_mavericks_guide.sh
Last active June 3, 2020 12:18
When I upgraded my Mac to OS X Mavericks, a lot of utilities (like Python, virtualenv, Xcode) broke, and it was pretty stressful trying to get it all set back up. Hopefully this guide can spare you some of that pain.Note: I'm by no means a Linux or Mac expert, so please fork and let me know if anything is redundant, incorrect, or missing!
# A guide to prevent pain and suffering while upgrading to OS X Mavericks
# This will vary greatly depending on system set up, so read the instructions carefully
# Back up Virtulenvs
####################
# Very important!
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv
# in order to prevent loss of dependencies during the upgrade.