Skip to content

Instantly share code, notes, and snippets.

@d
d / jesse_parallel.xml
Created June 30, 2016 00:33
jesse_parallel.mdp
<?xml version="1.0" encoding="UTF-8"?>
<!--
CREATE TEMP TABLE foo (i int);
CREATE TEMP TABLE bar (j int);
SELECT * FROM foo UNION ALL SELECT * FROM bar;
-->
<dxl:DXLMessage xmlns:dxl="http://greenplum.com/dxl/2010/12/">
<dxl:Thread Id="0">
<dxl:OptimizerConfig>
<dxl:EnumeratorConfig Id="0" PlanSamples="0" CostThreshold="0"/>
@d
d / regression.diffs
Created June 4, 2016 08:01
external_table failure
*** ./expected/external_table.out Sat Jun 4 01:57:38 2016
--- ./results/external_table.out Sat Jun 4 01:57:39 2016
***************
*** 1452,1465 ****
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 5 ) e1,
(SELECT i, j FROM exttab_subtxs_1 WHERE i < 10) e2
WHERE e1.i = e2.i;
! NOTICE: Found 4 data formatting errors (4 or more input rows). Rejected related input data.
! i | j
! ---+----------
https://dtb5pzswcit1e.cloudfront.net/product_files/Pivotal-CF/pcf-vsphere-1.4.2.0.ova?Expires=1432243477&Signature=QEAUQrad9KWq-~eNVCDhhVW7bIHzv48zdPNPg55oTda7~Qv82mFGCpUutRBo3Wdj3kBfFcAUhXJ7ffGTUwJHSQj92O3PdOYpD98ZKeFJCrpYYclNo8UOqFaN-8OOdlk~Sh2s1Ouaujddc8CBcoU2cQMI04BFaSEYS2-wxFU3Hps_&Key-Pair-Id=APKAJLAM6FL65BYZP7UQ
@d
d / yo.bash
Last active August 29, 2015 14:17
install docker on a Mac
#!/bin/bash
set -e -u
set -x
_main() {
softwareupdate --install --all
type brew || install_brew
install_packages
@d
d / README.md
Last active August 29, 2015 14:08
How to use the Reider AMI
  • Launch the instance into your VPC
  • ssh -A ubuntu@$PUBLIC_IP
  • cd ~/tempest.git; git fetch
  • sudo su - tempest # using the password i tell you
  • cd ~/tempest-web; git pull --ff-only ~ubuntu/tempest.git origin/master
  • cd ~/tempest-web/web; bin/bundle --without test --deployment && env BUNDLE_GEMFILE=bosh.Gemfile bin/bundle --deployment
  • edit the config/database.yml to change the database user name to tempest
  • cd ~/tempest-web/web; bundle exec rake db:create db:migrate RAILS_ENV=development
  • Inside /tempest-web/web/.env file, search and replace "/workspace/installation/" with "~/tempest-web/"
  • env TEMPEST_INFRASTRUCTURE=aws bin/rails s
@d
d / provision.sh
Created October 21, 2014 23:46
how to make that AMI for Reider
#!/bin/bash
# Everything in this script runs as root
set -e -u
user=tempest
user_dir="/home/${user}"
echo "--- Installing libyaml manually"
@d
d / config.fish
Last active March 3, 2021 07:42
fish_prompt with git branch
set -x GIT_EDITOR "mvim -f"
# until fish 2.2, we'll have to do this
set PATH (brew --prefix)/bin $PATH
complete -f -c git -n '__fish_git_using_command pull' -l ff-only -d 'Refuse to merge unless fast-forward possible'
complete -f -c git -n '__fish_git_using_command pull' -l rebase -d 'Rebase instead of merge'
complete -c git -n '__fish_git_using_command commit' -s v -l verbose -d 'Show diff in commit message template'
complete -c git -n '__fish_git_using_command commit' -s a -l all -d 'Commit all changed files'
@d
d / parent-filter.rb
Last active December 16, 2015 00:39
splitting mpgw
#!/usr/bin/env ruby
def execute(cmd)
stdout = `#{cmd}`
if $?.success?
return stdout
end
raise "execution of command \"#{cmd}\" failed. Status: #{$?}"
end
args = readline.split
@d
d / git-log2
Last active December 14, 2015 15:59
modified dot dot dot
#!/bin/bash
set -e -u -x
rev1=${1:-origin/master}
rev2=${2:-HEAD}
git log --graph --decorate --oneline $rev1 $rev2 --not $(git rev-list --parents --max-count 1 $(git merge-base $rev1 $rev2) | cut -d" " -f2- )
@d
d / p.c
Created October 3, 2012 23:50
popen-leaks
#include <stdio.h>
int main(){
/* foo for leak */
FILE *foo = fopen("foo", "r");
if (!foo)
return 1;
char buf[256];
/* read one byte */
if (!fread(buf, 1, 1, foo))