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 | |
# Replaces annoying "fancy" quotes created by programs like Microsoft Word and everything in MacOS | |
# with normal ASCII single-quotes (') or double-quotes (") | |
# This script does NOT replace the GRAVE ACCENT (`) since it is commonly used in Markdown and as a bash command | |
# See: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html | |
SINGLE=$(echo -ne '\u00B4\u2018\u2019') | |
DOUBLE=$(echo -ne '\u201C\u201D') | |
sed -i "s/[$SINGLE]/'/g; s/[$DOUBLE]/\"/g" $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 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 | |
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
for JAIL in $JAILS | |
do | |
fail2ban-client status $JAIL | |
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
#!/bin/bash -e | |
# This scripts installs jq: http://stedolan.github.io/jq/ | |
JQ=/usr/bin/jq | |
curl https://stedolan.github.io/jq/download/linux64/jq > $JQ && chmod +x $JQ | |
ls -la $JQ |
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 | |
# | |
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the | |
# Docker daemon using a JSON config file. On Linux, this file is normally located at | |
# /etc/docker/daemon.json. You should use this JSON config method if you are running | |
# a version of Docker that is at least 1.10! | |
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24: | |
# { | |
# "bip": "192.168.254.1/24" | |
# } |
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 | |
# Put this file in /usr/local/bin and use 'curl-timing' in place of 'curl' | |
# to get a detailed timing report with the response. | |
# You can customize the report below. For older versions of curl, some | |
# of the fields below will not be available. | |
TIMING_FORMAT=$(cat <<EOL | |
url_effective: %{url_effective} | |
remote_ip: %{remote_ip} |
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
#!/usr/bin/env php | |
<?php namespace kamermans\ImageMagick; | |
/** | |
* Parser for the ImageMagick "identify" utility that takes "identify -verbose <file>" | |
* output on STDIN and outputs JSON on STDOUT. | |
* | |
* Example: | |
* identify -verbose foo.jpg | ./parse_identify.php | |
*/ |
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
/** | |
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation | |
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree | |
* Payment API as of Dec 2011 | |
* | |
* Compiled by Steve Kamerman, 2011 | |
*/ | |
SET FOREIGN_KEY_CHECKS=0; | |
-- ---------------------------- |
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)); | |
NewerOlder