Skip to content

Instantly share code, notes, and snippets.

View parsnips's full-sized avatar

Michael Parsons parsnips

View GitHub Profile
@parsnips
parsnips / query-aws-logs-insights.bash
Created June 29, 2020 15:35 — forked from dsmrt/query-aws-logs-insights.bash
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
aws logs start-query \
--profile clientProfile \
--log-group-name MY-LOG_GROUP \
--start-time `date -v-30M "+%s"` \
--end-time `date "+%s"` \
--query-string 'fields @message | filter @message like /my query/'

Keybase proof

I hereby claim:

  • I am parsnips on github.
  • I am parsnips (https://keybase.io/parsnips) on keybase.
  • I have a public key whose fingerprint is E701 7C98 85F8 971E CD5A 2D6A D6BC E70F E820 20BB

To claim this, I am signing this object:

@parsnips
parsnips / set-jdk.sh
Created May 20, 2017 22:02
Put this in your bashrc and it'll set up your java home for you.
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
@parsnips
parsnips / terminator.sh
Created January 5, 2016 21:40
For those times when the ASG says you got N instances, but your cluster says you N - k instances.
#!/bin/bash
set -e
CLUSTER=$1
aws ecs list-container-instances --cluster $CLUSTER | jq .containerInstanceArns[] | tr -d \" | xargs -I{} aws ecs describe-container-instances --cluster $CLUSTER --container-instance {} | jq .containerInstances[].ec2InstanceId | tr -d \" > cluster.txt
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names $CLUSTER | jq -r ".AutoScalingGroups | .[] | .Instances | .[] | .InstanceId" | tr -d \" > asg.txt
sort cluster.txt cluster.txt asg.txt | uniq -u | xargs -I{} aws ec2 terminate-instances --instance-ids {}
@parsnips
parsnips / pets
Created December 16, 2013 20:54
horrific fumes of
canine fury infiltrate
my nasal canals.
dog gas explosions
well past midnight instigate
poetic glory.
so many haikus
beautiful gaseous glory
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
@parsnips
parsnips / gist:4383300
Last active December 10, 2015 04:48
A clrzmq router that actually compiles & routes with the 3.x stuff.
using System.Collections.Generic;
using ZeroMQ;
namespace Parsnips.ZeroMQ
{
class Program
{
static void Main(string[] args)
{
using (var context = ZmqContext.Create())
@parsnips
parsnips / app.js
Created December 12, 2012 23:10 — forked from mheadd/app.js
answer();
var date = ask('Please say a date.', {choices: 'http://path/to/date.xml'});
log("*** " + date.value + " ***");
say('You said ' + date.value);
var time = ask('Now, say a time.', {choices: 'http://path/to/time.xml'});
log("*** " + time.value + " ***");
say('You said ' + time.value);

Parent

Two Level Child

Another Child

Child with

Children

Test Emacs Gisting Capability
-------------------
This is how a gist works.