Skip to content

Instantly share code, notes, and snippets.

View connectthefuture's full-sized avatar

justthefracts connectthefuture

  • Midwest usa
View GitHub Profile
# run your first Prefect flow from the command line
python -c "from prefect import Flow; f = Flow('empty'); f.run()"
@cicdw
cicdw / post_standup_flow.py
Created February 25, 2019 01:02
complete code of the standup Prefect flow
import datetime
from google.cloud.firestore import Client
import random
import requests
import prefect
from prefect import Flow, Parameter, task
from prefect.client import Secret
from prefect.schedules import CronSchedule
@EugenMayer
EugenMayer / 00-docker-shorewall.md
Created February 24, 2019 21:46 — forked from lukasnellen/00-docker-shorewall.md
setup shorewall for docker networking beyond the default bridge network, e.g., for docker-compose

Docker(-compose) with shorewall

The shorewall documentation explains in http://shorewall.org/Docker.html how to configure shorewall for use with docker. The problem with the configuration is that it only allows connections from the host to the main bridge docker0. Connections to other networks on dynamically created bridges, with names starting by default with br-, is blocked. Instead of the recommended contents of /etc/shorewall/interfaces, use wild-card interface names as follows:

#ZONE	INTERFACE	OPTIONS
#dock	docker0		bridge     # disabled default recommendation
dock 	docker0		physical=docker+,routeback=1
dock 	br		physical=br-+,routeback=1
@cicdw
cicdw / reminder_flow.py
Last active July 30, 2019 04:27
choppy version of the Prefect reminder Flow
@task
def get_collection_name():
"""
Returns the current date, formatted, which maps
to a Google Firestore collection name.
"""
date_format = "%Y-%m-%d"
now = prefect.context["scheduled_start_time"]
return now.strftime(date_format)
@cicdw
cicdw / post_standup.py
Last active July 30, 2019 04:26
Non-Prefect pieces of the post standup workflow
import datetime
from google.cloud.firestore import Client
import os
import random
import requests
def get_standup_date():
"""
Returns the current date, formatted, which maps
@pahud
pahud / lftp-via-sftp-to-s3.sh
Created January 2, 2019 07:25
mirror your local dir to S3 via sftp with lftp
#!/bin/bash
open_lftp(){
lftp sftp://pahud:@s-xxxxxxxxxxxxxx.server.transfer.eu-central-1.amazonaws.com "$@"
}
backup_canon1(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup01/ .;exit;"
}
@pr3sidentspence
pr3sidentspence / msVisionAPIphotoRotate.ps1
Created December 14, 2018 21:19
Powershell script that runs photos (default jpg) in current folder through Microsoft's Cognitive Services Vision API and rotates the photo to match the orientation that MSCSVapi has the most confidence in its caption of.
param(
[string]$ext = "jpg"
)
# Powershell script that runs photos (default jpg) in current folder through
# Microsoft's Cognitive Services Vision API and rotates the photo
# to match the orientation that MSCSVapi has the most confidence in its caption of.
New-Item -ItemType directory -Path $PSScriptRoot/temp -Force
function callMsAPI {
@matsub
matsub / Dockerfile
Created December 8, 2018 05:49
GitHub Actions
FROM alpine:3.8
LABEL "com.github.actions.name"="Hello World"
LABEL "com.github.actions.description"="Write arguments to the standard output"
LABEL "com.github.actions.icon"="anchor"
LABEL "repository"="https://github.com/matsub/try-github-actions"
LABEL "maintainer"="matsub <[email protected]>"
ADD entrypoint.sh /entrypoint.sh
@pr3sidentspence
pr3sidentspence / IMprocessBMPscansOnBlackCardstock.bat
Last active October 3, 2019 14:02
A batch file using ImageMagick (https://www.imagemagick.org) to straighten, convert, and trim large bitmap images scanned with a specific (but editable) background color while leaving a some of the background remaining as a border. The fuzz percentage and border left can be given as command line parameters when calling the batch file.
ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
REM IMprocessBMPscansOnBlackCarstock.bat
REM Usage: IMprocessBMPscansOnBlackCarstock.bat optional:(fuzz[integer] padding[integer])
REM Creates straightened and cropped with padding 100% quality jpgs
REM of all BMP files in current directory and places them in a subdirectory
REM called output
@ednisley
ednisley / Guilloche.gcmc
Created October 8, 2018 19:05
GCMC source code: Guilloche (a.k.a. Spirograph) pattern generator and Bash feeder script
// Spirograph simulator for MPCNC used as plotter
// Ed Nisley KE4ZNU - 2017-12-23
// Adapted for Guillioche plots with ball point pens - 2018-09-25
// Spirograph equations:
// https://en.wikipedia.org/wiki/Spirograph
// Loosely based on GCMC cycloids.gcmc demo:
// https://gitlab.com/gcmc/gcmc/tree/master/example/cycloids.gcmc
// Required command line parameters: