Skip to content

Instantly share code, notes, and snippets.

View johndstein's full-sized avatar

John Stein johndstein

View GitHub Profile
set -e
BRANCH=$(basename "%teamcity.build.vcs.branch.Hip_EPC_Receptor1%")
CHKOUTDIR="%teamcity.build.checkoutDir%"
mkdir %teamcity.build.checkoutDir%/pkg
echo "Build Branch $BRANCH"
echo "Checkout Dir $CHKOUTDIR"
echo "ENV_LIST $ENV_LIST"
set -e
mkdir %teamcity.agent.work.dir%/provisionStore
cd %teamcity.agent.work.dir%/provisionStore
aws --profile hip s3 sync s3://38b12b388345c4c00adb4374e8b4dbe1595fe7cd/provisionStore/ ./
rm provisionStore.zip
unzip '*.zip'
rm *.zip
@johndstein
johndstein / etchosts.py
Created October 15, 2015 21:26
Update /etc/hosts
#!/usr/bin/env python
import sys
import socket
import re
"""
Simple script to add or update lines in /etc/hosts file.
#!/usr/bin/env node
'use strict';
const TDI_REST_PORT = process.env.TDI_REST_PORT || 9341;
const express = require('express');
const bodyParser = require('body-parser');
const http = require('http');
const app = express();
@johndstein
johndstein / Vagrantfile.rb
Last active February 6, 2016 13:04
docker vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@johndstein
johndstein / gist:e1cc02a9cf6a485ff52d
Created March 2, 2016 19:28
We need good leaders
You can't hurt an evil person like Clinton or Trump by calling them evil. Their
supporters don't care as long as they get what they want. If Clinton lies about
the right things or Trump bullies people I don't like, that's great.
But it's a fallacy to think we can benefit from evil. Honesty, love, courage,
humility -- these things matter. We need leaders who genuinely care about
others. We need leaders whose first priority is to protect the poor and needy,
to fight for justice and against tyranny.
We need leaders we can trust, who never lie, never take advantage of others, who
@johndstein
johndstein / gist:fa21f7ec7a0a237fbb96
Created March 2, 2016 21:45
Some index funds to think about
7% PowerShares NASDAQ 100 ETF (QQQ)
- 2 + 83 + 156
7% Guggenheim Equal Weight S&P 500 ETF (RSP)
- 8 + 50 + 72
7% AlphaDex ETF (FXG)
- .5 + 102 + 127
7% SPDR Consumer Staples ETF (XLP)
@johndstein
johndstein / update-phones.java
Last active March 21, 2016 14:32
salesforce update-phones.java
List<Contact> contacts = [
select id,
HomePhone,
npe01__WorkPhone__c
from Contact
where npe01__WorkPhone__c = null
and HomePhone != null
limit 1200
];
for (Contact c: contacts){
/**
* This is a one time run bit of code that creates membership
* renewals for all memberships expiring in the next NEXT_90_DAYS.
* You will want to update that per customer auto renewaly spec.
* This is to be run immediately after first data load because
* our auto renewal logic only renews memberships expiring in
* exactly x days. So we have to do a first run to initially
* renew everything expiring betwen now and x days.
**/
```
. DATALOADER_CLASSPATH
java -cp \
"$DATALOADER_CLASSPATH" \
-Dsalesforce.config.dir=./ \
com.salesforce.dataloader.process.ProcessRunner \
process.name=old_id_account_id
```
```