This file contains hidden or 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 python | |
| # | |
| # Parses the output of storcli: | |
| # storcli /c0 show all J | |
| import sys | |
| import json | |
| output_dir = "." | |
| data = json.load(sys.stdin) |
This file contains hidden or 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 | |
| # Start this script before you start NGINX, so it is ready and waiting for log data. | |
| # You should start it in the background with & or run it from supervisord or something. | |
| # If the port is above 1024, you can run this script as a non-root user (recommended). | |
| # | |
| # It listens for raw Syslog data over UDP, parses is, aggregates it, and writes | |
| # it to a file every flush_interval seconds. The output file format looks like this: | |
| # key<TAB>value | |
| # Here is an example (note that the delimiter is actually TAB, not a space): |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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') |