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 | |
$url = 'https://www.google.de'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); | |
$response = curl_exec($ch); |
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
RewriteEngine On | |
RewriteCond %{DOCUMENT_ROOT}/static.html -f | |
RewriteCond %{SCRIPT_FILENAME} !static.html | |
RewriteRule ^.*$ /static.html [R=503,L] | |
ErrorDocument 503 /static.html |
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
#!/bin/bash | |
KERNEL_MODULE=softdog | |
WATCHDOG_DEVICE=/dev/watchdog | |
LOGFILE=/deadmancheck.log | |
WATCHDOG_TIMEOUT=30 | |
SLEEPTIMER=3 | |
#### |
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
for i in $(rpm -qa); | |
do | |
rpm -qs $i | grep -q "not installed" && test $(rpm -qlc $i | wc -l) -ne 0 && echo $i | |
done |
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
#!/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
<?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
#!/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 | |
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)") |