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
-- | |
-- Schemaverse Fleet Script for DefCon 21 (2013) | |
-- @author shepherd <[email protected]> | |
-- | |
-- Exploiting a missing constraint on insert/update to ship rules | |
-- | |
UPDATE my_fleets SET | |
script_declarations = ' | |
num_miners integer; |
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
#! /usr/bin/perl | |
use 5.010; | |
use strict; | |
use warnings; | |
use Data::Dump qw/dd dump/; | |
use DBI; | |
use SVG; | |
use File::Temp qw/tempfile/; | |
use File::Copy qw/move/; |
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
/** | |
* DateTimeWrapper | |
* | |
* This class exists because you cannot modify the microseconds of a native PHP 5.5 | |
* DateTime Object without creating a whole new instance. | |
* | |
* Additionally, this class allows you to serialize Datetime Objects without losing | |
* the microseconds. | |
* | |
* @copyright 2014 Mshanken Communications |
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
-- | |
-- how to populate locations table on db2 from wineries table on db1 | |
-- | |
-- SELECT "INSERT INTO locations( name, website, address, address2, city, state, zip, country, phone, created_at, updated_at, latitude, longitude, email, fax, winery_id ) VALUES (" || name ||", " || website || ", " || address || ", null , null, null, null, null, " || phone || ", " || created_at || ", " || modified_at || ",null, null, " || email || ", " || fax || ", " || winery_id || "); " FROM wineries | |
SELECT 'INSERT INTO locations( name, winery_id ) VALUES ("' || name || '", "' || winery_id || '"); ' FROM wineries |
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
#!/usr/bin/env ruby | |
percentage = ARGV[0].to_i | |
if percentage >= 75 | |
stroke_color = '#00a651' | |
elsif percentage >= 50 | |
stroke_color = '#fff200' | |
elsif percentage >= 25 | |
stroke_color = '#ef9d26' |
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
# check to see if the server supports RANGES | |
> curl -sI <url> |grep -i range | |
> Accept-Ranges: bytes | |
# see file size | |
> curl -sI <url> |grep -i length | |
> Content-Length: 2251775322 | |
# curl a portion of file |
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
alias | |
alias -='cd -' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias 1='pushd' | |
alias 2='pushd +2' | |
alias 3='pushd +3' | |
alias 4='pushd +4' | |
alias 5='pushd +5' |
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
for state in FL PA TX NY MA VA MD; do | |
for market in small_group; do | |
for quarter in Q3 Q4;do | |
mkdir -p "./data/$market/$state/2016/$quarter"; | |
aws s3 cp --recursive "s3://vericred-emr-workers/production/plans/$market/$state/2016/$quarter" "./data/$market/$state/2016/$quarter"; | |
mkdir -p input "./data_out/$market/$state/2016/$quarter"; | |
./bin/plan_etl -i "./data/$market/$state/2016/$quarter" \ | |
-o "./data_out/$market/$state/2016/$quarter" \ |
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 | |
GIT=`which git` | |
FOUND=`$GIT branch | grep $1 | sed -e 's/^[ *] //' | sed -e 's/remotes\/origin\///g' |sort -u` | |
NUM_FOUND=`echo $FOUND|wc -l` | |
echo | |
if [ $NUM_FOUND -gt 1 ]; then | |
echo 'FOUND THESE MATCHING BRANCHES' | |
echo | |
echo "$FOUND" |
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 | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
if [ -z "$BRANCH_NAME" ]; then | |
exit 0 | |
fi | |
if [ "master" = "$BRANCH_NAME" ]; then | |
exit 0 | |
fi |
OlderNewer