This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Usage: | |
rpm_vercmp.py <rpmfile1> <rpmfile2> | |
Result: | |
RPM which is newer of the two or | |
'Same version' | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Binary search tree | |
With help from http://www.laurentluce.com/posts/binary-search-tree-library-in-python/ | |
""" | |
from collections import deque | |
class Node: | |
def __init__(self, data): | |
self.left = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import signal | |
def sighup_handler(signum, frame): | |
print 'SIGHUP handled by', os.getpid() | |
def sigtstp_handler(signum, frame): | |
print 'SIGTSTP handled by', os.getpid() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lxml.etree | |
xml = '''<job> | |
<recipeSet> | |
<recipe> | |
<distroRequires> | |
<distro_name op="=" value="BlueShoeLinux5-5"/> | |
</distroRequires> | |
<hostRequires> | |
<system> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use: docker run -i -t -v $PWD:/home/lshw/lshw_test:rw -u root eded06474d8f ./run-tests.sh | |
# https://index.docker.io/_/centos/ | |
FROM fedora | |
MAINTAINER Beaker developers | |
# Install dependencies. | |
RUN yum -y install fakeroot fakechroot docbook-utils make gcc-c++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary: Gives a fake chroot environment | |
Name: fakechroot | |
Version: 2.17.2 | |
Release: 2%{?dist} | |
License: LGPLv2+ | |
Group: Development/Tools | |
URL: http://fakechroot.alioth.debian.org/ | |
Source0: http://ftp.debian.org/debian/pool/main/f/fakechroot/%{name}_%{version}.orig.tar.gz | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot | |
Requires: fakechroot-libs = %{version}-%{release} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone git://git.beaker-project.org/beaker-system-scan | |
pushd beaker-system-scan | |
git checkout master | |
python setup.py install | |
smolt=`beaker-system-scan -d -j 2> /dev/null` | |
# fetch lshw patch | |
git fetch http://gerrit.beaker-project.org/beaker-system-scan refs/changes/39/3139/5 && git checkout FETCH_HEAD | |
git checkout -b lshw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define _GNU_SOURCE | |
# include <stdio.h> | |
# include <stdlib.h> | |
# include <string.h> | |
# include <unistd.h> | |
# include <sched.h> | |
# define SYS_IND_CPU_PATH "/sys/devices/system/cpu/cpu" | |
# define KERNEL_MAX_CPU_PATH "/sys/devices/system/cpu/kernel_max" |
OlderNewer