Skip to content

Instantly share code, notes, and snippets.

View ralphbean's full-sized avatar

Ralph Bean ralphbean

  • Red Hat
  • Rochester, NY
View GitHub Profile
@ralphbean
ralphbean / access output
Created December 17, 2015 20:58
one, but not the other...
+ set -xv
+ HOME=/srv/git
+ gitolite access -s python-ansi2html ralph W master
legend:
d => skipped deny rule due to ref unknown or 'any',
r => skipped due to refex not matching,
p => skipped due to perm (W, +, etc) not matching,
D => explicitly denied,
A => explicitly allowed,
F => denied due to fallthru (no rules matched)
@ralphbean
ralphbean / stats-for-decause.py
Created August 11, 2015 15:54
stats for decause. bodhi comments and copr builds over the last few years (from fedmsg data)
""" stats-for-decause.py
so, 0 years ago is august 2014 to august 2015
1 years ago is august 2013 to august 2014
2 years ago is august 2012 to august 2013, etc..
the anonymous comments don't add up back 2 years ago because the
anonymous format changed in the message payload -- the "contains"
thing doesn't work exactly that far back.
Output:
""" Calculate "dev to release" leadtime.
Prints out statistics about the time between the first commit of a new feature
and the tag where that feature gets released.
Ideally, we'd like to compute the time between first commit and deployment to
production, but we don't have an easy way to reliably access logs of when
things were deployed against when they were committed in git.
A quick script for my talk on technical debt at Flock 2015.
@ralphbean
ralphbean / self-acls.py
Created July 14, 2014 15:13
Audit script to look for odd cases from the pkgdb
#!/usr/bin/env python
""" This script looks for people who have assigned themselves the
'approveacls' status in pkgdb by checking the fedmsg history.
Gotta first do::
$ yum install \
fedmsg \
python-fedmsg-meta-fedora-infrastructure \
python-requests \
@ralphbean
ralphbean / scrape-issues.py
Created May 9, 2014 01:59
Script to scrape all issues for a github user
import requests
import getpass
import sys
def get_repos(username, auth):
""" username should be a string
auth should be a tuple of username and password.
eventually, we'll switch it to use an oauth token
"""
@ralphbean
ralphbean / linear-regression-on-text.py
Created May 1, 2014 15:07
Messing around with linear regression over text data
""" Messing around with scikit-learn. """
import sys
import numpy as np
import scipy.sparse
import sklearn.linear_model
import sklearn.datasets
import sklearn.svm
@ralphbean
ralphbean / flickr-scraper.py
Last active January 15, 2022 23:43
Script to scrape images from a flickr account.
#!/usr/bin/env python
""" Script to scrape images from a flickr account.
Author: Ralph Bean <rbean@redhat.com>
"""
import ConfigParser
import urllib
import requests
@ralphbean
ralphbean / gist:9811131
Created March 27, 2014 16:08
keybase.md
### Keybase proof
I hereby claim:
* I am ralphbean on github.
* I am ralphbean (https://keybase.io/ralphbean) on keybase.
* I have a public key whose fingerprint is 9450 4C3A E11D D197 9200 58AB A90E D7DE 9710 95FF
To claim this, I am signing this object:
@ralphbean
ralphbean / .gitignore
Last active December 28, 2015 21:59
A dynamic logo for fedmsg notifications
*.pyc
@ralphbean
ralphbean / .gitignore
Last active December 28, 2015 21:58
A logo for fedmsg notifications (take 2)
*.pyc