View gist:ac06994b212d37b5220c61d7452ba663
{config,...}:
{
services.tor = {
enable = true;
extraConfig = ''
SocksPort 0
HiddenServiceNonAnonymousMode 1
HiddenServiceSingleHopMode 1
ExitNodes {de}
NewCircuitPeriod 120
View 0_README.md
$ nix-shell 'https://gist.github.com/Mic92/93f65c4d42ac72c8d64397258cada90c/archive/0159f2d6894ea2928e0b05d6ee46349be81681d6.tar.gz' --command 'studio-link'
View performance-graph.py
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3 python3Packages.seaborn python3Packages.natsort
from plot import sns, plt
import matplotlib
from collections import defaultdict
from lxml import etree
import natsort
import pandas as pd
import re
View verify-github-webhooks.pl
use Digest::HMAC_SHA1;
# nix-shell -p perlPackages.DigestHMAC
# @body: full http post body
# @signature: value of X-Hub-Signature header field
# @secret_key: value configured in https://developer.github.com/v3/repos/hooks/#create-hook-config-params
# return: 1 if signature is correct
sub verify_signature {
my ($body, $signature, $secret_key) = (@_);
View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
bashInteractive
gcc5
];
}
View mkdir_p.rs
use std::io;
use std::path::Path;
use std::fs::create_dir_all;
fn mkdir_p<P: AsRef<Path>>(path: &P) -> io::Result<()> {
if let Err(e) = create_dir_all(path) {
if e.kind() != io::ErrorKind::AlreadyExists {
return Err(e)
}
}
View config
snapper.configs = let
extraConfig = ''
ALLOW_GROUPS="sudo wheel"
TIMELINE_CREATE="yes"
TIMELINE_CLEANUP="yes"
EMPTY_PRE_POST_CLEANUP="yes"
'';
in {
"home" = {
subvolume = "/home";
View main.c
#include <unistd.h>
int main() {
int a;
int *c = malloc(sizeof(int));
// 1. constraint: a[t - 3] = β, c = *μ
// 2. concrete: a[t - 3] = 0, c = 0x10, mem[0x10][t - 2] = 0;
read(fileno(stdin), &a, sizeof(a));
// 1. constraint: a[t - 2] = α where α > 10 && α <= 11
View gist:5a2f43b67d600c403688fd9315e834ef
Things done:
- splice read/splice write
- multi-threading
- optimized for cached read with a micro-benchmark:
-> splice read/splice write does not improve for neither read/write the performance (contradicting to the FAST paper)
- set FOPEN_KEEP_CACHE flag on opened files:
- operating system can use page cache (danger of double caching -> open files underlying with DIRECT_IO?)
- we must also ensure that our fuse is the only reader/writer to its underlying filesystem (similar to overlayfs)
- last night: enable write cache/async write
- increases async io, but might affect cache read
View top37
(pprof) top37
Total: 1690 samples
1673 99.0% 99.0% 1673 99.0% __splice_nocancel
9 0.5% 99.5% 10 0.6% __read_nocancel
2 0.1% 99.6% 2 0.1% __vmsplice_nocancel
2 0.1% 99.8% 2 0.1% sdallocx
1 0.1% 99.8% 728 43.1% ::splice
1 0.1% 99.9% 1 0.1% __libc_read
1 0.1% 99.9% 1 0.1% __pthread_enable_asynccancel
1 0.1% 100.0% 1 0.1% __writev_nocancel