Skip to content

Instantly share code, notes, and snippets.

View silverbackdan's full-sized avatar

Daniel West silverbackdan

View GitHub Profile
@jclaveau
jclaveau / pre-commit
Last active December 13, 2022 10:13
Replace all variables between brackets like "{{ remote.origin.url }}" by their values retrieved from git
#!/bin/sh
# https://www.viget.com/articles/two-ways-to-share-git-hooks-with-your-team/
# git config core.hooksPath .githooks
# run from the root of the repo
.githooks/replace_by_git_vars.py readme.md README.md
# If your filesystem is not case-sensitive you can use
# .githooks/replace_by_git_vars.py README.template.md README.md
@cupracer
cupracer / varnishlog-examples.sh
Last active September 13, 2024 15:57
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header