Skip to content

Instantly share code, notes, and snippets.

@stevenringo
stevenringo / deploy_stack.sh
Created Sep 11, 2017
Create/update/delete cloudformation stacks with events tailing
View deploy_stack.sh
set -o pipefail
_exit_error() {
message=$1
code=$2
echo "$message" >&2
exit $code
}
_exit_ok() {
@davidfowl
davidfowl / Example1.cs
Last active Oct 31, 2021
How .NET Standard relates to .NET Platforms
View Example1.cs
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@idlethreat
idlethreat / gelf-listener.py
Last active May 28, 2021
Gelf Log Listener in Python
View gelf-listener.py
#!/usr/bin/env python
############### // gelfListener 0.2 // ###############
#
# Listens on UDP 12201 for Gelf messages
# Extracts the event data and writes the message to disk
# updated to handle both zlib (nxlog) and gzip (graylog server) compressed events
# not perfect, but works okay
#
# Bugs:
@danrigsby
danrigsby / packer-ami-id
Last active Aug 14, 2021
Get AMI ID from a packer build
View packer-ami-id
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt
@nsonnad
nsonnad / tsv2csv.py
Created Nov 22, 2013
Python script for converting tsv to csv
View tsv2csv.py
import sys
import csv
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tabin:
commaout.writerow(row)