Skip to content

Instantly share code, notes, and snippets.

@yaauie
yaauie / stringify-timestamp.logstash-filter-ruby.rb
Created September 10, 2020 16:03
stringify a timestamp field
###############################################################################
# stringify-timestamp.logstash-filter-ruby.rb
# ---------------------------------
# A script for a Logstash Ruby Filter to stringify logstash timestamps using
# ISO-8601.
###############################################################################
#
# Copyright 2020 Ry Biesemeyer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy

Creating an AWS IoT Thing from Command Line

Use this script to create a new AWS IoT Thing from the command line.

@kevinmehall
kevinmehall / replace_ecs_cluster_instances.py
Last active February 20, 2022 23:24
Script to drain and replace EC2 instances in an ECS cluster auto-scaling group after changing the AMI or instance type
#!/usr/bin/env python3
#
# Script to replace EC2 instances in an ECS cluster's auto-scaling group after
# changing the AMI or instance type in the launch configuration. It
# checks for instances with the incorrect AMI or type, scales up the
# auto-scaling group with replacement instances, then drains the tasks
# from the old instances.
#
# Usage: aws-vault exec profile-name -- python3 replace_ecs_cluster_instances.py --group=asg-name --cluster=ecs-cluster-name --count=3
#
@samanshahmohamadi
samanshahmohamadi / sawtooth-default-multi.yaml
Created October 16, 2018 07:41
Hyperledger Sawtooth configuration to setup a network with multiple validators.
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@tony-gutierrez
tony-gutierrez / AWS_Single_LetsEncrypt.yaml
Last active March 7, 2024 11:29
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@jed
jed / handler.js
Created May 16, 2016 16:30
Break Bot: pushing AWS IoT button events to Slack
'use strict'
// for context, see https://twitter.com/jedschmidt/status/732244756491816960
const https = require('https')
const qs = require('querystring')
const WEBHOOK_PATH = '/services/YOUR_WEBHOOK_PATH_HERE'
const EVENTS_BY_CLICKTYPE = {
SINGLE : {emoji: ':coffee:', type: 'beverages'},
@etiennea
etiennea / 01.config
Created March 29, 2014 19:58
AWS Elastic Beanstalk node.js configuration for quick deployments
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
ImageMagick: []
option_settings:
- option_name: NODE_ENV
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';