Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Jenkins stevejenkins

View GitHub Profile
@stevejenkins
stevejenkins / gwhitelist_pss.sh
Created Jun 25, 2014
Google PageSpeed Service RemoteIPInternalProxy generator for mod_remoteip
View gwhitelist_pss.sh
#! /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 Aug 29, 2015
AlarmServer for SmartThings Init Script
View alarmserver
#!/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 Aug 29, 2015
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/
View bash-multipatch.sh
#!/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 Mar 7, 2015
Draft default opendmarc.conf for Fedora-based pacakges
View opendmarc.conf
##
## 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
Steve Jenkins' Customizr WordPress Template CSS Tweaks
View customizr-tweaks.css
/* 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 Oct 13, 2015
"Is Comcast up?" shell script
View check_comcast.sh
#!/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 Dec 4, 2012
Power Cycle Modem (Outlet 2) and Router (Outlet 3) on BayTech RPC unit
View reboot_script.php
#!/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 Nov 26, 2015
Short script for building various Postscreen whitelists and reloading the Postfix configuration
View postscreen-whitelists.sh
#! /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 Dec 10, 2015
DD-WRT Firewall Script
View firewall_skype.sh
#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 Dec 12, 2015
Creates the Postfix make files for building from source on an x86_64 (64-bit) system without MySQL support
View make_postfix_64.sh
#/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'