Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
[uwsgi] | |
# Variables | |
base = /var/www/blog | |
app = simple | |
# Generic Config | |
plugins = http,python | |
home = %(base)/venv | |
pythonpath = %(base) | |
socket = /var/www/run/%n.sock | |
module = %(app) |
description "uWSGI" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
env UWSGI=/usr/bin/uwsgi | |
env LOGTO=/var/log/uwsgi/emperor.log | |
exec $UWSGI --master --emperor /etc/uwsgi/apps-enabled --die-on-term --uid nginx --gid nginx --logto $LOGTO |
server { | |
listen 80; | |
server_name blog; | |
server_name blog.example.com; | |
root /var/www/blog; | |
location /static/ { | |
alias /var/www/blog/static/; | |
expires 30d; | |
access_log off; |
[ | |
{ | |
"pk": 1, | |
"model": "blog.blogpost", | |
"fields": { | |
"status": 2, | |
"expiry_date": null, | |
"allow_comments": true, | |
"description": "This is an example of a blog post.", | |
"title": "example blog post", |
https://certbot.eff.org/#ubuntutrusty-other
mkdir -p /etc/letsencrypt/configs
/etc/letsencrypt/configs/domain.com.conf
mkdir -p /var/www/letsencrypt/
1. Make sure you have the following requisites | |
- Debian or Ubuntu | |
- Postgresql | |
- Python | |
- Tryton | |
2. Install requisite software | |
2.1 apt-get install python-pip python-lxml python-relatorio python-psycopg2 posgresql python-tz |
#!/usr/bin/env python | |
"""A noddy fake smtp server.""" | |
import smtpd | |
import asyncore | |
class FakeSMTPServer(smtpd.SMTPServer): | |
"""A Fake smtp server""" | |
def __init__(*args, **kwargs): |
require 'date' | |
module Nordea | |
module NDA | |
class Record | |
def self.parse(str) | |
self.new(str).normalized | |
end | |
def initialize(str) |