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
" Vim5 and later versions support syntax highlighting. Uncommenting the next | |
" line enables syntax highlighting by default. | |
syntax on | |
" If using a dark background within the editing area and syntax highlighting | |
" turn on this option as well | |
set background=dark | |
" Uncomment the following to have Vim jump to the last position when | |
" reopening a file |
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
(taken from a Trac wiki page; stuff below these two paragraphs is the actual script) | |
In general, needs Apache 2.0+, mod_wsgi 2.3+, Python 2.5+, MySQL 5.0+. Also needs some Bash stuff for virtualenvwrapper to correctly put stuff into /opt/envs and for some aliases/non-sudo commands used below -- see Jeff's dotfile Github repo for the .bashrc. | |
Might need attached mod-wsgi .deb if version in APT is not 2.3 | |
-- | |
USER=jforcier | |
aptitude install libapache2-mod-wsgi mysql-server libmysqlclient-dev python-setuptools | |
sudo easy_install virtualenv virtualenvwrapper |
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 sphinx(): | |
with cd('/tmp'): | |
tgz = 'sphinx-0.9.8.1.tar.gz' | |
run('wget http://www.sphinxsearch.com/downloads/%s' % tgz) | |
run('tar xzf %s' % tgz) | |
with cd(tgz.replace('.tar.gz', '')): | |
run('./configure') | |
run('make') | |
sudo('make install') |
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 |
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
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
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
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
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
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'>, |
OlderNewer