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
# This code is under the MIT license. | |
# Inspired by this StackOverflow question: | |
http://stackoverflow.com/questions/3295405/creating-django-objects-with-a-random-primary-key | |
import struct | |
from Crypto.Cipher import DES | |
from django.db import models | |
def base36encode(number): | |
"""Encode number to string of alphanumeric characters (0 to z). (Code taken from Wikipedia).""" |
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
Here is a sample of how I am currently dealing with users. | |
Big thanks to uggedal! I used his user states as an example: https://github.com/uggedal/states | |
### | |
# How to create password hashes | |
### | |
python -c "import crypt; print crypt.crypt('password', '\$6\$SALTsalt\$')" | |
### |
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
Host vagrant | |
HostName localhost | |
User vagrant | |
Port 2210 | |
UserKnownHostsFile /dev/null | |
StrictHostKeyChecking no | |
IdentityFile /Users/pblittle/.rvm/gems/ruby-1.9.2-p290@wilbur/gems/vagrant-0.9.7/keys/vagrant |