Skip to content

Instantly share code, notes, and snippets.

View StefanScherer's full-sized avatar
🌍

Stefan Scherer StefanScherer

🌍
View GitHub Profile
@StefanScherer
StefanScherer / deploy.sh
Created August 3, 2015 21:35
Ghost Buster
#!/bin/bash
buster generate --domain=http://127.0.0.1:2368
find static/* -name *.html -type f -exec sed -i '' 's#u=http://localhost:2368#u=https://stefanscherer.github.io#g' {} \;
find static/* -name *.html -type f -exec sed -i '' 's#url=http://localhost:2368#url=https://stefanscherer.github.io#g' {} \;
find static/* -name *.html -type f -exec sed -i '' 's#href="http://localhost:2368#href="https://stefanscherer.github.io#g' {} \;
find static/* -name *.html -type f -exec sed -i '' 's#src="http://localhost:2368#src="https://stefanscherer.github.io#g' {} \;
find static/* -name *.html -type f -exec sed -i '' 's#link>http://localhost:2368#link>https://stefanscherer.github.io#g' {} \;
buster deploy
@StefanScherer
StefanScherer / 01 - Vagrantfile
Last active August 29, 2015 14:27
vagrant up win10-box with fusion fails
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "windows_10"
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true
@StefanScherer
StefanScherer / swarm-rpi.sh
Last active November 15, 2015 23:14
Raspberry Pi Swarm with overlay network
# Create a RPi with consul running on it
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.3 swl-consul
docker $(docker-machine config swl-consul) run -d --restart=always -p 8500:8500 -h consul nimblestratus/rpi-consul -server -bootstrap
# Create a RPi swarm with consul discovery
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.4 --swarm --swarm-master --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" swl-demo0
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.5 --swarm --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" --engine-label "storage=ssd" swl-demo1
# Connect to the RPi swarm
eval $(docker-machine env --swarm swl-demo0)
@StefanScherer
StefanScherer / uninstall-cygwin-and-shutdown.bat
Created October 7, 2013 20:57
This is a first try to uninstall cygwin before shutting down a windows packer VM.
cd /D %SystemDrive%\
rmdir /s /q "%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\cygwin"
del /F /Q C:\Users\Public\Desktop\Cygwin*
takeown /r /d y /f cygwin
icacls cygwin /t /grant Everyone:F
rmdir /s /q cygwin
rem stop sshd as late as possible
cygwin\bin\cygrunsrv -E sshd
cygwin\bin\cygrunsrv -R sshd
@StefanScherer
StefanScherer / vagrant 1.7.4 up
Created January 4, 2016 17:51
vagrant 1.8.1 problem with OSX VM
Last login: Mon Jan 4 16:26:41 on ttys001
z Error checking TLS connection: IP not found for MAC 00:0c:29:47:68:76 in DHCP leases
~
$ z mac-de
~/code/mac-dev-box on master*
$ VAGRANT_LOG=debug vagrant up
INFO global: Vagrant version: 1.7.4
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_LOG="debug"
Started by user Stefan
[EnvInject] - Loading node environment variables.
Building remotely on scw-04-d0bdd62b (armv7l scaleway Linux swarm docker) in workspace /var/lib/jenkins/workspace/pr-19076-tianon-multiarch
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:tianon/docker # timeout=10
Fetching upstream changes from git@github.com:tianon/docker
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@github.com:tianon/docker +refs/heads/*:refs/remotes/origin/*
Started by user Stefan
[EnvInject] - Loading node environment variables.
Building remotely on r1-a8-56104613 (aarch64 Linux swarm) in workspace /var/lib/jenkins/workspace/pr-19013-aarch64
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:hqhq/docker # timeout=10
Fetching upstream changes from git@github.com:hqhq/docker
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@github.com:hqhq/docker +refs/heads/*:refs/remotes/origin/*
@StefanScherer
StefanScherer / pr19412
Created January 18, 2016 16:45
PR 19412
Started by user Stefan
[EnvInject] - Loading node environment variables.
Building remotely on scw-04-d0bdd62b (armv7l scaleway Linux swarm docker) in workspace /var/lib/jenkins/workspace/skip-tests-on-arm
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:hypriot/docker-dev # timeout=10
Fetching upstream changes from git@github.com:hypriot/docker-dev
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@github.com:hypriot/docker-dev +refs/heads/*:refs/remotes/origin/*
@StefanScherer
StefanScherer / gist:524c9504941141c5df06
Created January 23, 2016 08:54
Create 32bit Docker Machine
$ docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/StefanScherer/boot2docker/releases/download/v1.9.1-386/boot2docker.iso dev32
Running pre-create checks...
Creating machine...
(dev32) Downloading /Users/stefan/.docker/machine/cache/boot2docker.iso from https://github.com/StefanScherer/boot2docker/releases/download/v1.9.1-386/boot2docker.iso...
(dev32) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(dev32) Creating VirtualBox VM...
(dev32) Creating SSH key...
(dev32) Starting the VM...
(dev32) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
@StefanScherer
StefanScherer / steps.md
Created February 20, 2016 00:34
Run VirtualBox Docker Machine in VirtualBox

From a Mac/Linux/Windows PC

vagrant init boxcutter/ubuntu1404
vi Vagrantfile # increase memory to 2GB
vagrant up --provider virtualbox
vagrant ssh

From inside the 64bit VirtualBox VM