Skip to content

Instantly share code, notes, and snippets.

@markllama
markllama / schema2ldif.sh
Last active April 12, 2023 14:47
Convert LDAP Schema to LDIF
#!/bin/bash
#
# Stolen from https://stuckinadoloop.wordpress.com/2011/04/14/script-to-convert-openldap-schema-files-to-ldif-format/
SCHEMAD=/etc/openldap/schema
SCHEMAS='dhcp.schema'
tmpd=`mktemp -d`
pushd ${tmpd} >>/dev/null
@markllama
markllama / docker_mongodb_Dockerfile
Last active October 10, 2019 23:10
A Dockerfile for a MongoDB container based on Fedora 20
FROM fedora:20
MAINTAINER Mark Lamourine <markllama@gmail.com>
#COMMENT { "description": "mongodb service container", \
# "usage": "docker run -d -p 27017:27017 --name mongodb mlamouri/mongodb --volume=/mydbdatadir:/var/lib/mongodb" }
RUN yum install -y mongodb-server && yum clean all
RUN mkdir -p /var/lib/mongodb && \
touch /var/lib/mongodb/.keep && \
@markllama
markllama / pr_request.py
Last active December 31, 2015 20:59
Pull and report some information on a specific PR from the openshift origin-server repository
#!/usr/bin/python
#
# Protocol defined in:
# http://developer.github.com/v3/
#
import sys, os
import requests
github_url_root = "https://api.github.com/"
username = '<yourgitusername>'
@markllama
markllama / fedora19-acer-s17-191.adoc
Last active December 26, 2015 17:29
Installing Fedora 19 on an Acer S7 191-6400

This document describes installing Fedora 19 Linux on an Acer S7-191-6400 ultrabook.

This is a lightweight laptop with an 11.6" display with 1920x1080 CineCrystal display, 4GB memory and two 64GB SSDs striped.

The laptop also uses UEFI boot rather than traditional BIOS.

Preparation

The S7 comes with Windows 8 pre-loaded. Be sure to create restore media on an 8gb+ USB stick.

You must enable boot media selection in BIOS (EFI). Power on and hold the FN-F2 keys at the Acer splash screen. Enable the FN-F12 boot selection.

@markllama
markllama / update-ec2-principals.py
Created October 11, 2013 21:41
A small script, meant to be run from cloud-init, to update the dynamic hostname principals for a registered host within a Kerberos realm inside AWS EC2
#!/usr/bin/python
#
# A small script to update FreeIPA host entry with EC2 dynamic host principals
#
#
import sys, os
import ldap, ldap.sasl
kerberos_server_ldap_url = sys.argv[1]
admin_principal_string = sys.argv[2]
@markllama
markllama / cartridge_repository_action.rb
Created September 26, 2013 19:00
The portion of openshift.rb which defines the cartridge_repository_action function for managing cartridges on OpenShift nodes.
def cartridge_repository_action
Log.instance.info("action: #{request.action}_action, agent=#{request.agent}, data=#{request.data.pretty_inspect}")
action = request[:action]
path = request[:path]
name = request[:name]
version = request[:version]
cartridge_version = request[:cartridge_version]
reply[:output] = "#{action} succeeded for #{path}"
begin
@markllama
markllama / oo-skel-secrets.pp
Created August 6, 2013 17:39
The sensitive information for an OpenShift Origin service
#
# Instantiate a single class containing all of the passwords for the service
# This must NOT be checked into Git in clear text
#
# All values here must be changed for real use even for demos
class {'openshift::secrets':
datastore => 'dbsecret',
publication => 'dnssecret',
message_bus => 'activemqsecret',
message_end => 'mcollectivesecret',
@markllama
markllama / oo-skel-nodes.pp
Created August 6, 2013 17:34
A set of node definitions using the information from the master service class
#
# Node definitions for an OpenShift Origin service
#
node 'broker.infra.example.org' {
class {'mcollective::client':
}
@markllama
markllama / oo-skel-site.pp
Last active December 20, 2015 17:09
An example site fragment for an OpenShift Origin service description.
#
# OpenShift Origin service definitions
#
$openshift = {
# OpenShift Service Parameters
cloud_domain => 'app.example.org',
broker_hosts => ['broker.infra.example.org'],
datastore => {
plugin => 'mongo',
@markllama
markllama / oo-build
Last active December 15, 2015 23:20
A Thor script to assist in building OpenShift Origin (and other) packages.
#!/usr/bin/env ruby
#
# A set of tasks to prepare and build the OpenShift Origin source tree
# into packages
#
require 'rubygems'
require 'thor'
# Used to search for spec files and other marker files within the source tree
require 'find'