dd if=/dev/urandom of=/dev/shm/random.bin bs=65536 count=10000
gcc -g -O3 -o sha256sum sha256sum.c
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Techempower Postgres Audit</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: monospace; | |
background-color: #f0f0f0; |
const fd = just.sys.shmopen('/omgthisiscool') | |
const size = 1 * 1024 * 1024 * 1024 | |
const ab = just.sys.mmap(fd, size) | |
const u32 = new Uint32Array(ab) | |
just.setInterval(() => { | |
just.print(Atomics.load(u32, 0)) | |
}, 1000) |
<p> | |
testing | |
</p> |
wc | |
wcb | |
scratch |
function checksum (file) { | |
const source = Buffer.alloc(65536) | |
const fd = openSync(file) | |
const hash = createHash('sha256') | |
let bytes = readSync(fd, source) | |
while (bytes > 0) { | |
if (bytes < 65536) { | |
hash.update(source.slice(0, bytes)) | |
} else { | |
hash.update(source) |
const { allFortunes } = sock | |
allFortunes.call(() => { | |
const html = getHTML(insertionSort([extra, ...allFortunes.getRows()])) | |
sock.writeString(`${rHTML}${utf8Length(html)}${END}${html}`) | |
}) |
sock.allFortunes = await compile(sock, { | |
formats: [], | |
sql: 'select * from Fortune', | |
fields: [{ format: 1, oid: INT4OID }, { format: 0, oid: VARCHAROID }], | |
name: 's2', | |
portal: '', | |
maxRows: 0, | |
htmlEscape: true, | |
params: [] | |
}) |
sock.allFortunes = await compile(sock, { | |
formats: [], | |
sql: 'select * from Fortune', | |
fields: [{ format: 1, oid: INT4OID }, { format: 0, oid: VARCHAROID }], | |
name: 's2', | |
portal: '', | |
maxRows: 0, | |
htmlEscape: true, | |
params: [] | |
}) |