This file contains 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 | |
# -*- coding: utf-8 -*- | |
from r3.worker.mapper import Mapper | |
class CountWordsMapper(Mapper): | |
job_type = 'count-words' | |
def map(self, lines): | |
#time.sleep(0.5) |
This file contains 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
upstream thumborbe { | |
server thumbor.myhost.com:8090 ; | |
server thumbor.myhost.com:8091 ; | |
server thumbor.myhost.com:8092 ; | |
server thumbor.myhost.com:8093 ; | |
server thumbor.myhost.com:8094 ; | |
server thumbor.myhost.com:8095 ; | |
} | |
location ~* "^/.{28}/.*(jpg|jpeg|gif|png)(#.*)?$" { |
This file contains 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 render(self, context): | |
content = self.nodelist.render(context) | |
if not settings.COMPRESS or not len(content.strip()): | |
return content | |
if self.kind == 'css': | |
compressor = CssCompressor(content) | |
if self.kind == 'js': | |
compressor = JsCompressor(content) | |
cachekey = "%s-%s" % (compressor.cachekey, self.mode) | |
output = self.cache_get(cachekey) |
This file contains 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 PIL.ExifTags import TAGS | |
import PIL | |
img = PIL.Image.open('sony-cybershot.jpg') | |
exif = img._getexif() | |
for k, v in exif.items(): | |
print TAGS.get(k, k), v |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
import os | |
NAMED_PIPE = '/tmp/PIPE' | |
def main(): | |
if not os.path.exists(NAMED_PIPE): | |
os.mkfifo(NAMED_PIPE) |
This file contains 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
provy -s server -p password mysql-db-password=somepass |
This file contains 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
servers = { | |
'frontend': { | |
'address': '33.33.33.33', | |
'user': 'vagrant', | |
'roles': [ | |
FrontEnd | |
], | |
'options': { | |
'mysql-db-password': | |
AskFor('mysql-db-password', |
This file contains 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
Vagrant::Config.run do |config| | |
config.vm.define :frontend do |inner_config| | |
inner_config.vm.box = "base" | |
inner_config.vm.forward_port("http", 80, 8080) | |
inner_config.vm.network("33.33.33.33") | |
end | |
config.vm.define :backend do |inner_config| | |
inner_config.vm.box = "base" |
This file contains 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
# make sure fabric, jinja2 and m2crypto are installed | |
$ pip install fabric | |
$ pip install jinja2 | |
$ pip install m2crypto | |
# now actually installing it | |
$ git clone [email protected]:heynemann/provy.git | |
$ python setup.py install | |
$ provy --version |
This file contains 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 install provy |