This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Git commit hook to run a license check on new files in the index. Failed CI builds no more!! | |
# | |
# Usage: drop it into <repo>/.git/hooks | |
# One liner (run from .git/hooks folder): curl -s -O -J https://gist.githubusercontent.com/collinpeters/9d6418687b7a390d1a20bebc859814be/raw/prepare-commit-msg | |
# Since the check is slow, we only want to run it when new files have been added to the index | |
NEW_FILES=$(git diff --name-only --diff-filter=A --cached) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
JAVA_HOME=${1-text} | |
[ $# -eq 0 ] && { echo "Usage: sudo $0 \$(/usr/libexec/java_home -v '1.8*')" ; exit 1; } | |
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts | |
wget https://letsencrypt.org/certs/letsencryptauthorityx1.der | |
wget https://letsencrypt.org/certs/letsencryptauthorityx2.der |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
QUERY="\ | |
SELECT count(*), waiting, age(now(), MAX(query_start)) as max_query_age, age(now(), MAX(backend_start)) as max_backend_start_age, age(now(), MAX(xact_start)) as max_xact_start_age, current_query \ | |
FROM pg_stat_activity \ | |
WHERE datname <> 'postgres' \ | |
AND current_query NOT LIKE '%current_query%' \ | |
GROUP BY datname, current_query, waiting" | |
DEST_HOST=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let barposition = "bottom" | |
let hintcharacters = "sadfjklewcmpgh" | |
let scrollstep = 150 | |
let smoothscroll = "true" | |
" space as leader | |
let mapleader = "\<Space>" | |
" Mappings | |
map <Leader>r reloadTabUncached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Setup log4j for Tomcat logging as per http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j | |
# @author Collin Peters | |
# Download log4j.properties | |
echo "Getting log4j.properties..." | |
wget -q --output-document /opt/tomcat/lib/log4j.properties https://gist.github.com/collinpeters/2845875/raw/caef85e03e7b586bace0dbc14da17a4f78d1757a/log4j.properties | |
# Download log4j.tgz and extract jar directly to Tomcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log4j.rootLogger=INFO, CATALINA | |
# Define all the appenders | |
log4j.appender.CATALINA=org.apache.log4j.RollingFileAppender | |
log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out | |
log4j.appender.CATALINA.MaxFileSize=100MB | |
log4j.appender.CATALINA.MaxBackupIndex=5 | |
log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout | |
log4j.appender.CATALINA.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} %p-%c{1}: [%m]%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# /etc/init.d/tomcat -- startup script for the Tomcat 7 servlet engine | |
# | |
# Modified init-Script from Ubuntu Tomcat init-script | |
# | |
# 2010 - Sebastian Mogilowski - http://www.mogilowski.net/2010/12/11/install-tomcat-7-on-debian-lenny-with-virtual-hosts-and-apache2-integration/ | |
# 2012 - Collin Peters - Added debug option | |
# | |
### BEGIN INIT INFO |