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
jeff:~/D/C/fabfile {fabric} [master] $ fab -l | |
Available commands: | |
add_nrpe_cpu_check One-time command to append a new CPU check com... | |
add_user Add a new user named ``name`` to the remote sy... | |
apache | |
ar_mailer | |
build_djb_packages Download, build and install djbdns, ucspi-tcp ... | |
check_timezone If date(1) reports UTC, run dpkg-reconfigure t... | |
check_yum_repos |
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
enum = 'http://readyroom/catalog/enumerate/' | |
def get_hosts(which=None): | |
qs = '' | |
if which: | |
qs = '?which=%s' % which | |
ret = urllib.urlopen(enum + 'systems/' + qs).read() | |
return ret.split() | |
env.roledefs.update({ |
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 django.conf.urls.defaults import * | |
from django.db.models.loading import cache | |
from django.contrib import databrowse | |
urlpatterns = patterns('', | |
# blah blah blah | |
) | |
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
In [20]: list(value for key, value in vars(models).items() if isinstance(value, type) and issubclass(value, Model)) | |
Out[20]: | |
[<class 'readyroom.catalog.models.Service'>, | |
<class 'readyroom.catalog.models.System'>, | |
<class 'readyroom.catalog.models.DriveType'>, | |
<class 'readyroom.catalog.models.DriveConfig'>, | |
<class 'readyroom.catalog.models.Worklog'>, | |
<class 'django.contrib.auth.models.User'>, | |
<class 'readyroom.catalog.models.Daemon'>, | |
<class 'readyroom.catalog.models.MemoryType'>, |
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 fabric.api import * | |
env.host_string = 'my_user@my_django_host' | |
env.roledefs = { | |
'host1': run('workon myenv && ./manage.py account_to_shell') | |
} | |
@roles('host1') | |
def mytask(): | |
run('whatever') |
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
def add_user(name=None, password=None, admin='no', apache='no', skip='yes'): | |
""" | |
Add a new user named ``name`` to the remote system. | |
If ``name`` or ``password`` are unspecified, you will be prompted for them. | |
To have a user added to the admin/wheel group, specify ``admin=yes``. | |
To add the user to the appropriate Apache group, specify ``apache=yes``. |
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
rb(main):002:0> "bobsmith".match(/(b.b)(.+)/) | |
=> #<MatchData "bobsmith" 1:"bob" 2:"smith"> | |
irb(main):003:0> result = "bobsmith".match(/(b.b)(.+)/) | |
=> #<MatchData "bobsmith" 1:"bob" 2:"smith"> | |
irb(main):004:0> result[0] | |
=> "bobsmith" | |
irb(main):005:0> result[1] | |
=> "bob" | |
irb(main):006:0> result[2] | |
=> "smith" |
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
irb(main):001:0> "bobsmith" =~ /(b.b)(.+)/ | |
=> 0 | |
irb(main):002:0> puts $1 | |
bob | |
=> nil | |
irb(main):003:0> puts $2 | |
smith | |
=> nil |
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
ytram:/u/local [master] $ echo "$FOO" | |
ytram:/u/local [master] $ FOO='wtf' echo "$FOO" | |
ytram:/u/local [master] $ FOO='wtf' echo '$FOO' | |
$FOO | |
ytram:/u/local [master] $ FOO="wtf" echo "$FOO" | |
ytram:/u/local [master] $ export FOO="wtf" | |
ytram:/u/local [master] $ echo "$FOO" |
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
bitprophet.org:~ [master] $ cat /srv/git/repositories/fabric.git/hooks/post-update | |
#!/bin/sh | |
# | |
# An example hook script to prepare a packed repository for use over | |
# dumb transports. | |
# | |
# To enable this hook, make this file executable by "chmod +x post-update". | |
#exec git-update-server-info | |
exec git push --mirror [email protected]:bitprophet/fabric.git >> /tmp/fabric-to-github.log 2>&1 |