Skip to content

Instantly share code, notes, and snippets.

View mlehner616's full-sized avatar

Mike Lehner mlehner616

View GitHub Profile
{
"dependencies": {
"libxmljs": "^0.12.0",
"pg": "^3.6.2",
"sequelize": "^2.0.0-rc2",
"sequelize-cli": "^0.3.3"
},
"devDependencies": {
"gulp": "^3.8.8",
"gulp-nodemon": "^1.0.4",
{
"dependencies": {
"libxmljs": "^0.12.0",
"pg": "^3.6.2",
"sequelize": "^2.0.0-rc2",
"sequelize-cli": "^0.3.3"
},
"devDependencies": {
"gulp": "^3.8.8",
"gulp-nodemon": "^1.0.4",
@mlehner616
mlehner616 / package.json
Created December 2, 2014 23:37
npm working package.json
{
"dependencies": {
"libxmljs": "^0.12.0",
"pg": "^3.6.2",
"sequelize": "^2.0.0-rc2",
"sequelize-cli": "^0.3.3"
},
"devDependencies": {
"gulp": "^3.8.8",
"gulp-nodemon": "^1.0.4",
require 'facter'
require 'json'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("aws ec2 describe-tags --region #{region} --filters \"Name=resource-id,Values=#{instance_id}\" --query 'Tags[*].{value:Value,key:Key}'")
parsed_tags = JSON.parse(tags)
parsed_tags.each do |tag|
require 'facter'
require 'json'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("aws ec2 describe-tags --region #{region} --filters \"Name=resource-id,Values=#{instance_id}\" --query 'Tags[*].{value:Value,key:Key}'")
parsed_tags = JSON.parse(tags)
parsed_tags.each do |tag|
#!/bin/bash -e
#
# Pass this script an AWS access key ID and it will show you what IAM user
# has that key.
#
# Usage:
# aws-access-key-to-iam-name some_key_id
#
readonly PROGNAME=$(basename $0)
@mlehner616
mlehner616 / aws-asg-suspend
Last active November 5, 2015 00:08
zpress-ASG-suspend
# aws autoscaling suspend-processes --auto-scaling-group-name zpress-app-v004 --scaling-processes AlarmNotification
# aws autoscaling resume-processes --auto-scaling-group-name zpress-app-v004 --scaling-processes AlarmNotification
### Keybase proof
I hereby claim:
* I am mlehner616 on github.
* I am mlehner616 (https://keybase.io/mlehner616) on keybase.
* I have a public key ASDeVJfhkM4vdJDSYzrqofTQRR_i24nSZmVnSgGkriHK7go
To claim this, I am signing this object:
@mlehner616
mlehner616 / nomad.err
Last active July 10, 2017 19:06
nomad-0.6.0-rc1-crash-7-10-2017
panic: runtime error: slice bounds out of range
goroutine 29 [running]:
github.com/hashicorp/nomad/scheduler.(*allocReconciler).computeGroup(0xc42020e620, 0xc4206a1a40, 0x11, 0xc42026e930, 0xc42026e900)
/opt/gopath/src/github.com/hashicorp/nomad/scheduler/reconcile.go:393 +0x1592
github.com/hashicorp/nomad/scheduler.(*allocReconciler).Compute(0xc42020e620, 0xc42063d080)
/opt/gopath/src/github.com/hashicorp/nomad/scheduler/reconcile.go:182 +0x1f1
github.com/hashicorp/nomad/scheduler.(*GenericScheduler).computeJobAllocs(0xc420704fc0, 0xc4204b4a80, 0xc42063c940)
/opt/gopath/src/github.com/hashicorp/nomad/scheduler/generic_sched.go:391 +0x3cc
github.com/hashicorp/nomad/scheduler.(*GenericScheduler).process(0xc420704fc0, 0x24, 0x24, 0xc4210cf7b0)
@mlehner616
mlehner616 / gist:98b6227a20e76aa6705ac8c24f954d62
Created July 15, 2017 05:33 — forked from hSATAC/gist:5343225
Http Redirect in Golang
package main
import (
"log"
"net/http"
)
func redirect(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "http://www.google.com", 301)