This concept is very much like .jar or .war archives in Java.
NOTE: The built
.pyzzipapp can run on both Python 2 & 3 but you can only build.pyzzipapps with Python 3.5 or later.
| #!/bin/bash | |
| # provide semi-automatic dns to docker container | |
| # just call this script | |
| DNSMASQ_CONF_DIR=/etc/dnsmasq.d | |
| PRIMARY_DOMAIN=ms.foo | |
| import shlex | |
| import subprocess | |
| import select | |
| class stdout(str): | |
| """A string representation from stdout.""" | |
| # Install ARCH Linux with encrypted file-system and UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Based on https://gist.github.com/mattiaslundberg/8620837 | |
| # And based on https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
| # Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. |
| # Install ARCH Linux with encrypted file-system and EFI on 8,2 MacBook. | |
| # The official installation guide contains a more verbose description: | |
| # https://wiki.archlinux.org/index.php/Installation_Guide | |
| # Resize "Macintosh HD" to make room for Linux. This works live, including with | |
| # whole-disk encryption (WDE, FileVault). Ensure backups are current, of course, | |
| # before proceeding | |
| diskutil list | |
| diskutil cs list | |
| # Ensure all data will fit in 250G, with some to spare! |
| # arch uefi dm-crypt zfsroot install (archiso) | |
| # partition disk | |
| # start at 1MB (sector 2048) | |
| 512Mib EFI | |
| 512Mib Boot | |
| Rest ZFS | |
| #setup encrypted partition | |
| cryptsetup luksFormat -l 512 -c aes-xts-plain64 -h sha512 /dev/disk/by-partuuid/<uid> |
| from pyramid.security import NO_PERMISSION_REQUIRED | |
| def includeme(config): | |
| config.add_directive( | |
| 'add_cors_preflight_handler', add_cors_preflight_handler) | |
| config.add_route_predicate('cors_preflight', CorsPreflightPredicate) | |
| config.add_subscriber(add_cors_to_response, 'pyramid.events.NewResponse') | |
| class CorsPreflightPredicate(object): |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import Session | |
| from myapp.models import BaseModel | |
| import pytest | |
| @pytest.fixture(scope='session') | |
| def engine(): | |
| return create_engine('postgresql://localhost/test_database) |
| import sys | |
| import pytest | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker | |
| from alembic.command import upgrade as alembic_upgrade | |
| from alembic.config import Config as AlembicConfig | |
| from wsgi import create_app | |
| from config import config |
| import asyncio | |
| import injections | |
| import aiopg.sa | |
| from aiohttp import web | |
| @injections.has | |
| class SiteHandler: | |
| # this is only place holder, actual connection |
This concept is very much like .jar or .war archives in Java.
NOTE: The built
.pyzzipapp can run on both Python 2 & 3 but you can only build.pyzzipapps with Python 3.5 or later.