Installation template for FreeBSD RELEASE
, STABLE
and CURRENT
.
Distribution Select
[ ] doc
[*] src (for building ports)
package main | |
// operation is a clean up function on shutting down | |
type operation func(ctx context.Context) error | |
// gracefulShutdown waits for termination syscalls and doing clean up operations after received it | |
func gracefulShutdown(ctx context.Context, timeout time.Duration, ops map[string]operation) <-chan struct{} { | |
wait := make(chan struct{}) | |
go func() { | |
s := make(chan os.Signal, 1) |
package main | |
import ( | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
"math/big" | |
) |
package main | |
import ( | |
"net/http" | |
) | |
type SingleHost struct { | |
handler http.Handler | |
allowedHost string | |
} |
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/go-ldap/ldap/v3" | |
) | |
const ( |
{% load static %} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
{% block meta_tags %} | |
<meta name="csrf-token" content="{{ csrf_token }}"> | |
{% endblock %} | |
"""Simple content negotiation | |
Usage: | |
Example 1: | |
from renderers import render | |
@router.post("/myapp/items/") | |
async def api_login(item: Item, accept: Optional[str] = Header(default='application/jwt')): |
from fastapi import FastAPI, UploadFile, HTTPException | |
from starlette.requests import Request | |
from streaming_form_data import StreamingFormDataParser | |
from streaming_form_data.targets import FileTarget | |
from tempfile import NamedTemporaryFile | |
import os | |
import shutil |
from typing import Optional | |
import base64 | |
from passlib.context import CryptContext | |
from datetime import datetime, timedelta | |
import jwt | |
from jwt import PyJWTError | |
from pydantic import BaseModel |
### FDE | |
man mkinitfs-bootparam | |
# filename and path is important | |
dd bs=512 count=4 if=/dev/urandom of=/crypto_keyfile.bin | |
cryptsetup luksAddKey /dev/sda1 /crypto_keyfile.bin | |
chmod 0 /crypto_keyfile.bin | |
cat /etc/mkinitfs/mkinitfs.conf | |
features="... cryptsetup cryptkey" |