Skip to content

Instantly share code, notes, and snippets.

View dwelch2344's full-sized avatar

David Welch dwelch2344

View GitHub Profile
@dwelch2344
dwelch2344 / jenkins-mvn-version.sh
Created March 24, 2016 23:51
This jenkins script looks for a ENV VAR (parameterized via Build Params) defined as *RELEASE*, which if != "No" will Swap the traditional X.Y.Z[-IDENTIFIER] version for X.Y.Zb[BUILD_NUMBER][IDENTIFIER] (with IDENTIFIER being determined based on whether RELEASE is Snapshot or Release)
#!/bin/bash
if [[ "$RELEASE" != "No" ]]; then
if [[ "$RELEASE" == "Release" ]]; then
BUILD_SUFFIX=".RELEASE"
elif [[ "$RELEASE" == "Snapshot" ]]; then
BUILD_SUFFIX="-SNAPSHOT"
fi
echo "Swapping version for X.X.${BUILD_NUMBER}${BUILD_SUFFIX}"
sed -i -e "1,/<version>\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*<\/version>/s/<version>\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*<\/version>/<version>\1.\2.\3b${BUILD_NUMBER}${BUILD_SUFFIX}<\/version>/" pom.xml
@dwelch2344
dwelch2344 / consul-fix.js
Created March 23, 2016 16:46
When looking at the Consul ui / services tab, run this to get rid of everything (assuming you're tunneled into the right box -- since the Agent API only relates to the node executed on)
$('.name small')
.map( (i,e) => e.innerText.trim() )
.filter( (i,e) => e.indexOf("service:") == 0)
.map( (i,e) => e.replace("service:", '') )
.each( (i,e) => {
var url = "http://localhost:8500/v1/agent/service/deregister/" + e
console.log('Trying', url)
$.ajax({
type: "GET",
url: url,
@dwelch2344
dwelch2344 / entrypoint.sh
Last active March 22, 2016 19:54
Depending on the environment variables, this script either runs a script that is on the local machine or downloads one from the web to run. It also *SHOULD* clean up by killing the java process when terminated, but it doesn't
#!/bin/bash
function die {
curl -X POST -d "killed=true" http://requestb.in/qqvaouqq
echo "Ending on signal $1"
if [ -n "$EXIT_SCRIPT" ]; then
echo "Executing exit script $EXIT_SCRIPT"
/bin/bash $EXIT_SCRIPT
else
echo "No exit script found. Executing: pkill -f 'java'"
@dwelch2344
dwelch2344 / exit.sh
Last active March 22, 2016 18:17
test
#!/bin/bash
echo "Goodbye world"
wget http://pkg.jenkins-ci.org/debian-rc/binary/jenkins_2.0_all.deb
dpkg -i jenkins_2.0_all
apt-get install -f
2016-03-09 10:46:39.108 [ INFO] [IID=Davids-MacBook-Pro-2.local::85122] [USER=] -- exampleExampleServer : No active profile set, falling back to default profiles: default
2016-03-09 10:46:39.841 [ INFO] [IID=Davids-MacBook-Pro-2.local::85122] [USER=] -- exampleExampleServer : Started ExampleServer in 1.165 seconds (JVM running for 1.795)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.2.RELEASE)
@dwelch2344
dwelch2344 / response.js
Created March 8, 2016 15:03
Why does _links contain both a *self* and *product* link? Is this part of the HAL spec?
{
_embedded:{
products:[
{
id:1,
name:"Starter Kit",
description:"Starter Kit",
msrp:5000,
taxable:true,
commissionable:true,
@dwelch2344
dwelch2344 / manifest.json
Created January 25, 2016 17:45
Simple find and replace for versioning
{
"manifest_version": 2,
"name": "My App",
"version": "0.1",
"someProp": "foo_bar_baz"
}
<pre style="font: 20px/10px monospace;"><span style="color: #ffffff;"></span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</span><span style="color: #ffffff;">#</sp
@dwelch2344
dwelch2344 / boot-and-efs-box.sh
Created December 1, 2015 22:27
Ubuntu + Java 8 + Elastic File System Setup
#!/bin/bash
EFS_NODE=fs-123a45b6
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
sudo apt-get install -y nfs-common oracle-java8-installer
sudo apt-get install -y oracle-java8-set-default