Skip to content

Instantly share code, notes, and snippets.

Patrick Bailey patmandenver

View GitHub Profile
@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>
@patmandenver
patmandenver / tomcat8
Last active Aug 29, 2015
Tomcat8 init script
View tomcat8
#!/bin/bash
#
#Apache Tomcat8 init Script
#
#####################################
TOMCAT_HOME=/10x13/apps/tomcat8
LOG_HOME=/10x13/logs/tomcat8
PID_FOLDER=/var/run/tomcat8
PID_FILE=$PID_FOLDER/tomcat.pid
@patmandenver
patmandenver / Install_Oracle_Java7.sh
Last active Aug 29, 2015
Install Oracle 7 on Ubuntu 14.04
View Install_Oracle_Java7.sh
#!/bin/bash
#
# Simple script to install Oracle Java 7 with auto accepting the license
# No need to interact with it
#
######################################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
@patmandenver
patmandenver / tomcat-users.xml
Created Aug 16, 2015
Simple tomcat-users.xml file for Tomcat8 (of course change the password)
View tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user name="admin" password="mypassword"
roles="admin-gui,manager-gui" />
</tomcat-users>
@patmandenver
patmandenver / blink.sh
Created Aug 23, 2015
Blink LED slightly fancier code that removes error messages
View blink.sh
@patmandenver
patmandenver / bashrc
Created Aug 23, 2015
Custom Prompt (add to end of .bashrc)
View bashrc
PS1="\[\033[1;30m\]\[\033[42m\][\u@\H]\[\033[30m\]\[\033[0m\]\w \n \[\033[1;32m\]❯\[\033[1;33m\]❯\[\033[1;31m\]❯ \[\033[1;37m\]"
@patmandenver
patmandenver / blink.sh
Created Aug 23, 2015
Blink an LED on Intel Edison
View blink.sh
View askPatrick.js
/**
* This code is just a self help guide :)
*
* Author: Patrick Bailey
* Company: WhiteboardCoder
*/
/*
Intent Schema
{
@patmandenver
patmandenver / colors.sh
Created Mar 25, 2016
Linux Prompt Colors
View colors.sh
#!/bin/bash
for color in {0..255}; do echo -e "$color:\\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m"; done
@patmandenver
patmandenver / global.sbt
Last active Mar 25, 2016
sbt global shell prompt
View global.sbt
shellPrompt := { state =>
def textColor(color: Int) = { s"\033[38;5;${color}m" }
def backgroundColor(color:Int) = { s"\033[48;5;${color}m" }
def reset = { s"\033[0m" }
def formatText(str: String)(txtColor: Int, backColor: Int) = {
s"${textColor(txtColor)}${backgroundColor(backColor)}${str}${reset}"
}
val red = 1
val green = 2
You can’t perform that action at this time.