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
# How much does tracker affect package installation? | |
# | |
# Average with tracker: 21.754451847076417 | |
# Average without tracker: 21.509078884124754 | |
import os | |
from timeit import Timer | |
cmd = 'sudo dnf reinstall -y kernel-3.13.8-200.fc20.x86_64.rpm' | |
t = Timer(stmt="os.system('%s')" % cmd, setup="import os") |
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 -x | |
# Re-hash yum repodata objects | |
# Pulls pieces of metadata out of the repodata and re-injects them, in order to | |
# use a different hash algorithm. | |
arch=x86_64 | |
repo=/mnt/koji/mash/updates/el5-epel/$arch/repodata | |
cp -Rv $repo repodata | |
cp -R repodata repodata.$arch |
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
# Determine how many critical path packages failed to build from source using | |
# gcc -Werror=format-security. https://fedoraproject.org/wiki/Changes/FormatSecurity | |
import os | |
import subprocess | |
from collections import defaultdict | |
from fedora.client import PackageDB | |
pkgdb = PackageDB('https://admin.fedoraproject.org/pkgdb') |
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 urllib | |
from BeautifulSoup import BeautifulSoup | |
from yum.update_md import UpdateMetadata | |
repos = { | |
'testing': 'http://dl.fedoraproject.org/pub/fedora/linux/updates/testing/20/x86_64/repodata/', | |
'stable': 'http://dl.fedoraproject.org/pub/fedora/linux/updates/20/x86_64/repodata/', | |
} | |
filename = 'updateinfo.xml.gz' |
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
# Download the updateinfo.xml from fedora stable & testing repos and check it | |
# for notices with duplicate update IDs. | |
import os | |
import urllib | |
from yum.update_md import UpdateMetadata | |
ver = 20 | |
testing_url = 'http://dl.fedoraproject.org/pub/fedora/linux/updates/testing/%d/x86_64/repodata/updateinfo.xml.gz' % ver |
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
#!/usr/bin/env python | |
# ---------------------------------------------------------------------------- | |
# A fork of pyglet's timer.py by Luke Macken | |
# | |
# Copyright (c) 2006-2008 Alex Holkner | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: |
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
# A script to count the number of current and maximum fedmsg zeromq connections | |
# Author: Luke Macken <lmacken@redhat.com> | |
# License: GPLv3 | |
import requests | |
from multiprocessing.pool import ThreadPool | |
from BeautifulSoup import BeautifulSoup | |
num_proxies = 8 |
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
bzgrep 'stuff' /var/log/hosts/app0[1-8]*/*/*/*/http/access_log.bz2 \ | |
| cut -d':' -f2- \ | |
| xz --compress --stdout -3 \ | |
| ssh -c blowfish another_box \ | |
"cat - > ~/log.xz" |
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
# NOTE: I re-wrote this code and turned it into a real project: | |
# http://github.com/lmacken/tempi | |
# tempofinder - Add tempo metadata to your music | |
# ============================================== | |
# Sign up for an EchoNest API key: https://developer.echonest.com/docs | |
# sudo yum -y install python-virtualenv python-eyed3 | |
# virtualenv env | |
# source env/bin/activate | |
# pip install pyechonest |
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
# sshtail.py | |
# A script to tail a file across many systems at once | |
# Author: Luke Macken <lmacken@redhat.com> | |
# License: GPLv3+ | |
import getpass | |
import subprocess | |
servers = ['app1', 'app2', 'app3', 'app4', 'app5', 'app6', 'app7'] | |
logfile = '/var/log/httpd/access_log' |