This file contains 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
test(long): # @test(long) | |
vpbroadcastq ymm0, rdi | |
vpcmpeqq k0, ymm0, ymmword ptr [rip + ls] | |
kmovw eax, k0 | |
vpcmpeqq k0, ymm0, ymmword ptr [rip + ls+32] | |
kmovw ecx, k0 | |
shl rcx, 4 | |
vpcmpeqq k0, ymm0, ymmword ptr [rip + ls+64] | |
or rcx, rax | |
kmovw eax, k0 |
This file contains 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
#!/usr/bin/env bash | |
set -Eeuxo pipefail | |
# Usage example: ./docker_host_port_forward.bash start 4000 14000 | |
# ./docker_host_port_forward.bash stop 4000 14000 | |
# TODO: alpine/socat is not necessarily trustworthy. Find a better base image | |
# or build ourselves. | |
# TODO: If socat is not installed, it fails silently. We should let user know | |
# if it failed and why it failed. |
This file contains 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
import sqlite3 | |
class KeyValueFile: | |
def __init__(self, path): | |
self.conn = sqlite3.connect(path) | |
self.c = self.conn.cursor() | |
self.c.execute('CREATE TABLE IF NOT EXISTS keyvalue (key text PRIMARY KEY, value text)') | |
def put(self, key, value): | |
self.c.execute("INSERT OR REPLACE INTO keyvalue VALUES (?,?)", (key, value)) |