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
# get matching ec2 instances (matches name, asg name) | |
function instance() { | |
instance_name="${1:-no-instance-name-provided}" | |
name_tag_instances=$(aws ec2 describe-instances --filter "Name=tag:Name,Values=*$instance_name*" | jq "[.Reservations[].Instances] | add // []") | |
asg_tag_instances=$(aws ec2 describe-instances --filter "Name=tag:aws:autoscaling:groupName,Values=*$instance_name*" | jq "[.Reservations[].Instances] | add // []") | |
all_instances=$(echo "$name_tag_instances" | jq ". + $asg_tag_instances | unique // []") | |
if [[ "$2" != "" ]]; then | |
out=$(echo "$all_instances" | jq -r ".[] | $2") | |
else | |
out=$(echo "$all_instances" | jq -r ".") |
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 python3 | |
from configparser import ConfigParser | |
from collections import namedtuple | |
from datetime import datetime, timezone | |
from pathlib import Path | |
import argparse | |
import re | |
import os | |
import json |
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
# steps for getting cloudhsm going | |
# this method volume mounts the cloudhsm libs into the container from the host | |
# based on debian stretch | |
# docker run --rm -it -u 0 -v /opt/cloudhsm:/opt/cloudhsm golang:1.10 /bin/bash | |
# rest of steps are inside container | |
# you can throw it all in a text file in the container |
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
# steps for getting softhsm going | |
# based on debian stretch | |
# docker run -it golang:1.10 /bin/bash | |
# rest of steps are inside container | |
# you can throw it all in a text file in the container | |
# like so: cat <<'eof'>test.sh | |
# bash test.sh |
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
# steps for getting cloudhsm going | |
# based on debian stretch | |
# docker run -it golang:1.10 /bin/bash | |
# rest of steps are inside container | |
# you can throw it all in a text file in the container | |
# like so: cat <<'eof'>test.sh | |
# bash test.sh |
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 | |
for i in $(seq -w 2 27); do | |
# curl -XDELETE "localhost:9200/socorro2017{$i}" | |
curl -XPUT "localhost:9200/socorro2017${i}" -H 'Content-Type: application/json' -d @create-socorro-index.json | |
curl -XPOST 'localhost:9200/_reindex?pretty&wait_for_completion=false' -H 'Content-Type: application/json' -d " | |
{ | |
\"source\": { | |
\"remote\": { | |
\"host\": \"https://socorro-es-external.mocotoolsstaging.net:9200\" | |
}, |
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
{ | |
"mappings": { | |
"crash_reports": { | |
"_all": { | |
"enabled": false | |
}, | |
"properties": { | |
"raw_crash": { | |
"dynamic": "true", | |
"type": "object", |
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
#include <NewPing.h> | |
#include <Stepper.h> | |
// ultrasonic sensor | |
#define TRIGGER_PIN 13 // Arduino pin tied to trigger pin on the ultrasonic sensor. | |
#define ECHO_PIN 12 // Arduino pin tied to echo pin on the ultrasonic sensor. | |
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. | |
// stepper motor | |
#define DIRECTION_PIN 2 // Arduino pin for the direction pin on the stepper motor |
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
package "python-crypto" | |
package "python-pyx" | |
package "tcpdump" | |
# python_virtualenv "/home/ubuntu/ve" do | |
# interpreter "python2.5" | |
# owner "ubuntu" | |
# group "ubuntu" | |
# action :create | |
# end |