Category: python

Update salt from 2015.5.3 to 2016.3.2

When reading salt’s source code, it seems we have a ‘source_hash_update’ option on “archive.extracted”, however when I added so, salt complains:

Read more →

Create file with random string in python

#!/usr/bin/env python
import string
import random

out_file = 'text_file.txt'
file_size = 1024 * 1024

rands = lambda x: ''.join(random.choice(string.letters + string.digits) for x in xrange(x))
with open(out_file, 'w') as f:
f.write(rands(file_size))

Increase uwsgi_buffer_size to run django-openid-auth on dotCloud

To enable Django OpenID authentication, I choose django-openid-auth. But when I deploy to dotcloud, there’s a ‘404’ as welcome message :p Read more →

Deploy django project to dotCloud

QuickNote: follow the Official guide may not be enough. Read more →