This file contains hidden or 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
| From 41647e16d5baa704a1dff71efa2bda47680f215d Mon Sep 17 00:00:00 2001 | |
| From: Ralph Bean <[email protected]> | |
| Date: Fri, 15 Jun 2012 12:34:36 +0000 | |
| Subject: [PATCH 1/5] gitolite fedmsg hooks. | |
| --- | |
| modules-staging/git/files/post-receive-chained | 5 ++ | |
| modules-staging/git/files/post-receive-fedmsg | 46 ++++++++++++++++++++ | |
| modules-staging/git/manifests/init.pp | 15 ++++++ | |
| .../gitolite/files/distgit/reestablish-git-hooks | 34 ++++++++++++++ |
This file contains hidden or 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
| _last_called = time.time() | |
| def animate(): | |
| global r | |
| global _last_called | |
| now = time.time() | |
| if now - _last_called > 2: # 2 is in seconds | |
| # Remember when I was called last | |
| _last_called = now |
This file contains hidden or 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
| ( | |
| lambda args: map( | |
| lambda repo: __import__("os").system('git clone {0} {1}/{2}'.format( | |
| repo.git_url, | |
| args.backupdir, | |
| repo.name) | |
| ), | |
| __import__("pygithub3").Github().repos.list(args.username).all() | |
| ) | |
| )( |
This file contains hidden or 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
| """ Run like: $ python coder-shell.py | |
| First you need to: $ pip install coderwall requests fabulous | |
| """ | |
| from coderwall import CoderWall | |
| import fabulous.image | |
| import fabulous.text | |
| import os | |
| import requests |
This file contains hidden or 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 | |
| """ Use like: | |
| cat list-of-packages.txt | ./reduced-list.py | |
| You're going to need python-sh for this to work. | |
| sudo yum -y install python-sh | |
| """ |
This file contains hidden or 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 | |
| """ You guys are monsters! """ | |
| import fabulous.image | |
| import tempfile | |
| import urllib | |
| import os | |
| handle, filename = tempfile.mkstemp(suffix=".png") | |
| urllib.urlretrieve(url="http://threebean.org/monsters.png", filename=filename) |
This file contains hidden or 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
| diff --git a/modules/nagios/files/nagios/misccommands.cfg b/modules/nagios/files/nagios/misccommands.cfg | |
| index 19ce5b8..18425e9 100644 | |
| --- a/modules/nagios/files/nagios/misccommands.cfg | |
| +++ b/modules/nagios/files/nagios/misccommands.cfg | |
| @@ -98,6 +98,12 @@ define command{ | |
| command_line /usr/local/bin/xmppsend -a /etc/nagios/private/xmppnagios.ini "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nDate: $LONGDATETIME$" $CONTACTEMAIL$ | |
| } | |
| +# 'notify-by-fedmsg' command definition | |
| +define command{ |
This file contains hidden or 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 | |
| for repo in $(cat /srv/git/pkgs-git-repos-list); do | |
| if [ ! -e /srv/git/rpms/$repo/hooks/post-receive ] ; then | |
| echo $repo | |
| fi | |
| done |
This file contains hidden or 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 | |
| """Simple example of publish/subscribe illustrating topics. | |
| Publisher and subscriber can be started in any order, though if publisher | |
| starts first, any messages sent before subscriber starts are lost. More than | |
| one subscriber can listen, and they can listen to different topics. | |
| Topic filtering is done simply on the start of the string, e.g. listening to | |
| 's' will catch 'sports...' and 'stocks' while listening to 'w' is enough to | |
| catch 'weather'. |
This file contains hidden or 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 | |
| """Simple example of publish/subscribe illustrating topics. | |
| Publisher and subscriber can be started in any order, though if publisher | |
| starts first, any messages sent before subscriber starts are lost. More than | |
| one subscriber can listen, and they can listen to different topics. | |
| Topic filtering is done simply on the start of the string, e.g. listening to | |
| 's' will catch 'sports...' and 'stocks' while listening to 'w' is enough to | |
| catch 'weather'. |