Skip to content

Instantly share code, notes, and snippets.

View radu-matei's full-sized avatar

Radu Matei radu-matei

View GitHub Profile
@radu-matei
radu-matei / cheatsheet.md
Last active February 7, 2017 17:11
CodeCamp cheatsheet

Creating and Dockerizing an ASP.NET Core application

First of all, we need to add a reference to the Microsoft.AspNetCore.Server.Kestrel web server, version 1.1.0.

Then, we just create a very basic .NET Core application that creates a web host and runs it, with a very basic response to every request.

using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@radu-matei
radu-matei / custom-tinycore.sh
Created February 3, 2017 13:20 — forked from dankrause/custom-tinycore.sh
Create a custom tinycore linux iso. Adjust the config at the beginning of the script, or supply a conf as the first arg. Requires xorriso.
#!/bin/bash
set -e
function cleanup() {
# clean up our temp folder
rm -rf "${TMPDIR}"
}
trap cleanup EXIT

Connect to a Docker Engine from Bash on Ubuntu on Windows

This walkthrough is based on Carlos Rafael Ramirez's awesome answer on Server Fault and will allow you to run the Docker client in the Bash on Ubuntu on Windows user space.

Note that this will only allow you to connect to a remote Docker engine and will not run it inside the Bash on Ubuntu on Windows shell, since it only has a user space (and Docker requires a Linux kernel).

First of all, you need to Install Docker for Windows

  • get the Docker Client: wget https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz
---
apiVersion: "v1"
kind: "List"
items:
- apiVersion: "v1"
kind: "Namespace"
metadata:
name: "kubernetes-plugin"
labels:
version: "3"
services:
redis:
image: redis:3.2.100-nanoserver
deploy:
placement:
constraints: [node.platform.os == windows]
web:
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "SwarmMode"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "",
"vmSize": "Standard_D2_v2"
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
version: "3"
services:
redis:
image: redis
web:
image: radumatei/python-web
ports:
- "80:80"
<!DOCTYPE html>
<html>
<body>
<h1>Azure <3 Open Source</h1>
<img src="https://raw.githubusercontent.com/ashleymcnamara/gophers/master/Gopher_Microsoft.png"/img>
<style>
html, body {
FROM php:7.0.6-apache
MAINTAINER Azure App Services Container Images <appsvc-images@microsoft.com>
COPY apache2.conf /bin/
COPY init_container.sh /bin/
COPY hostingstart.html /home/site/wwwroot/hostingstart.html
RUN a2enmod rewrite expires include
# install the PHP extensions we need