Skip to content

Instantly share code, notes, and snippets.

@patmandenver
patmandenver / gist:0e753184c789dc0f40eb
Last active Aug 29, 2015
Sensu code for checking an upcoming date
View gist:0e753184c789dc0f40eb
#!/usr/bin/ruby
#
# DESCRIPTION:
# Given a date will notify if within X days of the date.
# Defaults
# Warning: 30 days before date
# Critical: 15 days before date
#
# DEPENDENCIES:
# sensu-plugin
@patmandenver
patmandenver / gist:7729f92b8956c7c9dffa
Last active Aug 29, 2015
Ruby code for dumping Skype logs to screen replace USERNAME and SKYPE_USERNAME with your own
View gist:7729f92b8956c7c9dffa
#!/usr/bin/ruby
#
# DESCRIPTION:
# Simple ruby script for dumping message data from skype to screen
# easy to pipe to file and grep later
# change USERNAME and SKYPE_USERNAME to your own
#
#
# DEPENDENCIES:
# sqlite3-ruby
@patmandenver
patmandenver / ffmpeg-install.sh
Created Jul 2, 2015
ffmpeg install script for Ubuntu 14.04
View ffmpeg-install.sh
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo "*********************************"
echo "Installing ffmpeg on Ubuntu 14.04"
@patmandenver
patmandenver / ffmpeg-install.sh
Created Jul 3, 2015
ffmpeg install script for Ubuntu 14.04
View ffmpeg-install.sh
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo "*********************************"
echo "*"
@patmandenver
patmandenver / merge_all.sh
Created Jul 5, 2015
override mp4 audio with mp3 audio
View merge_all.sh
#!/bin/bash
echo "hi"
mp4Arr=(`find $PWD -maxdepth 1 -iname "*.mp4"`)
#Make Fixed Directory
mkdir fixed
for i in "${mp4Arr[@]}"
View notify_slack
#!/bin/bash
#
#
# This script notifies slack
# when this machine starts up
# or shuts down
#
########################################
#This reads in the webhook URL from a file
@patmandenver
patmandenver / backup-db
Last active Aug 29, 2015
Simple backup script for a postgres database
View backup-db
#!/bin/bash
#
# Script to backup local
# Postgres database
# Run via cron job
#
###########################
###########################
#
@patmandenver
patmandenver / purge-old-db
Created Jul 19, 2015
Purge database script that reports back to Slack .... Make sure to put in your SLACK WEBHOOK URL!!!!
View purge-old-db
#!/bin/bash
#
# Script to purge old database backups
# Run via cron job
#
#########################################
#########################################
#
# Config section
@patmandenver
patmandenver / purge-old-db
Created Jul 19, 2015
Bash Script to purge old Database files
View purge-old-db
#!/bin/bash
#
# Script to purge old database backups
# Run via cron job
#
#########################################
#########################################
#
# Config section
@patmandenver
patmandenver / server.xml
Created Aug 16, 2015
Tomcat 8 server.xml example that auto deploys War files.
View server.xml
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>