Skip to content

Instantly share code, notes, and snippets.

Avatar
🔬
Dance card is pretty full.

David F. Severski davidski

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

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 Feb 25, 2021
Step Function Definition for AMI Security Validator
View ami-security-validator.tf
# 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 Nov 16, 2016
AWS Lambda function to disable OSHA-Challenge ML prediction endpoint
View main.py
#!/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 Feb 22, 2016
Sample extraction of data from a PDF into R
View sugar.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 Feb 7, 2016
Rstats Docker Configuration with Vagrant
View DockerHostVagrantfile
# -*- 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 Jan 3, 2016 — forked from xoner/pshh.ps1
Simple function to load putty inside Conemu hosted powershell given a hostname or a saved session name.
View pshh.ps1
function pssh()
{
Param
(
[Parameter(Mandatory=$true)]
[String]
$destinationHost = $null
)
@davidski
davidski / elk-opsworks-stack.json
Created Jan 3, 2016
Elasticsearch-Logstash-Kibana Opsworks stack creation via CloudFormation
View elk-opsworks-stack.json
{
"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 Dec 31, 2015
Global Vagrant Configuration (~/.vagrant.d/Vagrantfile)
View 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.
View rstudio-cloudformation.json
{
"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 Oct 6, 2015
Knight Center D3 - Module 6
View 2013_NBPD_Bike_Counts_edit.csv
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