Skip to content

Instantly share code, notes, and snippets.

View stevejenkins's full-sized avatar

Steve Jenkins stevejenkins

View GitHub Profile
@stevejenkins
stevejenkins / gwhitelist_pss.sh
Created June 25, 2014 00:51
Google PageSpeed Service RemoteIPInternalProxy generator for mod_remoteip
#! /bin/sh
#
# Based on Mike Miller's gwhitelist at:
# http://archive.mgm51.com/sources/gwhitelist.html
# Copyright (c) 2013 Mike Miller <mmiller@mgm51.com>
#
# Modified 2014 by Steve Jenkins <steve@stevejenkins.com> to format
# output for mod_remoteip on Apache with Google PageSpeed Service
#
# Permission to use, copy, modify, and distribute this software for any
@stevejenkins
stevejenkins / alarmserver
Last active August 29, 2015 14:04
AlarmServer for SmartThings Init Script
#!/bin/sh
# chkconfig: 23456 90 10
# description: AlarmServer
# Middleware between SmartThings and EnvisaLink
# processname: alarmserver.py
# v1.1
# by Steve Jenkins (steve@stevejenkins.com)
workdir=/usr/local/bin/AlarmServer
@stevejenkins
stevejenkins / bash-multipatch.sh
Last active August 29, 2015 14:06
A quick script file for downloading an applying multiple patches when manually compiling GNU bash on Linux. Referenced in this post: http://stevejenkins.com/blog/2014/09/how-to-manually-update-bash-to-patch-shellshock-bug-on-older-fedora-based-systems/
#!/bin/sh
# A quick script file for downloading an applying multiple patches when manually compiling GNU bash on Linux
# Written (mostly) by Steve Cook with (a little) help from Steve Jenkins
# This really seems like a lame way to have to do this, but it works. :) Use at your own risk.
# You can edit these variables
version="4.0"
nodotversion="40"
@stevejenkins
stevejenkins / opendmarc.conf
Created March 7, 2015 15:59
Draft default opendmarc.conf for Fedora-based pacakges
##
## opendmarc.conf -- configuration file for OpenDMARC filter
##
## Copyright (c) 2012-2015, The Trusted Domain Project. All rights reserved.
##
## AuthservID (string)
## defaults to MTA name
##
## Sets the "authserv-id" to use when generating the Authentication-Results:
@stevejenkins
stevejenkins / customizr-tweaks.css
Created May 30, 2015 17:11
Steve Jenkins' Customizr WordPress Template CSS Tweaks
/* Rounded Avatars */
.avatar {
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border: solid 2px silver;
}
/* WP-PageNavi and WP-CommentNavi Pagination Styles */
.wp-pagenavi, .wp-commentnavi {
@stevejenkins
stevejenkins / check_comcast.sh
Last active October 13, 2015 13:58
"Is Comcast up?" shell script
#!/bin/sh
# Original version developed by Reverend Booyah! (SteveCook.net)
# First, ping Comcast's web server
ping -q -c 2 www.comcast.net &> /dev/null
if [ $? -ne 0 ] ; then
echo "Comcast didn't work"
# If Comcast fails, that's Strike 1. Next, ping Yahoo's web server
ping -q -c 2 yahoo.com &> /dev/null
@stevejenkins
stevejenkins / reboot_script.php
Created December 4, 2012 17:48
Power Cycle Modem (Outlet 2) and Router (Outlet 3) on BayTech RPC unit
#!/usr/bin/php -q
<?
print("open 192.168.1.200\n");
sleep(2);
print("username\r");
sleep(2);
print("password\r");
sleep(2);
print("REBOOT 2\r");
sleep(2);
@stevejenkins
stevejenkins / postscreen-whitelists.sh
Last active November 26, 2015 03:15
Short script for building various Postscreen whitelists and reloading the Postfix configuration
#! /bin/sh
# Build all the Postscreen whitelists
/usr/local/bin/gwhitelist.sh > /etc/postfix/whitelist_gmail.cidr
/usr/local/bin/msftwhitelist.sh > /etc/postfix/whitelist_msft.cidr
/usr/local/bin/socialwhitelist.sh > /etc/postfix/whitelist_social.cidr
# Reload Postfix configuration
/usr/sbin/postfix reload
@stevejenkins
stevejenkins / firewall_skype.sh
Last active December 10, 2015 02:58
DD-WRT Firewall Script
#Enable NAT on the WAN port to correct a bug in builds over 17000
iptables -t nat -I POSTROUTING -o `get_wanface` -j SNAT --to `nvram get wan_ipaddr`
#Allow br1 access to br0, the WAN, and any other subnets (required if SPI firewall is on)
iptables -I FORWARD -i br1 -m state --state NEW -j ACCEPT
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
#Restrict br1 from accessing br0
iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j DROP
@stevejenkins
stevejenkins / make_postfix_64.sh
Last active December 12, 2015 01:58
Creates the Postfix make files for building from source on an x86_64 (64-bit) system without MySQL support
#/bin/sh
make makefiles CCARGS='-fPIC -DUSE_TLS -DUSE_SSL -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DPREFIX=\\"/usr\\" -DHAS_LDAP -DLDAP_DEPRECATED=1 -DHAS_PCRE -I/usr/include/openssl -I/usr/include/sasl -I/usr/include' AUXLIBS='-L/usr/lib64 -L/usr/lib64/openssl -lssl -lcrypto -L/usr/lib64/sasl2 -lsasl2 -lpcre -lz -lm -lldap -llber -Wl,-rpath,/usr/lib64/openssl -pie -Wl,-z,relro' OPT='-O' DEBUG='-g'