GPG can be a bit difficult to wrap your head around at first since its slightly more complex than using asymmetric encryption through SSH or OpenSSL. It can be extremely useful, however, for encrypting files, communications, or verifying digital signatures.
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 uuidfield import UUIDField | |
from django.contrib import admin | |
class APIKey(models.Model): | |
apikey = UUIDField(auto=True) | |
url = models.CharField(max_length=255, blank=True, null=True) | |
client = models.ForeignKey(Client, related_name='apikeys') | |
scope = models.CharField(max_length=64, blank=True, null=True) | |
active = models.BooleanField(default=True) |
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
import re | |
import htmlentitydefs | |
from lxml import etree as ET | |
from bs4 import UnicodeDammit | |
def resolve_entities(entitystring): | |
""" | |
Credits for this function go to Fredrik Lundh |
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
# NOTE: these workarounds are collected here, but are NOT my work, | |
# credit goes to the original authors for finding the workarounds! | |
# TODO: add links to articles crediting original authors | |
try: | |
""" | |
if you don't want to patch the ssl library and are just using | |
requests, then you can use an adapter to force TLS on HTTPS; | |
""" | |
import requests |
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
""" | |
Author: Bryce Eggleton | |
License: MIT | |
""" | |
import json | |
import traceback | |
def _get_container(): | |
""" |
landrush is an excellent Vagrant plugin if you are trying to develop or test in a multi-machine VM environment. It works by spinning up a small local DNS server and registering the private network IPs of each machine during vagrant up
so that they can be accessed via their hostname in both the host machine as well as the other guest machines. A great bonus of using landrush is that the VMs can be defined in separate Vagrantfiles (e.g. if you have separate git repos for building different machines).
vagrant landrush status
- show whether the DNS server
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/local/env bash | |
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi | |
############################################################################### | |
### use local directories for homebrew and python | |
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" | |
############################################################################### | |
### virtualenv setup and shortcuts |
http://supervisord.org/installing.html#installing-via-pip
Install via pip install supervisor --pre
unless you really really need a distribution-specific package. The service integration from distribution
OlderNewer