Skip to content

Instantly share code, notes, and snippets.

foofoodog / Dockerfile
Last active Jul 6, 2019
steamcmd rust server
View Dockerfile
from ubuntu as patched
run apt-get update; \
apt-get install software-properties-common apt-utils debconf-utils -y; \
apt-get install --reinstall ca-certificates; \
add-apt-repository multiverse; \
dpkg --add-architecture i386; \
apt-get update;
from patched as steamcmd
copy .
View AsParallel.linq.cs
async Task Main()
Action<WorkItem> actionItem = (WorkItem w) => w.DoWork();
var jobs = (from x in Enumerable.Range(1, 64)
let workItem = new WorkItem() { Id = x }
select new ActionItem<WorkItem>()
item = workItem,
action = (t) => actionItem(t)
FROM microsoft/dotnet:sdk AS build-env
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN apt-get update; \
apt-get install -y gnupg gnupg2 gnupg1; \
foofoodog / -node-red with dashboard and mosquitto in alpine
Last active Apr 7, 2018
node-red with dashboard and mosquitto in alpine docker
View -node-red with dashboard and mosquitto in alpine

node-red with dashboard and mosquitto in alpine docker

Cmd wrapper around docker commands to build and run an IoT dashboard kind of thing. Tries to do the right thing:

  • Create the image if it does not exist then run the container.
  • Run the container if it does not exist and the image does.
  • Start the container if it exists and is stopped.
Usage: node-red-local [clean]
    clean: Remove container and image to start from scratch. Note that all flows and dashboard items will be lost.
foofoodog / dl.cmd
Created Mar 28, 2018
youtube-dl as a linux docker on windows
View dl.cmd
@echo off
if %1.==. goto err
docker build -q -t utube . > nul
docker run --rm -v"%cd%":/data -e url="%*" utube
goto :eof
echo needs 1 url arg
foofoodog / index.htm
Last active May 7, 2016
OctoPrint monitoring starter
View index.htm
var printers = [
{name: "folger", key: "raspberry"},
{name: "simple", key: "raspberry"},
{name: "solid", key: "raspberry"},
{name: "printrbot", key: "raspberry"}
View egg.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
foofoodog / App.js
Last active Nov 15, 2015
octoprint client libs
View App.js
var App = function(ready) {
var self = this;
self.config = {
options : {baseurl: "http://localhost:5000", apikey:"raspberry"},
scripts: ["/static/webassets/packed_libs.js", "/static/webassets/packed_client.js"]
self.load = function(idx) {
idx = idx || 0;
if (idx === self.config.scripts.length) return self.done();
var tag = document.createElement("script");
foofoodog / folger toc.linq
Last active Sep 20, 2015
LINQPad to parse specific github and generate reddit markdown TOC
View folger toc.linq
var readme = "";
var includes = new[] { "id=\"user-content-", "href=\"#" };
var excludes = new[] { "<article" };
// input
IEnumerable<XElement> elements;
using (var client = new WebClient())
elements = from line in client.DownloadString(readme).Split('\n')
includes.All(include => line.Contains(include))
foofoodog / nuke.cmd
Last active Aug 29, 2015
Rip and replace OctoPrint
View nuke.cmd
#!/usr/bin/env bash
cd ~
sudo service octoprint stop
sudo rm -Rf OctoPrint
sudo rm -Rf .octoprint
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev
git clone
cd OctoPrint