Skip to content

Instantly share code, notes, and snippets.

View mavencode01's full-sized avatar
🏠
Working from home

Philip K. Adetiloye mavencode01

🏠
Working from home
View GitHub Profile
@mavencode01
mavencode01 / vagrant_virtualbox_centos7.md
Created November 9, 2015 21:02 — forked from hareeshpc/vagrant_virtualbox_centos7.md
Vagrant installation on Headless ubuntu server (14.04.1) with CentOS and remote ssh login

Installation of virtual box headless

This was obtained from y-yoshinoya at https://gist.github.com/y-yoshinoya/413fcd3f6bfcfce54456

wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian precise non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
sudo apt-get update
sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.3 dkms
@mavencode01
mavencode01 / psql.yml
Created January 27, 2016 08:01
postgres replicated
psql-master:
image: 'sameersbn/postgresql:9.4-4'
deployment_strategy: emptiest_node
environment:
- DB_NAME=gitlabhq_production
- DB_PASS=password
- DB_USER=gitlab
- PSQL_MODE=replicator
- PSQL_TRUST_LOCALNET=true
- REPLICATION_USER=replicator
gitlab-data:
image: 'sameersbn/gitlab:8.0.2'
command: true
volumes:
- '/home/docker/gitlab/data:/home/git/data'
gitlab:
image: 'sameersbn/gitlab:8.0.2'
environment:
- DB_HOST=psql
- DB_NAME=gitlabhq_production
@mavencode01
mavencode01 / gist:1bff1697512768aa3373
Created February 12, 2016 18:02 — forked from lgazo/gist:460a739e640be720f626
consul template nginx shop
upstream shop {
least_conn;
{{range service "shop"}}server {{.Address}}:{{.Port}} max_fails=3 fail_timeout=60 weight=1;
{{else}}server 127.0.0.1:65535; # force a 502{{end}}
}
server {
listen 80;
server_name api.shop.com;
@mavencode01
mavencode01 / gist:dfdc32a85214d6566e73
Created February 12, 2016 18:02 — forked from lgazo/gist:3a4ca2b88b330f9fe443
consul template configuration
consul = "consul.service.consul:8500"
template {
source = "/etc/consul-template/templates/shop.conf"
destination = "/etc/nginx/conf.d/shop.conf"
command = "/etc/init.d/nginx reload"
}
@mavencode01
mavencode01 / gist:c9b3995e9266260d7f73
Created March 9, 2016 19:52 — forked from jdaigle/gist:2781344
SQL Server Service Broker: Short Script to clear DISCONNECTED_INBOUND conversations
DECLARE @handle UNIQUEIDENTIFIER;
WHILE (SELECT COUNT(*) from sys.conversation_endpoints (nolock) where state_desc = 'DISCONNECTED_INBOUND') > 0
BEGIN
SELECT TOP 1 @handle = conversation_handle from sys.conversation_endpoints (nolock) where state_desc = 'DISCONNECTED_INBOUND';
END CONVERSATION @handle WITH CLEANUP
END
@mavencode01
mavencode01 / haproxy-db.conf
Created May 15, 2016 23:07 — forked from aw/haproxy-db.conf
HAProxy configuration for MySQL failover and redundancy
# HAProxy configuration - haproxy-db.cfg
##
## FRONTEND ##
##
# Load-balanced IPs for DB writes and reads
#
frontend db_write
bind 172.16.0.50:3306
@mavencode01
mavencode01 / README.md
Created May 16, 2016 11:24 — forked from oscarrenalias/README.md
Docker service discovery with HAproxy, consul and registrator on Docker Machine and Docker Swarm
@mavencode01
mavencode01 / regv2cdn.sh
Created May 18, 2016 00:24
Registry v2 Push and Pull Script
#!/bin/bash
# Shell scripts for push/pull to v2 registry
#
# - Get a token.
# - Push a blob.
# - Pull that blob repeatedly.
#
# Tested on OS X 10.10.3, curl 7.38.0, jq-1.4
#
@mavencode01
mavencode01 / .gitignore
Created May 20, 2016 20:12 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/