Skip to content

Instantly share code, notes, and snippets.

View tobert's full-sized avatar
💭
🏳️‍🌈 💻 🏳️‍🌈

Amy Tobey tobert

💭
🏳️‍🌈 💻 🏳️‍🌈
View GitHub Profile
@tobert
tobert / gist:720996
Created November 30, 2010 01:53
thinking aloud
admin1@puppetmaster> pcm checkout -d ~/puppet-policy
admin1@puppetmaster> cd ~/puppet-policy
admin1@puppetmaster> vim modules/sudo/manifests/init.pp
admin1@puppetmaster> pcm commit -m "Update sudo configuration."
admin1@puppetmaster> pcm sync
admin2@puppetmaster> pcm checkout -d ~/src/pp
admin2@puppetmaster> cd ~/src/pp
admin2@puppetmaster> pcm review
admin2@puppetmaster> pcm commit -m "Peer review changes."
@tobert
tobert / rc.sysinit.lxc
Created January 5, 2011 00:50
Gutted rc.sysinit for EL5 running under LXC
#!/bin/bash
# Print a text banner.
echo -en $"\t\tWelcome to "
read -r redhat_release < /etc/redhat-release
PRODUCT=`sed "s/CentOS \(.*\) release.*/\1/" /etc/redhat-release`
echo -e "\\033[0;36m$PRODUCT\\033[0;39m"
# Clean up utmp/wtmp
> /var/run/utmp
@tobert
tobert / gist:765867
Created January 5, 2011 03:04
LXC Config for Puppet testing on CentOS 5.x
lxc.utsname = test
lxc.rootfs = /lxc/test/rootfs
lxc.cgroup.cpuset.cpus = 0,1
lxc.cgroup.cpu.shares = 500
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 4a:49:43:49:79:bf
lxc.network.ipv4 = 192.168.122.10/24
@tobert
tobert / gist:765871
Created January 5, 2011 03:05
Cut-down intitab for CentOS 5.x in LXC
We couldn’t find that file to show.
@tobert
tobert / cluster_netstat.pl
Created January 10, 2011 22:39
Cluster Netstat
#!/usr/bin/perl
###########################################################################
# #
# Cluster Tools: cluster_netstat.pl #
# Copyright 2007-2010, Albert P. Tobey <tobert@gmail.com> #
# #
###########################################################################
=head1 NAME
@tobert
tobert / nsfork.c
Created February 1, 2011 21:59
Like fork, but really more like jails.
/* nsfork.c - like fork, but the child process is in a new namespace
*
* minimum linux kernel v2.6.24
* requires root and/or CAP_SYS_ADMIN
*
*/
#include <unistd.h>
#include <sys/syscall.h>
#include <signal.h>
@tobert
tobert / test_nsfork.c
Created February 1, 2011 22:02
Test the nsfork() function.
/* must run as root or with CAP_SYS_ADMIN
* e.g. sudo ./test_nsfork
* or
* sudo
*/
#include "nsfork.h"
#include <stdio.h>
@tobert
tobert / cli.py
Created February 7, 2011 23:51
cfmteset CLI module first pass
import os
import sys
import optparse
import cfmtest.build
#import cfmtest.test
#import cfmtest.destroy
CFMTEST_COMMANDS = [ "build" ] #, "test", "destroy" ]
class CLI:
$DefaultNetstreamDriver gtls # enable TLS via gnutls
$DefaultNetstreamDriverCAFile /etc/pki/certmaster/ca.cert # certmaster CA cert
$DefaultNetstreamDriverCertFile /etc/pki/certmaster/hostname.domain.com.cert # certmaster host certificate
$DefaultNetstreamDriverKeyFile /etc/pki/certmaster/hostname.domain.com.pem # certmaster host key
$InputTCPServerStreamDriverAuthMode x509/name # verify the client cert's subject
$InputTCPServerStreamDriverPermittedPeer *.domain.com # match client cert's domain for auth
$InputTCPServerRun 514 # start up listener on 514