Skip to content

Instantly share code, notes, and snippets.

View lwoodson's full-sized avatar

Lance Woodson lwoodson

View GitHub Profile
sql = <<SQL
select
  count(*),
  date_trunc('day', o.created_at) as day
from
  orders o,
  stores s
where
 o.store_id = s.id
require 'benchmark'
require 'ostruct'
module Platappus
##
# Class capable of carrying out multi-threaded map/reduce
# operations. Dev specifies 1-N map blocks to produce
# interim values, and a reduce block to aggregate results.
# For example:
#
package com.mycompany.app;
import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.services.ec2.AmazonEC2;
import com.amazonaws.services.ec2.AmazonEC2Client;
import com.amazonaws.services.ec2.model.DescribeTagsRequest;
import com.amazonaws.services.ec2.model.DescribeTagsResult;
import com.amazonaws.services.ec2.model.Filter;
import com.amazonaws.services.ec2.model.TagDescription;
import com.amazonaws.util.EC2MetadataUtils;

We are (somewhat) settled and ready to accept visitors! There are a lot of wonderful things to do nearby.

Our Home

TBW

Winter

skiing

In winter, prime attractions are skiing and snowboarding, with Breckenridge Resort and Keystone Resort nearby. Copper Mountain and Arapahoe Basin are slightly further away. If this is your thing, you can rent skis/snowboards here for pickup at any of these resorts. If you are new to skiing or snowboarding, I would look into booking private (expensive) or group (economical) lessons at Breck or Keystone. The ski season is generally from Thanksgiving through mid April, with good

Park County Emergency Services

  • Emergency: 911
  • Animal Control: 719-836-4380
  • Sherriff: 719-836-2494
  • NWFPD Fire Station #2: 719-836-3150

For quickly iterating on ec2 instance bootstrapping without having to go through a cloudformation deployment cycle:

  1. Install sshfs or its mac port
  2. Deploy via cloudformation with minimal userdata script
  3. Mount the ec2-users home directory in your project (we will use a remote directory)
  4. Copy the ops code into the remote directory
  5. Edit files in the remote directory with your editor of choice set up as you have in your local env
  6. Test your changes by executing them as root from an ssh session on the remote host
  7. When things work to your liking, copy the ops code from the remote directory back to its location in your project
  8. Test bootstrapping via cloudformation stack deployment
@lwoodson
lwoodson / sshfs.md
Last active September 15, 2017 15:22

For quickly iterating on ec2 instance bootstrapping without having to go through the CFN deployment cycle:

  1. Install sshfs or its mac port
  2. Deploy via CFN with minimal userdata script
  3. Mount the ec2-users home directory in your project (we will use a remote directory)
  4. Copy the ops code into the remote directory
  5. Edit files in the remote directory with your editor of choice set up as you have in your local env
  6. Test your changes by executing them as root from an ssh session on the remote host
  7. When things work to your liking, copy the ops code from the remote directory back to its location in your project
  8. Test bootstrapping via cloudformation stack deployment

Problem

Need to download object from S3 bucket in bv-nexus-qa (us-east-1) onto ec2 instance in bv-nexus (us-east-1):

List objects in bucket...

[root@ip-10-100-27-9 ~]# aws s3 ls s3://bv-service-zkbrowser/

An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied
./integration $ export SODEXO=sodexo.uat.us-east-1.nexus.bazaarvoice.com
./integration $ export SODEXO_API=${SODEXO}/api/v1
./integration $ http POST ${SODEXO_API}/job taskId=92f6c2dd-0ba4-49f7-863a-79424003f591
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
Date: Fri, 07 Apr 2017 21:57:55 GMT
transfer-encoding: chunked
{
<?xml version="1.0" encoding="UTF-8"?>
<Feed extractDate="2016-01-05T06:00:06.706-05:00" incremental="false" name="TroyBilt" xmlns="http://www.bazaarvoice.com/xs/PRR/ProductFeed/5.1">
<Brands>
<Brand removed="false" disabled="false">
<Name>Default Brand Name</Name>
<ExternalId>4qyXCRm-brand</ExternalId>
</Brand>
</Brands>
<Categories>
<Category removed="false" disabled="false">