Skip to content

Instantly share code, notes, and snippets.

View ToddG's full-sized avatar

ToddG ToddG

View GitHub Profile
@ToddG
ToddG / Pulumi.dev.yaml
Created October 12, 2022 20:32
config for my pulumi app
config:
aws:region: us-east-1
infra-aws-v4-dashboard:canary:
memory: 128
port: 80
infra-aws-v4-dashboard:vpc:
number_of_availability_zones: 1
pulumi:template: aws-python
@ToddG
ToddG / __main__.py
Last active October 12, 2022 20:33
pulumi __main__.py for a generic app composed of a custom vpc + fargate + custom secgroup
"""An AWS Environment for the `dashboard` application."""
import pulumi
import pulumi_awsx as awsx
import pulumi_aws as aws
from pulumi_awsx.ec2 import DefaultVpc
"""
Define the common resources for an application stack (dev/stage/prod) including:
@ToddG
ToddG / Korad_KA_series_driver.rb
Created December 7, 2021 19:53 — forked from k-nowicki/Korad_KA_series_driver.rb
Ruby implementation of KORAD KA series power supplies communication protocol. Verified on KA3005P only, but should work also with all supplies of series, including multichannel ones.
require 'rubygems'
require 'serialport'
class Korad
def initialize(port="/dev/ttyACM0", baud=9600)
@serial = SerialPort::open(port,baud)
@serial.read_timeout = 100
end
def get_status
@ToddG
ToddG / localhost_prom_exporter_metrics
Created June 28, 2019 16:01
Host Metrics Emitted by `prom_exporter`
$ curl localhost:9100/metrics
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 0
go_gc_duration_seconds{quantile="0.25"} 0
go_gc_duration_seconds{quantile="0.5"} 0
go_gc_duration_seconds{quantile="0.75"} 0
go_gc_duration_seconds{quantile="1"} 0
go_gc_duration_seconds_sum 0
@ToddG
ToddG / pydoc.conf
Created December 13, 2013 19:29
Ubuntu upstart file to launch pydoc (python documentation server) as a service... but as an unprivileged user via the (start-stop-daemon). There are other examples out there, but this is my first upstart script...
description "pydoc documentation server"
author "Todd Greenwood-Geer <[email protected]>"
version "1.0"
# -------------------------------------------------
# stanzas
# -------------------------------------------------
start on (filesystem and net-device-up IFACE=lo) or runlevel [2345]
stop on runlevel [!2345]
@ToddG
ToddG / rebar.config
Created December 15, 2012 15:41
rebar config for embedded yaws app
{erl_opts, [debug_info]}.
{deps, [
{yaws, ".*", {git, "git://github.com/klacke/yaws", {tag, "yaws-1.94"}}},
{mochiweb, ".*", {git, "git://github.com/mochi/mochiweb.git", "master"}},
{mimetypes, ".*", {git, "git://github.com/spawngrid/mimetypes.git", "master"}}
]}.
@ToddG
ToddG / launch.erl
Created December 15, 2012 15:39
simple launcher script to start an embedded yaws app
-module(launch).
%% API.
-export([start/0]).
%% API.
start() ->
{ok, Cwd} = file:get_cwd(),
Docroot = Cwd ++ "/webapp",
@ToddG
ToddG / Makefile
Created December 15, 2012 15:36
trimmed down makefile for creating embedded yaws app with external web app copied in, too.
PROJECT = embedded_yaws
REBAR = rebar
all: clean webapp deps compile
compile:
rebar get-deps compile
clean:
rebar clean
@ToddG
ToddG / sync-error-report.log
Created November 23, 2012 20:56
erlang sync results
=INFO REPORT==== 23-Nov-2012::15:50:22 ===
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:37: Warning: function do_echo/2 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:44: Warning: function extract_parameter/2 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:49: Warning: function format_response/1 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:0: Recompiled with 1 warnings
=ERROR REPORT==== 23-Nov-2012::15:50:26 ===
Unable to determine options for "/home/todd/bin/erlang/otp/lib/compiler/src/R15B02/lib/compiler-4.8.2/src/beam_asm.erl"
=ERROR REPORT==== 23-Nov-2012::15:50:26 ===
Unable to determine options for "/home/todd/bin/erlang/otp/lib/compiler/src/R15B02/lib/compiler-4.8.2/src/beam_block.erl"
@ToddG
ToddG / shapesmith-notes-01.md
Created October 14, 2012 16:36
shapesmith notes

shapesmith notes

license

http://www.apache.org/licenses/LICENSE-2.0

Allows public/private derivations.

erlang