- switch to django-fernet-fields
- django-dbsettings
- modify to fetch key from db in stead of settings
- store keys in encrypted table using pgcrypt (per tentant?)
- figure out rotation algorithm
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
theta0 = 0 | |
theta1 = 0 | |
alpha = .2 | |
dataset = [ | |
{'x': 1, 'y': 0.5}, | |
{'x': 2, 'y': 1}, | |
{'x': 4, 'y': 2}, | |
{'x': 0, 'y': 0}, |
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 pkgutil | |
import encodings | |
import os | |
def all_encodings(): | |
modnames = set([modname for importer, modname, ispkg in pkgutil.walk_packages( | |
path=[os.path.dirname(encodings.__file__)], prefix='')]) | |
aliases = set(encodings.aliases.aliases.values()) | |
return modnames.union(aliases) |
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 datetime | |
from django.conf import settings | |
from tenant_schemas.utils import tenant_context | |
from zeep import Client | |
from apps.company import models | |
from apps.member.models import Tenant |
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 json | |
import pymysql | |
from django.conf import settings | |
class WordPress: | |
db = None | |
cursor = None |
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
#!/bin/bash | |
for file in *.mkv; do | |
newfile=`echo $file | sed "s/[_]/ /g" | sed "s/\s\.mkv$/\.mkv/" | sed "s/^DBZ -/Dragonball Z/"` | |
mv "$file" "$newfile" | |
done |
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
# pre commit | |
find apps -type d -name migrations -exec ls -1 '{}' ';' | md5sum > md5sum | |
git add md5sum -m 'updated md5sum' | |
# before test | |
find apps -type d -name migrations -exec ls -1 '{}' ';' | md5sum | diff md5sum - |
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
ctx = {} | |
if request and not isinstance(request.user, AnonymousUser): | |
ctx.update({ | |
'user_email': request.user.email, | |
'username': request.user.username, | |
}) | |
logger.info(ctx) | |
elif request and isinstance(request.user, AnonymousUser): |
- install protonbridge
- setup thunderbird for protonbridge
- change MX records main domain to point to protonmail
- setup MX records other domain to point to google
- setup accounts on new domain in google
- migrate mail from users old domain to users new domain
- wait
- setup accounts new domain in thunderbird
- move mail from accounts new domain to protonmail account
- let it sync