This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Heizkoerpertemperatur bei geoeffnetem Verschluss absenken | |
description: | |
An automation blueprint that reduces the set temperature of your climate | |
device or group if a contact sensor is open for more than the preset wait time. | |
It uses the Homematic window sensor channel to set the temperature to the "Open-window | |
temperature" set in the device configuration. You should set the "Mode for temperature | |
fall detection" to Inactive to avoid conflicts. It waits until the contact is closed | |
again in order to restore the climate entity temperature. It has an optional blocking | |
entity to prevent the automation running unnecessarily, for example during the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IMAGE=$1 | |
PARENT=$IMAGE | |
declare -a RESULTS REV_RESULTS | |
while [ -n "${PARENT}" ]; do | |
JSON=$(docker inspect $PARENT |jq .) | |
RESULTS+=("$(echo $JSON | jq '.[0]'.ContainerConfig.Cmd)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# use with: | |
# udevadm control --log-level=debug | |
# | |
# example output: | |
# | |
# ACTIVE: 0, STARTED: 142, SUCCEEDED: 142, BURSTS: 0, LONGEST: 0.366994 secs (device: dm-18, start: 11:22:09.099568, end: 11:22:09.466562) | |
# Burst detected. Resetting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USE_SYSTEMD_JOURNAL=0 | |
LOGFILE=/var/log/snapper.log | |
WAIT_FOR_HITS=3 | |
SEARCH_TERM="test 123" | |
################ | |
if [ ${USE_SYSTEMD_JOURNAL} -lt 1 ] && ! [ -r ${LOGFILE} ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
log-send-hostname | |
maxconn 4096 | |
pidfile /var/run/haproxy.pid | |
user haproxy | |
group haproxy | |
daemon | |
stats socket /var/run/haproxy.stats level admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = 0.20; | |
// Test 1: | |
$b = 1 - 0.80; // 0.20 | |
if ($a == $b) { | |
echo "true"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple one-liner to increase and print dates. To be used in scripts. | |
# Current command starts today and prints next 100 dates. | |
# | |
# Output: | |
# 2021-07-26 | |
# 2021-07-27 | |
# 2021-07-28 | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
import re | |
from datetime import datetime, timedelta | |
if not len(sys.argv) == 4: | |
print('\n * usage: ' + sys.argv[0] + ' %Y-%m-%d-%H:%M[:%S] add|sub #seconds\n') | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env stap | |
global log_nfs_file_open = 1; | |
global log_nfs_file_read = 1; | |
global log_nfs_file_write = 1; | |
global log_nfs_getattr = 1; | |
global log_nfs_permission = 1; | |
global log_nfs_opendir = 1; | |
global log_nfs_lookup = 1; |
NewerOlder