- based on small Digital Ocean VPS (1CPU / 1GB RAM) with Ubuntu 16.04
- SSH keys are recommended, but not described here
- (sub) domain name necessary for SSL certificate
Login as "root"
| # -*- encoding: utf-8 -*- | |
| # requires a recent enough python with idna support in socket | |
| # pyopenssl, cryptography and idna | |
| from OpenSSL import SSL | |
| from cryptography import x509 | |
| from cryptography.x509.oid import NameOID | |
| import idna | |
| from socket import socket |
| """ | |
| #Disclaimer | |
| - Use with caution | |
| - Don't be evil | |
| - Respect your users | |
| """ | |
| class FingerPrintMiddleware(object): | |
| def process_request(self, request): | |
| import hashlib |
| from django.utils.text import gettext_lazy as _ | |
| from rest_framework import serializers | |
| from rest_framework_simplejwt.tokens import RefreshToken, TokenError | |
| class RefreshTokenSerializer(serializers.Serializer): | |
| refresh = serializers.CharField() | |
| default_error_messages = { | |
| 'bad_token': _('Token is invalid or expired') | |
| } |
Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator
This document is an attempt to describe the first step of a large project structure with flask and some basic modules:
Please feel free to fix and add your own tips.
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| pragma solidity ^0.4.16; | |
| contract AcademicRegistry { | |
| address admin; | |
| enum Permissions { | |
| CanEnrollCandidate, | |
| CanUpdateProgram, | |
| CanUpdateUnits, | |
| CanUpdateStaff, | |
| CanClearCandidate, |
| /* | |
| Dribbble | |
| ------------------------------------------------------------ */ | |
| a.button-dribbble { | |
| background-color: #c93764; /* fallback color */ | |
| background: -moz-linear-gradient(top, #ea4c89, #c93764); | |
| background: -ms-linear-gradient(top, #ea4c89, #c93764); | |
| background: -webkit-linear-gradient(top, #ea4c89, #c93764); | |
| border: 1px solid #c93764; |
| # -*- coding: utf-8 -*- | |
| import os | |
| import StringIO | |
| import hashlib | |
| try: | |
| from boto.s3.connection import S3Connection | |
| from boto.s3.key import Key | |
| except ImportError: | |
| raise ImproperlyConfigured, "Could not load Boto's S3 bindings." |