This file contains hidden or 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 psycopg2 import connect, extensions, sql, OperationalError | |
| import re | |
| POSTGRES_PASSWORD = 'mypasswd' | |
| POSTGRES_USER = 'myuser' | |
| POSTGRES_DB = 'mytest12' | |
| connect_string = f"postgres://{POSTGRES_USER}:{POSTGRES_PASSWORD}@localhost" | |
| db_connect_string = f"{connect_string}/{POSTGRES_DB}" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| """ | |
| curl -d '{"data":"abc123"}' -H "Content-Type: application/json" -X POST http://localhost:8000/thing/data | |
| """ | |
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from starlette.requests import Request | |
| app = FastAPI() |
This file contains hidden or 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
| # dirs/c/xx_plugins/c_module/__init__.py | |
| # dirs/c/xx_plugins/d_module/__init__.py | |
| # dirs/a/b/xx_plugins/ab_module/__init__.py | |
| import sys | |
| import os.path as op | |
| import importlib | |
| import pkgutil | |
| from types import ModuleType | |
| from typing import List |
This file contains hidden or 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
| apt install ca-certificates curl gnupg lsb-release | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ | |
| | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | |
| | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| apt update | |
| apt install docker-ce docker-ce-cli containerd.io -y | |
| usermod -aG docker $USER |
This file contains hidden or 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
| # Assume logged in as `root` in ProxMox 8 | |
| cd /root | |
| # Install prereqs | |
| apt install -y skopeo umoci jq -y | |
| # Download and extract RootFS | |
| lxc-create unifi-controller-7.4.162 -t oci --lxcpath /root/lxc -- --url docker://linuxserver/unifi-controller:7.4.162 |
OlderNewer