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 urllib2 | |
import sys | |
bp = sys.argv[1] | |
url = "http://pad.ubuntu.com/ep/pad/export/uds-o-%s/latest?format=txt" % bp | |
page = urllib2.urlopen(url) | |
print page.read() |
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
iptables -A INPUT -s 127.0.0.1 -j ACCEPT | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |
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/python | |
import string | |
from random import choice | |
print ''.join([choice(string.letters + string.digits + string.punctuation) for i | |
in range(15)]) |
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
@patch('input.FIREFOX') | |
def test(fx): | |
"""Given a specific version_list | |
fx.default_version = '8.0.9' | |
r = self.client.get('/') | |
doc = pq(r.content) | |
eq_(doc('input#version').howeveryoufigureoutwhatsselected, '8.0.9') | |
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
# pip this to manage like $ cat su.py | ./manage.py shell | |
from apps.users.models import User | |
u = User.objects.get(email="[email protected]") | |
u.is_staff = True | |
u.is_superuser = True | |
u.save() |
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
grep -rl 'myfolder' * | xargs -I{} perl -pi -e 's/foo/bar/' {} |
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
EEEF. | |
====================================================================== | |
ERROR: Test that homepage exists and | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/nigelbabu/mozilla/lumbergh/careers/careers/tests/test_views.py", line 20, in test_homepage | |
r = self.client.get(reverse('careers.home'), follow=True) | |
File "/home/nigelbabu/mozilla/lumbergh/vendor/lib/python/django/test/client.py", line 441, in get | |
response = self._handle_redirects(response, **extra) | |
File "/home/nigelbabu/mozilla/lumbergh/vendor/lib/python/django/test/client.py", line 560, in _handle_redirects |
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 | |
# run with messytables 0.3.0 and 0.4.0, does not work in 0.4.0 | |
import messytables as ms | |
def main(): | |
with open('testdata/xls/simple.xls') as f: | |
table_set = ms.excel.XLSTableSet.from_fileobj(f) | |
row_set = table_set.tables[0] | |
types = ms.types.type_guess(row_set.sample) |
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 fastkml import kml | |
def parse(stream, **kwargs): | |
k = kml.KML() | |
kmlstring = stream.read() | |
k.from_string(kmlstring) | |
def iterate(k): | |
itemlist = [] | |
for item in k: |
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
--- | |
- hosts: build | |
vars_prompt: | |
- name: version | |
prompt: "Ckan Version" | |
private: False | |
- name: iteration | |
prompt: "Iteration" | |
private: False | |
tasks: |
OlderNewer