(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
(draft; work in progress)
See also:
async function generateOneTimePassword(rawKey: Uint8Array, counter: number): Promise<number> { | |
const data = new DataView(new ArrayBuffer(8)); | |
data.setBigUint64(0, BigInt(Math.floor(counter)), false); | |
const algo = { name: 'HMAC', hash: 'SHA-1' }; | |
const key = await crypto.subtle.importKey('raw', rawKey, algo, false, ['sign']); | |
const hmacHash = new Uint8Array(await crypto.subtle.sign(algo, key, data.buffer)); | |
const offset = hmacHash[hmacHash.byteLength - 1] & 0x0f; | |
const hotp = (hmacHash[offset] & 0x7f) << 24 |
{ stdenv, autoPatchelfHook }: | |
stdenv.mkDerivation rec { | |
pname = "wasmcloud-binaries"; | |
version = "1.0"; | |
src = ./.; # Assuming the binaries are in the current directory | |
nativeBuildInputs = [ autoPatchelfHook ]; |
2020年初因为新冠肺炎爆发,所以在家办公,公司给配置了L2TP的VPN,但是我不想所有流量都走VPN(VPN比较慢而且也节省流量),于是想到用路由表给VPN分流。
具体的方案就是公司内网的流量走VPN,外网流量走默认网关。
我是在macOS上操作的,其他平台应该也差不多。
假设:
公司内网 192.168.10.0/24
家里网络 192.168.1.0/24
你已经配置好VPN并且可以使用了。
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
import { decode } from "blurhash" | |
export function blurHashToDataURL(hash: string | undefined): string | undefined { | |
if (!hash) return undefined | |
const pixels = decode(hash, 32, 32) | |
const dataURL = parsePixels(pixels, 32, 32) | |
return dataURL | |
} |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
These are my must-have macros for running games online. I make full use of the compendium, which gives these macros access to common actions and rolls, saving me time.
Remember to add /w gm
or @{selected|wtype}
to hide sensitive info from your players. WTYPE is an attribute used in the 5th Edition OGL character sheet, a prerequisite for most of these.
Here's what my bar looks like.
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE | |
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
8dbd9e392a96 7 months ago 131.5 MB | |
$ docker tag 2844 imagename # <-- that's the secret right there | |
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE |