-
We use [Ed25519] for creating digital signatures. Public keys are 32 bytes in length, and signatures are 64 bytes.
-
We will start out with support for BLE (Bluetooth Low Energy) and add support for older versions later.
#!/usr/bin/env bash | |
# | |
# 1:1 TCP NAT using nftables | |
# | |
# Implementation of 1:1 network address translation (NAT) between WAN/LAN | |
# on a Raspberry Pi 4B using nftables. NAT is performed; | |
# | |
# * for a single host on the LAN | |
# * for TCP traffic only | |
# * to specified ports on the LAN host |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
from channels.auth import AuthMiddlewareStack | |
from rest_framework.authtoken.models import Token | |
from django.contrib.auth.models import AnonymousUser | |
from django.db import close_old_connections | |
class TokenAuthMiddleware: | |
""" | |
Token authorization middleware for Django Channels 2 | |
""" |
Django channels are official way for implementing async messaging in Django.
The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.
See related issue
#!/usr/bin/env bash | |
set -o pipefail | |
# This script sets up an additional network namespace for every VPN you wish so that you may | |
# use any VPN at any time for any program without tunneling everything else on your system. | |
# Usage: | |
# Review and edit every line of this script not in a function, then run it as root | |
# on system startup (yes every reboot), eg. crontab @reboot /root/bin/vpnns.sh | |
# It is recommended that you run this script manually at least once as you will |
from decorator import decorator | |
def _check_auth(args, pred): | |
_, _, context, _ = args | |
if not pred(context): | |
raise Exception("Unauthorized") | |
@decorator | |
def is_user(fn, *args, **kwargs): |
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
<?php | |
function html_table($data = array()) | |
{ | |
$rows = array(); | |
foreach ($data as $row) { | |
$cells = array(); | |
foreach ($row as $cell) { | |
$cells[] = "<td>{$cell}</td>"; | |
} |