Skip to content

Instantly share code, notes, and snippets.

View christianacca's full-sized avatar

Christian Crowhurst christianacca

View GitHub Profile
@christianacca
christianacca / configure docker node automatically
Created March 10, 2019 16:09
configure docker node automatically
# this specific example configures a docker storage plugin automatically when a node joins the swarm
docker service create --mode global --restart-condition none \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--name enable-cloudstor-azure-plugin \
docker:latest \
sh -c "echo Set up and enable cloudstor:azure plugin. Be patient... && sleep 120 && docker plugin set cloudstor:azure AZURE_STORAGE_ACCOUNT_KEY=PUT-YOUR-AZURE-STORAGE-KEY-HERE && docker plugin enable cloudstor:azure && docker plugin ls && echo Done."
@christianacca
christianacca / DbSetting.cs
Created February 15, 2017 12:50
Custom Castle.Windsor ISubDependencyResolver
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Ram.Series5.Data.Settings
{
public class DbSetting
{
public DbSetting()
{
Scope = string.Empty;
@christianacca
christianacca / .gitconfig
Last active April 28, 2017 04:35
GIT aliases for keeping history clean
[alias]
ec = config --global -e
co = checkout
cob = checkout -b
pushit = "!f() { git rev-parse --abbrev-ref HEAD ; }; git push --set-upstream origin `f`"
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
startb = "!f() { git cob $1 && git pushit; }; f"
syncb = !git fetch origin ${1-master} && git rebase origin/${1-master}
cleanb = !git rebase -i origin/${1-master}
finishb = "!f() { git rev-parse --abbrev-ref HEAD | xargs -i_branch sh -c 'git checkout ${1-master} -f && git pull origin && git merge _branch --ff-only && git push origin ${1-master}'; }; f"