Skip to content

Instantly share code, notes, and snippets.

View ToddG's full-sized avatar

ToddG ToddG

View GitHub Profile
@ToddG
ToddG / rebar-reltool-relase-notes.md
Created September 15, 2012 16:46
using rebar to create an erlang app with a dependency, and then starting a release created with reltool

Summary

I'm trying to figure out how to use rebar to:

  • create erlang project
  • add a dependency on an erlang module from github
  • start the app via the erl console
  • create a release and start the app from the release (via the generated scripts)
@ToddG
ToddG / sample-rss-2.0-feed.xml
Created March 4, 2012 20:25
sample-rss-2.0-feed
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Example Feed</title>
<description>Insert witty or insightful remark here</description>
<link>http://example.org/</link>
<lastBuildDate>Sat, 13 Dec 2003 18:30:02 GMT</lastBuildDate>
<managingEditor>johndoe@example.com (John Doe)</managingEditor>
@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 / 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 / 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 / sample-atom-1.0-feed.xml
Created March 4, 2012 20:26
sample-atom-1.0-feed
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<subtitle>Insert witty or insightful remark here</subtitle>
<link href="http://example.org/"/>
<updated>2003-12-13T18:30:02Z</updated>
<author>
<name>John Doe</name>
<email>johndoe@example.com</email>
@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 / get_feed_srv.erl
Created September 16, 2012 16:46
erlang code to process a json feed : total wip, only downloads currently
-module(get_feed_srv).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
%%-export([start_link/0, get_feed/1, process_redirect/1, process_response/1]).
-export([start_link/0, get_feed/1]).
@ToddG
ToddG / HelloWebView.java
Created May 6, 2012 03:46
Simplified JavaFX Example
package hellowworld;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.Scene;
@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 <todd@vizualiiz.com>"
version "1.0"
# -------------------------------------------------
# stanzas
# -------------------------------------------------
start on (filesystem and net-device-up IFACE=lo) or runlevel [2345]
stop on runlevel [!2345]