Skip to content

Instantly share code, notes, and snippets.

Thijs Feryn ThijsFeryn

View GitHub Profile
@ThijsFeryn
ThijsFeryn / default.vcl
Created Jun 22, 2020
Varnish synth output
View default.vcl
vcl 4.1;
backend default none;
sub vcl_recv {
return(synth(200,"OK"));
}
@ThijsFeryn
ThijsFeryn / varnish.service
Created May 13, 2020
varnish systemd service
View varnish.service
[Unit]
Description=Varnish Cache Plus, a high-performance HTTP accelerator
After=network-online.target
[Service]
Type=forking
KillMode=process
# Maximum number of open files (for ulimit -n)
LimitNOFILE=131072
@ThijsFeryn
ThijsFeryn / docker-compose.yml
Created Apr 1, 2020
Varnish docker-compose.yml file that defines container dependencies
View docker-compose.yml
version: '3'
services:
echo-server:
image: "jmalloc/echo-server:latest"
container_name: origin
hostname: origin
ports:
- "8080:8080"
varnish:
image: "varnish:latest"
@ThijsFeryn
ThijsFeryn / drupalcon_jwt_varnish.vcl
Created Sep 27, 2017
VCL file that describes my JWT implementation in Varnish for Drupal. Part of my DrupalCon Vienna 2017 presentation.
View drupalcon_jwt_varnish.vcl
vcl 4.0;
import std;
import var;
import cookie;
import digest;
acl internal {
"192.168.20.0"/24;
}
View edgestash-twig-extension.php
<?php
namespace App\EdgestashBundle;
use Symfony\Component\HttpFoundation\RequestStack;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
class TwigExtension extends AbstractExtension
{
@ThijsFeryn
ThijsFeryn / edgestash-subscriber.php
Created Sep 2, 2019
edgestash negotiation in Symfony
View edgestash-subscriber.php
<?php
namespace App\EdgestashBundle\EventSubscriber;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
class EdgestashSubscriber implements EventSubscriberInterface
{
@ThijsFeryn
ThijsFeryn / edgestash-synth-backend.vcl
Created Aug 5, 2019
edgestash through link headers & a synthesized JSON backend
View edgestash-synth-backend.vcl
vcl 4.1;
import cookieplus;
import edgestash;
import std;
import ykey;
import redis;
import synthbackend;
backend default {
.host = "origin";
View test-thijs2.vtc
varnishtest "Redis VMOD and strings containing NULL chars"
shell {
python - <<EOF
import base64
import redis
b64 = 'X3NmMl9hdHRyaWJ1dGVzfGE6Mjp7czo1OiJsaWtlZCI7YTowOnt9czoxNDoiX3NlY3VyaXR5X21haW4iO3M6OTAzOiJDOjc0OiJTeW1mb255XENvbXBvbmVudFxTZWN1cml0eVxDb3JlXEF1dGhlbnRpY2F0aW9uXFRva2VuXFVzZXJuYW1lUGFzc3dvcmRUb2tlbiI6ODE1OnthOjM6e2k6MDtOO2k6MTtzOjQ6Im1haW4iO2k6MjthOjQ6e2k6MDtPOjQxOiJTeW1mb255XENvbXBvbmVudFxTZWN1cml0eVxDb3JlXFVzZXJcVXNlciI6Nzp7czo1MToiAFN5bWZvbnlcQ29tcG9uZW50XFNlY3VyaXR5XENvcmVcVXNlclxVc2VyAHVzZXJuYW1lIjtzOjU6InRoaWpzIjtzOjUxOiIAU3ltZm9ueVxDb21wb25lbnRcU2VjdXJpdHlcQ29yZVxVc2VyXFVzZXIAcGFzc3dvcmQiO3M6NjA6IiQyeSQxMiQxaUVVNVJ0REZUQkptMGhocXpZR2NPamdSTFhXUGlPQjYzS2VFVVhNNXA5bFFLejlFeklUQyI7czo1MDoiAFN5bWZvbnlcQ29tcG9uZW50XFNlY3VyaXR5XENvcmVcVXNlclxVc2VyAGVuYWJsZWQiO2I6MTtzOjYwOiIAU3ltZm9ueVxDb21wb25lbnRcU2VjdXJpdHlcQ29yZVxVc2VyXFVzZXIAYWNjb3VudE5vbkV4cGlyZWQiO2I6MTtzOjY0OiIAU3ltZm9ueVxDb21wb25lbnRcU2VjdXJpdHlcQ29yZVxVc2VyXFVzZXIAY3JlZGVudGlhbHNOb25FeHBpcmVkIjtiOjE7czo1OToiAFN5bWZvbnlcQ29tcG9uZW50XFN
@ThijsFeryn
ThijsFeryn / varnishusage.go
Last active Jun 7, 2019
A Go script that retrieves the Varnish memory consumption and returns it via a RESTful API using GoJi
View varnishusage.go
package main
import (
"strconv"
"net/http"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
"os/exec"
"encoding/json"
)
@ThijsFeryn
ThijsFeryn / bio_en.md
Last active Feb 26, 2019
Thijs Feryn's bio
View bio_en.md

Thijs Feryn is a "technical evangelist" at Varnish Software, the company behind the Varnish Cache open source technology. His goal is to bring technology to the people and people to technology. He focuses on bridging the gap between code and infrastructure. Thijs is a published author at O'Reilly, he is also involved in many open source communities. He speaks, listens, writes, codes, teaches, blogs, vlogs, organizes and is above all very excited to speak at "your event name"

You can’t perform that action at this time.