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 {}

Parent

Two Level Child

Another Child

Child with

Children

Test Emacs Gisting Capability
-------------------
This is how a gist works.
From: Paul Congdon [mailto:pcongdon@milestoneconsultinggroup.com]
Sent: Thursday, May 08, 2008 11:15 AM
To: Femi Oyekan
Subject: It's by Design
As Microsoft Project Support Team put so eloquently:
With regard to the original problem, we also see in our build the behaviour which you describe in your case.
Our current view is that this software is working as designed.
"By design", does not necessarily mean that a particular feature has been explicitly designed in such a manner as the way in which it behaves. It is a more generic term. It may be better put by stating that, due to the inherent design of the product, the behaviour of a particular feature is behaving as expected, ergo it is "By design". As is with each and every piece of software, every eventuality cannot be accounted for in the design stage. So, similarly, for something that may not have been accounted for in the original design of the product/feature, but is still behaving as would be expected, this would be deemed as being "by design".
@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())