Skip to content

Instantly share code, notes, and snippets.

View miketheman's full-sized avatar
🌴
On vacation

Mike Fiedler miketheman

🌴
On vacation
View GitHub Profile
@miketheman
miketheman / datadog-agent-pi-setup.sh
Last active September 2, 2018 03:32
Datadog Agent 5.x Service on Raspberry Pi
DD_API_KEY=<REPLACE> sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)"
sudo mkdir /opt/datadog-agent
sudo cp -r ~/.datadog-agent/* /opt/datadog-agent
path=$HOME
path=${path//\//\\\/}
sedcmd="s/$path\/.datadog-agent/\/opt\/datadog-agent/g"
for i in /opt/datadog-agent/venv/bin/*; do echo $i; sudo sed -i $sedcmd $i; done
@miketheman
miketheman / console
Created September 21, 2017 18:13
core/gmp multiple versions
★ Install of core/readline/6.3.8/20170513213506 complete with 0 new packages installed.
guile: Resolved dependency 'core/readline' to /hab/pkgs/core/readline/6.3.8/20170513213506
guile: WARN
guile: WARN The following runtime dependencies have more than one version
guile: WARN release in the full dependency chain:
guile: WARN
guile: WARN * core/gmp ( core/gmp/6.1.2/20170526062114 core/gmp/6.1.0/20170513202112 )
guile: WARN
guile: WARN The current situation usually arises when a Plan has a direct
guile: WARN dependency on one version of a package (`acme/A/7.0/20160101200001`)
@miketheman
miketheman / console.sh-session
Created December 25, 2016 10:03
Crystal Lang 0.20.3 Socket::IPAddress change
$ crystal --version
Crystal 0.20.1 (2016-12-05)
$ crystal run test.cr
1482659875.246: 127.0.0.1:55157 "This is only a test."
$ crystal --version
Crystal 0.20.3 (2016-12-23)
$ crystal run test.cr
Error in test.cr:10: wrong number of arguments for 'Socket::IPAddress.new' (given 3, expected 2)
Overloads are:
@miketheman
miketheman / Makefile
Created September 1, 2016 19:54
Django + docker-compose Makefile
CURRENT_DIRECTORY := $(shell pwd)
TESTSCOPE = apps
TESTFLAGS = --with-timer --timer-top-n 10 --keepdb
help:
@echo "Docker Compose Help"
@echo "-----------------------"
@echo ""
@echo "Run tests to ensure current state is good:"
@miketheman
miketheman / chefdiff.sh
Last active May 24, 2016 22:52
Bash function to diff most recent Chef backup. Place in `/etc/profile.d/chefdiff.sh`
# Usage: `chefdiff <filename>`
chefdiff() {
p=`readlink -f $1`
f=`ls /var/chef/backup$p* | sort | tail -n 1`
diff -u $f $1
}
@miketheman
miketheman / datadog-role-delegation.json
Created May 18, 2016 22:22
Datadog AWS Integration Automated Setup - CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"SharedSecret": {
"Default": "SOOPASEKRET",
"Description": "Shared Secret, aka External ID",
"Type": "String",
"NoEcho": "true"
}
},
@miketheman
miketheman / datadog-role-delegation.tf
Last active August 12, 2019 19:38
Datadog AWS Integration Automated Setup
# Read more about variables and how to override them here:
# https://www.terraform.io/docs/configuration/variables.html
variable "aws_region" {
type = "string"
default = "us-east-1"
}
variable "shared_secret" {
type = "string"
default = "SOOPERSEKRET"

Keybase proof

I hereby claim:

  • I am miketheman on github.
  • I am miketheman (https://keybase.io/miketheman) on keybase.
  • I have a public key ASAvv9Z5J9DxlPsLOBx0QCKOAY42qSJvMNxWzR6t2tRLLQo

To claim this, I am signing this object:

$ crystal build --release try_to_fail.cr
$ for i in `seq 10` ; do ./try_to_fail ; done
"first before"
Error writing datagram: Connection refused (Errno)
[4318973645] *Errno::new<String>:Errno +541
[4319016353] *UDPSocket#send<UDPSocket, String, Socket::IPAddress>:Int64 +593
[4319008402] main +10322
"first before"
Error writing datagram: Connection refused (Errno)
[4415098573] *Errno::new<String>:Errno +541
@miketheman
miketheman / gist:bee9a466051a02543a14
Created February 18, 2016 03:55
statsd.cr trace
Error writing file: Connection refused (Errno)
[4422141682] *CallStack::unwind:Array(Pointer(Void)) +82
[4422141585] *CallStack#initialize<CallStack>:Array(Pointer(Void)) +17
[4422141544] *CallStack::new:CallStack +40
[4422213281] *Exception@Exception#initialize<Errno, String>:CallStack +33
[4422213203] *Errno#initialize<Errno, String>:CallStack +115
[4422213060] *Errno::new<String>:Errno +100
[4422250063] *UDPSocket@IO::FileDescriptor#unbuffered_write<UDPSocket, Slice(UInt8)>:Int32 +399
[4422253517] *UDPSocket@IO::Buffered#write<UDPSocket, Slice(UInt8)>:(Nil | Int32) +109
[4422253371] *UDPSocket@IO#write_utf8<UDPSocket, Slice(UInt8)>:Nil +59