Skip to content

Instantly share code, notes, and snippets.

View imcleod's full-sized avatar

Ian McLeod imcleod

  • Red Hat
  • Chicago
View GitHub Profile
import sys
import lxml.etree
import uuid
import datetime
import time
VSSD = '{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData}'
RASD = '{http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}'
VBOX = '{http://www.virtualbox.org/ovf/machine}'
OVF = '{http://schemas.dmtf.org/ovf/envelope/1}'
#!/usr/bin/python
import sys
import struct
def dump_qcow_header(filename):
# Detect if an image is in qcow format
# If it is, return the size of the underlying disk image
# If it isn't, return None
# For interested parties, this is the QCOW header struct in C
#!/usr/bin/python
import guestfs
import sys
import re
g = guestfs.GuestFS()
g.add_drive_ro(sys.argv[1])
g.launch()
#!/usr/bin/python
import guestfs
import sys
import re
g = guestfs.GuestFS()
g.add_drive_ro(sys.argv[1])
g.launch()
install
text
keyboard us
lang en_US.UTF-8
skipx
network --device eth0 --bootproto dhcp
rootpw %ROOTPW%
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --enforcing
install
text
keyboard us
lang en_US.UTF-8
skipx
network --device eth0 --bootproto dhcp
rootpw %ROOTPW%
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --enforcing
@imcleod
imcleod / trivial_indirection.tdl
Created October 8, 2014 17:43
Trivial indirection template
<template>
<commands>
<command name='mount'>mount /dev/vdb1 /mnt</command>
<command name="mock_image">echo This is a mock DIB image > /mnt/overcloud-control.tar</command>
</commands>
</template>
@imcleod
imcleod / pidgin-irc-join-sleep.patch
Created September 2, 2014 19:45
Trivial patch that fixes "excess flood" issues on freenode with Pidgin
diff -ur ./pidgin-2.10.9.orig/libpurple/protocols/irc/irc.c pidgin-2.10.9/libpurple/protocols/irc/irc.c
--- ./pidgin-2.10.9.orig/libpurple/protocols/irc/irc.c 2014-02-02 15:29:18.000000000 -0600
+++ pidgin-2.10.9/libpurple/protocols/irc/irc.c 2014-09-02 10:30:24.830599697 -0500
@@ -742,6 +742,7 @@
struct irc_conn *irc = gc->proto_data;
const char *args[2];
+ g_usleep(500000);
args[0] = g_hash_table_lookup(data, "channel");
args[1] = g_hash_table_lookup(data, "password");
<template>
<name>f19</name>
<os>
<name>Fedora</name>
<version>19</version>
<arch>x86_64</arch>
<install type='url'>
<url>http://mirrors.yocum.org/fedora/releases/19/Fedora/x86_64/os/</url>
</install>
</os>