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
input { | |
stdin { | |
codec => multiline { | |
pattern => "^\[%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ}\]" | |
negate => true | |
what => "previous" | |
auto_flush_interval => 10 | |
} | |
type => "php-error" | |
} |
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
/* | |
* Delete all Gmail / Google Apps Email threads in a given label. | |
* This is really only necessary when you have tons (read: hundreds | |
* of thousands) of messages to delete and the web interface crashes. | |
* | |
* Warning: if you don't understand this code, you might just delete | |
* all of your email! | |
* | |
* Author: Steve Kamerman, 2017 | |
* |
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 | |
if ($_POST) { | |
header("content-type: application/json"); | |
$data = $_POST; | |
if (isset($data["encoded_data"])) { | |
$data["decoded_data"] = base64_decode($data["encoded_data"]); | |
} |
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 | |
$gw = "Unknown"; | |
// Get the Docker host IP from the routing table | |
$table = file("/proc/net/route"); | |
foreach ($table as $row) { | |
// Split the fields out of the routing table | |
$fields = preg_split("/[\t ]+/", trim($row)); | |
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 python2 | |
from random import randint | |
def generate_imei(incomplete_imei): | |
luhn_sum = 0 | |
imei_digits = [] | |
for i in xrange(0,14): | |
# Pull each digit from the TAC, generate missing numbers with rand() |
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 -e | |
# list_varnish_includes.sh | |
# Recursively list all of the Varnish VCL config files that are included via "include" statements. | |
# This scripts should work in Varnish 2-4+ | |
# Author: Steve Kamerman | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: ./$(basename $0) <path_to_config.vcl>" >&2 | |
exit 2 | |
fi |
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 python2 | |
# | |
# exif_comment_to_lightroom.py | |
# | |
# Windows Metadata Comments => Adobe Lightroom Sync | |
# | |
# This script will decode and copy the comment field from the Windows metadata details | |
# (when you right-click on an image and go to details in Windows Explorer) into the | |
# Adobe Lightroom compatible IPTC XMP caption field. After running, select all affected | |
# images and select Metadata -> Read Metadata from File. |
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 python2.7 | |
from datetime import date, datetime | |
import ephem | |
mylocation = ephem.Observer() | |
mylocation.lat, mylocation.lon = '39.039502', '-77.486371' | |
min_alt = ephem.degrees('10:00') |
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
{ | |
"AppleTV2,1": "Apple TV 2G", | |
"AppleTV3,1": "Apple TV 3", | |
"AppleTV3,2": "Apple TV 3 (2013)", | |
"AppleTV5,3": "Apple TV 4 (2015)", | |
"iPad1,1": "iPad 1", | |
"iPad2,1": "iPad 2 (WiFi)", | |
"iPad2,2": "iPad 2 (GSM)", | |
"iPad2,3": "iPad 2 (CDMA)", | |
"iPad2,4": "iPad 2 (Mid 2012)", |
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/sh -e | |
# This cgi-fcgi and Perl-based, dead simple FGCI client works out-of-the-box with just | |
# a stock Perl installation and cgi-fcgi (apt-get install libfcgi0ldbl) | |
# It was made as a simple FCGI client for health-checking FCGI daemons, for example, in | |
# a minimal Debian-based Docker image. It is tested against PHP-FPM and HHVM | |
# By: Steve Kamerman | |
# | |
# Usage: ./fcgi_get.sh <fcgi_ip>:<fcgi_port> <script_path> <document_root> [GET|HEAD|POST|PUT|DELETE] | |
# If invalid arguments are passed, exit code 1 is returned | |
# If the connection succeeds, exit code 0 is returned and the HTTP Headers are output on STDERR |