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
""" | |
Finite State Machine | |
This FSM implementation is extracted from the django-fsm package and licensed | |
under the same BSD-like license at: | |
https://github.com/kmmbvnr/django-fsm/blob/master/LICENSE | |
Basic usage: |
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
# Copyright (c) 2007, Roberto Aguilar <[email protected]> | |
# All rights reserved. | |
# | |
# Redistribution and use of this software in source and binary forms, with or | |
# without modification, are permitted provided that the following conditions | |
# are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# |
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 | |
""" | |
http://www.openldap.org/faq/data/cache/347.html | |
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4 | |
Author: Roberto Aguilar <[email protected]> | |
""" | |
import hashlib | |
import os |
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
On etcd server: | |
``` | |
[berto@scratch]$ pgrep -l -f etcd | |
30453 /usr/bin/etcd -n scratch.vb.baremetal.io -d /var/lib/etcd -s 192.168.42.143:7001 -c 192.168.42.143:4001 | |
[berto@scratch]$ watch 'sudo ls /proc/$(pgrep etcd)/fd | wc -l' | |
``` | |
On etcd client: |
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 | |
import pickle | |
import requests | |
URL = 'http://foo.com' | |
# create a session object | |
session = requests.Session() |
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
{ | |
'version': 1, | |
'disable_existing_loggers': True, | |
'filters': { | |
'require_debug_false': { | |
'()': 'django.utils.log.RequireDebugFalse' | |
}, | |
}, | |
'formatters': { | |
'default': {'format': '%(asctime)s %(levelname)s %(name)s.%(funcName)s %(message)s'} |
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 | |
"""python dump_google_group [options] [[email protected] [filename]] | |
Dump addresses from a Google Group | |
================================== | |
This script allows you to easily retrieve the addresses in a Google Group. You | |
will need to have an administrator account for the Google Apps domain. | |
First, store your credentials to a file. Create the credentials file with the |
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 | |
""" | |
Find a name in Twitter's packed namespace | |
Type in a word like your name and get some variations. | |
""" | |
import os | |
import sys | |
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
{{ salt['baremetal.ssl_cert_path'](domain) }}: | |
file.managed: | |
- contents: | | |
{{ domain['ssl_cert'] | indent(0) }} |
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
class Repository(BaremetalModel): | |
account = models.ForeignKey('Account') | |
url = GitURIField() | |
def __unicode__(self): | |
return unicode(self.url) | |
def do_something(self): | |
pass |