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 | |
# linkify.py - Turns URLs into links. | |
# | |
# Using on a file: | |
# | |
# $ linkify.py <filename> | |
# <a href="http://lewk.org">http://lewk.org</a> | |
# | |
# Using within a pipeline: | |
# |
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 | |
# Writes a file called 'rawhide-pkg-licenses.txt' containing a list of all | |
# packages in Fedora with their corresponding license. | |
# | |
# Before running, you must first warm up the yum cache: | |
# | |
# sudo yum --disablerepo=\* --enablerepo=rawhide-source makecache | |
# | |
# Author: Luke Macken <[email protected]> |
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
# VeraCart Product Catalog Exporter | |
# Luke Macken <[email protected]> | |
# License: GPLv3+ | |
import os | |
import csv | |
import uuid | |
from urllib import urlretrieve | |
from urllib2 import urlopen |
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
# Ports a pyblosxom 'entries' directory into blogofile markdown files | |
# Luke Macken <[email protected]> | |
import os, stat, time | |
for old in os.listdir('entries'): | |
if old.startswith('comments') or old == 'LATEST': | |
continue | |
new = file('_posts/%s.html' % old.replace('.txt', ''), 'w') |
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 <[email protected]> | |
# License: GPLv3+ | |
import getpass | |
import subprocess | |
servers = ['app1', 'app2', 'app3', 'app4', 'app5', 'app6', 'app7'] | |
logfile = '/var/log/httpd/access_log' |
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
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
# A script to count the number of current and maximum fedmsg zeromq connections | |
# Author: Luke Macken <[email protected]> | |
# 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
#!/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
# 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 |
OlderNewer