Skip to content

Instantly share code, notes, and snippets.

View kstrauss's full-sized avatar

Karl Strauss kstrauss

  • Realgy LLC
  • Hartford area, CT
View GitHub Profile
@kstrauss
kstrauss / Thoughts.md
Last active April 26, 2019 16:22
Simple example of python and docker. This as an idea of how perhaps we could offer a general way deploying some code from a git repo into a python container. The main question to me is how should things be triggered/scheduled.

Concerns

  • monitoring
    • is this the job of our container runner (i.e. cloud foundry)
  • how to kick off?
    • orchestration if there are several apps/containers that need to run? Is this part of cloud foundry or another piece that may be required?
  • what's the guidance of how to provide data to be used?
    • should it be the job of the python code to acquire (from files via scp, query a db)? Something else?

Problems to solve

@kstrauss
kstrauss / dockerfile
Created April 26, 2019 20:29
python example dockerfile for linux
#from alpine:latest as base
from python:3.7.3-alpine as base
from base as builder
RUN apk add --no-cache python3 python3-dev py-pip build-base
# create directory to copy files to
RUN mkdir /install/
WORKDIR /install
@kstrauss
kstrauss / FindAndConvert.ps1
Last active July 22, 2020 03:42
Conversion of word docs to PDF and then combine into one large pdf for a set of directories
$d2 = dir -recurse -filter *.doc
$word = new-object -comobject Word.Application
$NotFound = @()
$errors = @()
$d2 | ForEach-Object {
$doc = $null
try{
$f = $_;
@kstrauss
kstrauss / idea.ps1
Created December 4, 2021 01:33
powershell bar chart - thought/idea of doing an ascii bar chart from a group by data (count)
function GraphMe {
[CmdletBinding]
param(
[Parameter()]
[Hashtable] $something
)
<#
max_value = max(count for _, count in data)
increment = max_value / 25
@kstrauss
kstrauss / WebscanCheck.seq
Created January 18, 2023 15:54
Describes the basic flow for website redirection that was used
sequenceDiagram
WebsiteCheck ->> Scanner: Does WebsiteA exist?
Scanner ->> WebsiteA: Get Request
WebsiteA ->> Scanner: Yes, but redirect to WebsiteB
Scanner ->> WebsiteB: Get Request
WebsiteB ->> Scanner: Good Response
Scanner ->> WebsiteCheck: Yes, but it is really WebsiteB
@kstrauss
kstrauss / contractEnd.seq
Created March 23, 2023 14:35
working through a few sequence diagrams with VNDLY
sequenceDiagram
VNDLY->>+Workday: Raise Contract End (via Connector)
CML->>+VNDLY: update PO and extend date
VNDLY->>+Workday: send new PO (via file)
Workday->>+Workday: Reject change of PO, because of Contract End
@kstrauss
kstrauss / depersonalize.cs
Last active April 26, 2023 01:57
Simple samples of functions to depersonalize data
async void Main()
{
// baby first names https://github.com/hadley/data-baby-names
var fnames = ReadFileAsync(@"C:\temp\depersonal\bfnames.csv");
// surnames https://github.com/fivethirtyeight/data/blob/master/most-common-name/surnames.csv
var lnames = ReadFileAsync(@"C:\temp\depersonal\surnamesClean.csv");
var testNames = ReadFileAsync(@"c:\temp\depersonal\nbaPlayers.csv");
var r = new Random();
int Max = 3;
var result = new int[Max];