Skip to content

Instantly share code, notes, and snippets.

View dwelch2344's full-sized avatar

David Welch dwelch2344

View GitHub Profile
@dwelch2344
dwelch2344 / app.js
Created July 7, 2015 00:58
Iterate some jquery forms?
var addRow = $('.add-row'),
submit = $('.submit'),
container = $('.question-container'),
tpl = $('.template').html() // get the HTML contents as a string
addRow.on('click', addOne);
submit.on('click', sendIt);
// *should* create a whole new element from the string and stuff it in at the bottom
function addOne(){
@dwelch2344
dwelch2344 / cronRestart.sh
Created June 29, 2015 05:59
Simple script to run in cron for resetting services
#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
/usr/sbin/service mysql start
sendemail -f no-reply@yourEmail.com -t whoever@needsToKnow.com -u subject -m "Restarted MySQL on ng-ocean" -s smtp.gmail.com -o tls=yes -xu your@gmail.com -xp "yourGmailPassword"
fi
@dwelch2344
dwelch2344 / installOpenVbx.sh
Last active February 11, 2018 22:24
A simple install script to setup OpenVbx on an Ubuntu 14.04 box
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
export DBNAME=openvbx
export DBUSER=openvbx
export DBPASS=openvbxPass
<Response>
<Dial>
<Queue>Queue Demo</Queue>
</Dial>
</Response>
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function get_pwd() {
print -D $PWD
}
function battery_charge() {
@dwelch2344
dwelch2344 / ecs.sh
Created May 18, 2015 19:14
ubuntu 14 docker and ECS agent
#!/bin/bash
sudo su
wget -qO- https://get.docker.com/ | sh
exit
sudo usermod -aG docker $USER
CLUSTER=default
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<tags:template pageTitle="Application">
<jsp:attribute name="head">
I'm header content!
</jsp:attribute>
<jsp:attribute name="footer">
I'm footer content!
</jsp:attribute>
@dwelch2344
dwelch2344 / encrypt.sh
Created April 24, 2015 16:22
An example of how we encrypt our settings files with an OpenSSL cert
#!/bin/bash
if [ -z "$1" ]; then
echo "No configuration specified. Usage: $0 <config>"
exit 1
fi
CONFIG=$1
KEYFILE=conf/encrypt.crt

Keybase proof

I hereby claim:

  • I am dwelch2344 on github.
  • I am welch (https://keybase.io/welch) on keybase.
  • I have a public key whose fingerprint is E7A1 6AEA BC2A 0D29 0CDF 2F08 D02F CA38 F35E B676

To claim this, I am signing this object: