Skip to content

Instantly share code, notes, and snippets.

arianna-aondio aondio

  • Italy
Block or report user

Report or block aondio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Host based backend
sub vcl_recv {
if (req.http.host == "t1.weiyuzw.com") {
set req.backend_hint = origin_t1_weiyuzw;
}
}
View VCL-static
vcl 4.0;
import http;
# We define the origin servers
# assumption they listen on port 80, please change it if not true
backend origin_a {
.host = "103.234.96.112";
.port = "80";
}
View hash with sick backends
varnishtest "hash director with sick backend"
server s1 -repeat 2 {
rxreq
expect req.url == "/s1"
expect req.http.Host == "host2"
txresp -hdr "Server: s1" -body "server1"
} -start
server s2 {
View ESI test
varnishtest ESI
server s1 {
rxreq
txresp -body {
<html>
Before include
<!--esi <esi:include src=""/> -->
After include
}
View Sticky hashing
vcl 4.1;
import cookieplus;
import header;
import std;
import directors;
backend default {
.host = "127.0.0.1";
.port = "8081";
View grace with sick backends
server s1 { # Part 1 requests
rxreq
txresp -body "1"
expect req.url == "/1"
rxreq
txresp -body "2"
expect req.url == "/1"
# Part 2 requests
rxreq
View prefetch
http.init(0);
http.req_copy_headers(0)
http.req_set_method(0, "HEAD");
# // Generate the next URL by incrementing the first
# // number sequence found and send it back to Varnish.
# // If no number sequence is found, the request is skipped.
http.req_set_url(0, http.prefetch_next_url());
http.req_send_and_finish(0);
@aondio
aondio / ova-to-box.md
Created Apr 8, 2019
Convert VirtualBox .ova to Vagrant box
View ova-to-box.md

Here's a step by step guide to convert a Virtualbox .ova to a Vagrant box.

  1. List your VMs to find the VM id you want to convert:
$ VBoxManage list vms
"testing" {a3f59eed-b9c5-4a5f-9977-187f8eb8c4d4}
  1. You can now package the .ova VM as Vagrant box:
@aondio
aondio / Recursive intent handler
Last active Jan 4, 2019
We have define intent handlers A and B. When intent A is triggered it will return a call to intent B which will eventually handle the rest of the logic
View Recursive intent handler
//Intent handler A calls intent handler B
const A_IntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'A_IntentHandler';
},
handle(handlerInput) {
// some code
View braccio.json
{
"type": "APL",
"version": "1.0",
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"layouts": {},
"mainTemplate": {
"parameters": [
You can’t perform that action at this time.