Skip to content

Instantly share code, notes, and snippets.

"use strict";
const data = require("./data"); //data.channels[n].id .name .last_update
const express = require("express");
const app = express();
app.use(express.json());
app.get("/api/channel", (req, res) => {
//return the list of channels
// respond with a 200
@nathanleclaire
nathanleclaire / coreos-aws-docker-machine.md
Created March 3, 2017 19:43
Create CoreOS VM on AWS with Docker Machine

This is slightly trickier than I anticipated so noting it down for future reference.

The command should be along these lines (assuming AWS keys are configured via environment variables or config file):

$ docker-machine create \
  -d amazonec2 \
  --amazonec2-region us-west-1 \
  --amazonec2-ami ami-818bd5e1 \
 --amazonec2-zone b \
@kireal
kireal / ufw_docker
Last active June 6, 2021 22:29
ufw docker
Running Docker behind the ufw firewall
Ubuntu ships with a very nice and simple frontend for iptables called ufw (uncomplicated firewall). Ufw makes it possible to setup a firewall without having to fully understand iptables itself. When you however are using Docker and you want to combine Docker with the ufw service. Things do get complicated.
The docker service talks directly to iptables for networking, basically bypassing everything that’s getting setup in the ufw utility and therefore ignoring the firewall. Additional configuration is required to prevent this behavior. The official Docker documentation however, seems to be incomplete.
Configure DEFAULT_FORWARD_POLICY and port 2375
Connections from docker containers get routed into the (iptables) FORWARD chain, this needs to be configured to allow connections through it. The default is to DROP the connections so a change is required:
@CliffordAnderson
CliffordAnderson / brew-install-script.sh
Last active January 3, 2025 06:07
Brew script for installing packages and applications on OSX
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew tap homebrew/cask