Skip to content

Instantly share code, notes, and snippets.

Erik Weathers erikdw

  • segmentio
  • Oakland, CA
Block or report user

Report or block erikdw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@erikdw
erikdw / aws-alb-lambda-terraform.tf
Created May 6, 2019 — forked from nitrocode/aws-alb-lambda-terraform.tf
Attempt to create a route on an ALB to be redirected to a Lambda WIP
View aws-alb-lambda-terraform.tf
# input vars
variable "environment" {
default = "Dev"
}
# local vars
locals {
name = "hello"
env = "${lower(var.environment)}"
lb_name = "${join("-", list("TF", var.environment, local.name))}"
View tips-and-tricks.txt
Raw version of https://github.com/erikdw/tips-and-tricks/wiki/Tips-and-Tricks without ugly formatting.
1. SSH break-out:
```
<enter>~.
<enter>~?
```
2. Shadowed window screenshot in mac:
View tcpdump-examples.md
(13) tcpdumps:  (no -s 65535 needed on recent tcpdumps)

  (a) find dns requests (adjusted for being on hosts in terremark):
     sudo tcpdump -i eth1 -c3000 -l -n dst port 53 | grep api
       (thepoint@tm22-s00311)

     sudo tcpdump -i eth0 -c3000 -l -n port 3133

  (b) capture all data:
@erikdw
erikdw / generate-word-cloud.md
Last active Oct 3, 2018
Creation of Groupon Farewell Word-Cloud as G logo.
View generate-word-cloud.md

Download all "company-departure" emails with got-your-back:

./gyb --email MYGMAILACCOUNT@gmail.com --search 'label:company-departures'

Join all .eml file bodies into a single file

Build this program based on a stackoverflow answer:

View storm-shade-storm-core-utils.xml
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
@erikdw
erikdw / github_load_all_diffs.js
Last active Mar 14, 2018 — forked from juanca/github_load_all_diffs.js
Github PR bookmarklet: Load all file diffs
View github_load_all_diffs.js
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click());
document.querySelectorAll('.js-details-target').forEach(node => node.click());
// Both of those buttons should have the '.btn-link' class too, but I wasn't able to quickly figure out how to
// add an AND condition to that. Tried the below, didn't work:
//document.querySelectorAll('[.btn-link][.load-diff-button]').forEach(node => node.click());
@erikdw
erikdw / setjdk.sh
Created Feb 5, 2018
setjdk shell function. This is what I've used in zsh, should work in bash too.
View setjdk.sh
# Example usage: setjdk 1.8
function setjdk {
local ver=${1?Usage: setjdk <version>}
export JAVA_HOME=$(/usr/libexec/java_home -v $ver)
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':')
export PATH=$JAVA_HOME/bin:$PATH
}
View storm__ReadClusterState.java.diff
diff --git storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
index 0fa60f129..dd4e8db78 100644
--- storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
+++ storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
@@ -145,6 +145,7 @@ public class ReadClusterState implements Runnable, AutoCloseable {
}
}
HashSet<Integer> allPorts = new HashSet<>(assignedPorts);
+ iSuper.assigned(allPorts);
allPorts.addAll(slots.keySet());
View storm-mesos__MesosSupervisor.java.diff
diff --git storm/src/main/storm/mesos/MesosSupervisor.java storm/src/main/storm/mesos/MesosSupervisor.java
index 4d3b05b..2cbb777 100644
--- storm/src/main/storm/mesos/MesosSupervisor.java
+++ storm/src/main/storm/mesos/MesosSupervisor.java
@@ -41,9 +41,13 @@ import storm.mesos.util.MesosCommon;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
@erikdw
erikdw / 0. Build mesos.md
Last active Sep 14, 2017
Issue with task not launching
View 0. Build mesos.md
# git clone github.com:mesos/mesos
# cd mesos
# mkdir build
# ... blah blah ...
# build it
# cd build
You can’t perform that action at this time.