Skip to content

Instantly share code, notes, and snippets.

apiVersion: v1
kind: Pod
metadata:
labels:
name: iis
name: iis
namespace: default
spec:
containers:
- image: microsoft/iis
@BenHall
BenHall / fix.sh
Created June 9, 2017 15:51
downgrade boot2docker
curl -LO https://get.docker.com/builds/Linux/x86_64/docker-17.05.0-ce.tgz
tar -xvf docker-17.05.0-ce.tgz
cp -r docker/* /usr/local/bin
/etc/init.d/docker restart
docker version
web: # Container Name
build: . # Build
links: # Links
- elasticsearch
ports: # Ports
- 3000
environment: # Environment
VIRTUAL_HOST: ’www.katacoda.com'
NODE_ENV: 'production’
@BenHall
BenHall / couchbalanced
Created April 3, 2010 13:14
HAProxy and CouchDB
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@BenHall
BenHall / Dockerfile
Created April 11, 2017 15:44
tensorflow-serving Dockerfile
FROM katacoda/tensorflow-serving-devel:latest
WORKDIR /serving
EXPOSE 9000
CMD ["bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server", "--port=9000", "--model_name=inception", "--model_base_path=inception-export"]
# Client Example
# bazel-bin/tensorflow_serving/example/inception_client --server=localhost:9000 --image=/path/to/my_cat_image.jpg
COPY . /serving
RUN cd /serving/tensorflow && \
@BenHall
BenHall / ConnectionStrings.config
Created January 19, 2017 15:03
Deploy NerdDinner.com 2.0 as Windows Containers
<connectionStrings>
<add name="ApplicationServices" connectionString="Data Source=nerddinnerdb,1433;User Id=sa;Password=p@sSw0rd1sl0ngY0;" providerName="System.Data.SqlClient"/>
<add name="NerdDinnerEntities" connectionString="metadata=res://*/Models.NerdDinner.csdl|res://*/Models.NerdDinner.ssdl|res://*/Models.NerdDinner.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=nerddinnerdb,1433;User Id=sa;Password=p@sSw0rd1sl0ngY0;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
<add name="ELMAH.SQLite" connectionString="Data Source=|DataDirectory|errors.s3db"/>
</connectionStrings>
variables:
IMAGE_NAME: https://HOST2_SUBDOMAIN-80-KATACODA_HOST.environments.katacoda.com/root/front-end
TAG: $CI_BUILD_ID
stages:
- build
- push
- cleanup
build_production:
stage: build
script:
@BenHall
BenHall / jwt.js
Created January 4, 2017 11:40
Json Web Tokens Example
var fs = require('fs');
var jwt = require('jsonwebtoken');
var token = jwt.sign({ foo: 'bar' }, 'blah');
var decoded = jwt.verify(token, 'blah');
console.log("Decodable at https://jwt.io/#debugger", token, decoded.foo); // bar
// invalid token - synchronous
try {
@BenHall
BenHall / passport.js
Created February 29, 2012 14:48
passport.js auth route
exports.ensureAuthenicated = function(req, res, next) {
if (req.isAuthenticated()) { return next(); }
res.redirect('/login')
}