Skip to content

Instantly share code, notes, and snippets.

View davidski's full-sized avatar
🔬
Dance card is pretty full.

David F. Severski davidski

🔬
Dance card is pretty full.
View GitHub Profile
@davidski
davidski / keybase.md
Last active August 4, 2019 14:21
Keybase proof

Keybase proof

I hereby claim:

  • I am davidski on github.
  • I am davidski (https://keybase.io/davidski) on keybase.
  • I have a public key whose fingerprint is A551 2C4B 205F 51D0 CEA5 2F3E 12F4 01A8 A530 0416

To claim this, I am signing this object:

@davidski
davidski / ami-security-validator.tf
Last active January 5, 2024 12:20
Step Function Definition for AMI Security Validator
# reusable policy for the roles which Lambda has permission to assume
data "aws_iam_policy_document" "lambda-assume-role-policy" {
statement {
actions = ["sts:AssumeRole"]
principals = {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
}
@davidski
davidski / main.py
Created November 16, 2016 17:25
AWS Lambda function to disable OSHA-Challenge ML prediction endpoint
#!/bin/env python
from __future__ import print_function
import json
import boto3
#import os
import logging
# fetch environment variables
#model_id = os.environ['MLModelId']
@davidski
davidski / sugar.R
Created February 22, 2016 21:42
Sample extraction of data from a PDF into R
library(tm) # text manipulation
library(stringi) # better string replacement
# specify the source url and the destination location
uri <- 'http://www.actiononsugar.org/News%20Centre/Surveys%20/2016/170862.pdf'
filename <- 'sugar.pdf'
# be kind, download only once
if (!file.exists(filename)) {
download.file(uri, filename, mode="wb")
@davidski
davidski / DockerHostVagrantfile
Created February 7, 2016 18:55
Rstats Docker Configuration with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.allowed_synced_folder_types = [:rsync]
config.vm.synced_folder ".", "/vagrant", disabled: false, type: 'rsync'
config.vm.box = 'bento/ubuntu-14.04'
config.vm.define "dockerhost"
@davidski
davidski / pshh.ps1
Created January 3, 2016 21:21 — forked from xoner/pshh.ps1
Simple function to load putty inside Conemu hosted powershell given a hostname or a saved session name.
function pssh()
{
Param
(
[Parameter(Mandatory=$true)]
[String]
$destinationHost = $null
)
@davidski
davidski / elk-opsworks-stack.json
Created January 3, 2016 19:21
Elasticsearch-Logstash-Kibana Opsworks stack creation via CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create the ELK OpsWorks Stack.",
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [{
"Label": { "default": "Network"},
"Parameters": [ "VpcID", "SubnetID", "KeyName" ]
}, {
"Label": { "default": "ELK Config"},
@davidski
davidski / Vagrantfile
Last active December 31, 2015 16:33
Global Vagrant Configuration (~/.vagrant.d/Vagrantfile)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Based upon https://gist.github.com/tmatilai/7553006
LOCAL_HTTP_PROXY = 'NOPE'
KEY_PATH = "D:\Primary Docs\Google Drive\AWS Keypair\SSH Keypairs\#{ENV['AWS_KEYPAIR_NAME']}.pem"
USER_DATA = '#!/bin/bash\nmkdir -p /etc/chef/ohai/hints\ntouch /etc/chef/ohai/hints/ec2.json > /tmp/user_data.log\necho\n'
# Configures vagrant-cachier and vagrant-proxyconf.
# Should be called only on "local machine" providers.
@davidski
davidski / rstudio-cloudformation.json
Created November 5, 2015 22:27
Scrubbed version of RStudio CloudFormation template as referenced at http://blog.severski.net/2015/11/creating-rstudio-server-instance-on-aws.html
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Spin up a RStudio Server instance with a HTTPS off-loading ELB.",
"Parameters" : {
"SSLcertificate" : {
"Type" : "String",
"Default" : "arn:aws:iam::ACCOUNT)NUMBER:server-certificate/rstudio-cert",
"Description" : "Enter the ARN of the server certificate for ELB front-end. Default is rstudio-cert."
},
"MaxSpotPrice" : {
@davidski
davidski / 2013_NBPD_Bike_Counts_edit.csv
Last active October 6, 2015 02:01
Knight Center D3 - Module 6
Location 01-01-2013 05-01-2013 07-01-2013 09-01-2013
Linden Ave N and N 130th St 61 255 244 186
Greenwood Ave N and N 85th St 39 103 82 79
NE Ravenna Blvd, E Green Lake Way N/NE 71st St 176 408 420 492
32nd Ave NW and NW 54th St 81 298 212 258
NW Market St and 24th Ave NW/Shilshole Ave NW 135 415 481 424
15th Ave NW and NW Market St 82 92 73 85
N 45th St and Stone Way N 126 328 320 382
Lake City Way and NE 125th St 52 73 109 116
NE Northgate Way and 5th Ave NE 36 28 56 51