Skip to content

Instantly share code, notes, and snippets.

@patmandenver
patmandenver / gist:0e753184c789dc0f40eb
Last active August 29, 2015 14:13
Sensu code for checking an upcoming date
#!/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 August 29, 2015 14:13
Ruby code for dumping Skype logs to screen replace USERNAME and SKYPE_USERNAME with your own
#!/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 July 2, 2015 16:40
ffmpeg install script for Ubuntu 14.04
#!/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 July 3, 2015 13:34
ffmpeg install script for Ubuntu 14.04
#!/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 / ffmpeg-install.sh
Created July 4, 2015 20:32
ffmpeg install script for Ubuntu 14.04
#!/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 July 5, 2015 15:01
override mp4 audio with mp3 audio
#!/bin/bash
echo "hi"
mp4Arr=(`find $PWD -maxdepth 1 -iname "*.mp4"`)
#Make Fixed Directory
mkdir fixed
for i in "${mp4Arr[@]}"
@patmandenver
patmandenver / slack_notify
Created July 7, 2015 16:37
Slack startup/shutdown notify script
#!/bin/bash
#
# Change the slack URL to your own
#
##############################################
start_value=".\n Name : `hostname`"
start_value+="\n IP : `ip route get 8.8.8.8 | awk '{print $NF; exit}'`"
start_value+="\n Memory : `cat /proc/meminfo | grep MemTotal | awk '{mem= $2/1048576; printf("%0.2g GiB", mem) ; exit}'`"
start_value+="\n Drives : `df -h | grep Filesystem`"
#!/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 August 29, 2015 14:25
Simple backup script for a postgres database
#!/bin/bash
#
# Script to backup local
# Postgres database
# Run via cron job
#
###########################
###########################
#
@patmandenver
patmandenver / backup-db
Created July 19, 2015 18:32
Backup postgres database with SLACK notifications (put in your slack webhook URL)
#!/bin/bash
#
# Script to backup local
# Postgres database
# Run via cron job
#
#########################################
#########################################
#