Skip to content

Instantly share code, notes, and snippets.

View nigoroll's full-sized avatar
💭
now on fosstodon https://fosstodon.org/@slink

Nils Goroll nigoroll

💭
now on fosstodon https://fosstodon.org/@slink
View GitHub Profile
@nigoroll
nigoroll / templifetime.c
Last active February 22, 2022 15:35
C modify temporary lifetime object
#include <stdio.h>
#include <assert.h>
struct A {
int b;
};
struct X {
int x;
struct A *a;
@nigoroll
nigoroll / client.c
Created November 16, 2021 19:04
uds trivial example from unix(7)
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include "connection.h"
int
@nigoroll
nigoroll / gist:bc22ee1cfb2f8c24492a2e6d5e640905
Last active November 15, 2021 12:42
SunOS r02722.vtc as of 27d680d57e1f736cc46e03bb8eb106f1d11b400e
**** dT 0.000
* top TEST tests/r02722.vtc starting
**** top extmacro def pwd=/tmp/dridi/varnish-cache/bin/varnishtest
**** top extmacro def date(...)
**** top extmacro def string(...)
**** top extmacro def localhost=fc00:a462:8e9e:946a:5df3:31c6:d23:18dc
**** top extmacro def bad_backend=[fc00:a462:8e9e:946a:5df3:31c6:d23:18dc]:34448
**** top extmacro def listen_addr=[fc00:a462:8e9e:946a:5df3:31c6:d23:18dc]:0
**** top extmacro def bad_ip=192.0.2.255
**** top extmacro def topbuild=/tmp/dridi/varnish-cache
@nigoroll
nigoroll / r02722.log
Created November 9, 2021 10:22
#3732 on SunOS gcc 64bit
**** dT 0.000
* top TEST ./tests/r02722.vtc starting
**** top extmacro def pwd=/tmp/dridi/varnish-cache/bin/varnishtest
**** top extmacro def date(...)
**** top extmacro def string(...)
**** top extmacro def localhost=fc00:a462:8e9e:946a:5df3:31c6:d23:18dc
**** top extmacro def bad_backend=[fc00:a462:8e9e:946a:5df3:31c6:d23:18dc]:61567
**** top extmacro def listen_addr=[fc00:a462:8e9e:946a:5df3:31c6:d23:18dc]:0
**** top extmacro def bad_ip=192.0.2.255
**** top extmacro def topbuild=/tmp/dridi/varnish-cache
[uplex@vtest2 ~]$ cc -V
cc: Sun C 5.13 SunOS_i386 2014/10/20
[uplex@vtest2 ~]$ cc /tmp/t.c
[uplex@vtest2 ~]$ ./a.out
vmin(5, 8): 5
vmax(5, 8): 8
vmin(a, b): 5
vmax(a, b): 8
vlimit(a, 6, 7): 6
vlimit(b, 6, 7): 7
[Service]
ExecStart=
ExecStart=/opt/varnish/sbin/varnishd \
-a http=:80 \
-a tls=/shared/varnish_haproxy/varnish_proxy,PROXY,mode=777 \
-p feature=+http2 \
-p vcl_path=/etc/varnish:/opt/varnish/share/varnish/vcl \
-f /etc/varnish/default.vcl -s malloc,256m
ExecReload=
ExecReload=/opt/varnish/sbin/varnishreload -m 3 -w 10
@nigoroll
nigoroll / gunzip_stream.vtc
Created February 17, 2019 14:14
varnish 2904 vtc without the 503s
varnishtest "VDP gunzip OA_GZIPBITS streaming race"
# Note this should run with -j64 -n10000
server s1 -repeat 50 -keepalive {
rxreq
txresp -gziplen 3167
} -start
varnish v1 -vcl+backend {
@nigoroll
nigoroll / builtin.yaml
Created February 8, 2019 16:36
YAVC: VCL as YAML
# slink@uplex.de 20190208:
#
# mockup how builtin.vcl could look in YAML
#
# * passes yamllint
# * YAML structure (schema) is likely to be wrong / not ideal
#
# NOTE: I am _not_ advocating for anything like this, my personal
# opinion is that is über-ugly
#
typeset -ra projs=(
varnish-cache
varnish-modules
varnish-objvar
varnishevent
)
typeset -ra vmods=(
all_healthy
frozen
@nigoroll
nigoroll / gist:1cd3932172ca8ac03c2f3ef909fc1cf6
Created September 8, 2016 11:53
old MADV_DONTDUMP patch
commit 77444bb6dca702e075aa44f7b4c7358e87927163
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Mon Apr 25 16:22:50 2016 +0200
MADV_DONTDUMP
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index dc15ddf..0915781 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c