Skip to content

Instantly share code, notes, and snippets.

View gene1wood's full-sized avatar
🎩

Gene Wood gene1wood

🎩
View GitHub Profile
@gene1wood
gene1wood / 0001-Adding-X-header-contents-to-the-body-of-the-email-in.patch
Last active August 29, 2015 14:03
Patch to the Bugzilla email template to embed X- headers in a non-displaying div
From ffd15b7565277569d6bdf57f6493841dabe6a412 Mon Sep 17 00:00:00 2001
From: Gene Wood <gene_wood@cementhorizon.com>
Date: Thu, 3 Jul 2014 09:39:37 -0700
Subject: [PATCH] Adding X- header contents to the body of the email in a
non-displaying div to enable easier Gmail filtering
---
.../BMO/template/en/default/email/bugmail.html.tmpl | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
@gene1wood
gene1wood / CrashPlanDesktop_Wrapper
Last active May 26, 2016 19:35
A wrapper script around CrashPlanDesktop to establish an SSH tunnel to the target headless CrashPlan installation and launch the GUI, connecting through the tunnel
#!/bin/bash
CONF="/usr/local/Crashplan Personal/conf/ui.properties"
UIINFO="/var/lib/crashplan/.ui_info"
BIN="/usr/local/Crashplan Personal/bin/CrashPlanDesktop"
WRAPPER_CONFIG="${HOME}/.crashplandesktop_wrapper"
if [ -e "${WRAPPER_CONFIG}" ]; then
readarray -t tokens < ${WRAPPER_CONFIG}
else
@gene1wood
gene1wood / send_email.py
Last active August 29, 2015 14:04
Simple example of how to send email in Python through authenticated SMTP
fromaddr = 'me@example.com'
toaddr = 'you@example.org'
servername = 'smtp.example.com'
username = 'username'
password = 'password'
import smtplib
import time
server = smtplib.SMTP(servername, 25)
server.set_debuglevel(1)
@gene1wood
gene1wood / gist:9673278c99440a5a1ac8
Created July 25, 2014 20:42
How to build NCPA Nagios Cross Platform Agent RPM from source
# Find your OS version https://iuscommunity.org/pages/Repos.html#release-packages
sudo yum install -y http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
sudo yum install -y python27 python27-devel python27-pip openssl-devel
sudo pip2.7 install cx_Freeze
git clone https://github.com/NagiosEnterprises/ncpa.git
cd ncpa/build
make build_rpm
@gene1wood
gene1wood / increase-subsonic-session-timeout.sh
Last active September 17, 2017 18:26
Increase Subsonic session-timeout value
mkdir workspace
cd workspace
sudo cp /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar.orig
unzip /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar
cat > webdefault.patch <<End-of-message
--- org/mortbay/jetty/webapp/webdefault.xml.orig 2014-06-11 10:06:12.000000000 -0700
+++ org/mortbay/jetty/webapp/webdefault.xml 2014-06-11 10:06:39.000000000 -0700
@@ -323,7 +323,7 @@
<!-- ==================================================================== -->
@gene1wood
gene1wood / change-default-subsonic-view-from-random-to-new.sh
Created August 11, 2014 17:11
This will patch Subsonic 4.9 to change the default view from Random to Recently Added
mkdir workspace
cd workspace
sudo cp /usr/share/subsonic/subsonic.war /usr/share/subsonic/subsonic.war.orig
unzip /usr/share/subsonic/subsonic.war
dos2unix WEB-INF/jsp/top.jsp # These dos2unix and unix2dos steps are needed because the files have DOS
dos2unix WEB-INF/jsp/index.jsp # line endings and the patches, if copy/pasted have UNIX line endings
cat > change-default-view-to-newest.patch <<'End-of-message'
diff -ru orig/WEB-INF/jsp/index.jsp new/WEB-INF/jsp/index.jsp
--- orig/WEB-INF/jsp/index.jsp 2014-01-23 23:07:04.000000000 -0800
+++ new/WEB-INF/jsp/index.jsp 2014-08-11 09:59:33.000000000 -0700
@gene1wood
gene1wood / transmission-daemon
Created August 22, 2014 18:35
transmission-daemon sysconfig file to enable binding to an interface
# /etc/sysconfig/transmission-daemon
INTERFACE=ppp0 # Set this to the interface you want the daemon to bind to
if /sbin/ifconfig $INTERFACE >>/dev/null 2>&1; then
BIND_ADDR="`/sbin/ifconfig $INTERFACE | awk '$1 == \"inet\" {print $2}' | awk -F: '{print $2}'`"
else
BIND_ADDR="127.0.0.1"
fi
@gene1wood
gene1wood / clipboard-decrypt
Created September 23, 2014 21:35
command to decrypt GPG data from your clipboard and replace your clipboard with the decrypted contents
xsel | gpg --decrypt | xsel --clipboard
@gene1wood
gene1wood / create_security_monkey_trusting_role.py
Last active August 29, 2015 14:07
Code snipit to create the Security Monkey trusting IAM role
#!/usr/bin/env python
# Set this to the ARN of the trusted account role
trusted_account_role_arn="arn:aws:iam::123456789012:role/SecurityMonkeyInstanceProfile"
import boto.iam
conn_iam = boto.iam.connect_to_region('universal')
role_name='SecurityMonkey'
assume_role_policy_document = '''{
"Version":"2012-10-17",
@gene1wood
gene1wood / create_security_monkey_trusted_role.py
Last active August 29, 2015 14:07
Code snipit to create the Security Monkey trusted IAM role
import boto.iam
conn_iam = boto.iam.connect_to_region('universal')
role_name='SecurityMonkeyInstanceProfile'
assume_role_policy_document = '''{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {