Skip to content

Instantly share code, notes, and snippets.

View technolo-g's full-sized avatar

Matt Bajor technolo-g

View GitHub Profile
@technolo-g
technolo-g / nginx_docker_redirect.conf
Last active April 6, 2018 22:31
Redirect subdomain to port (nginx)
# This will redirect a numerical subdomain to a port.
# A use would be Docker contianers.
# This relies on the following DNS record:
# *.test.domain.com IN A 10.100.199.31
# and the fact that this container would run on the same Docker
# host as the backends.
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
@technolo-g
technolo-g / squash.md
Last active August 29, 2015 14:08
Squash commits in a branch

This method is harder than using the get reset method above. Also it doesn't work well if you merged the master into the feature branch previously (you'll need to resolve all conflicts again).

What we are describing here will destroy commit history and can go wrong. For this reason, do the squashing on a separate branch:

git checkout -b squashed_feature

To squash all commits since you branched away from master, do

git rebase -i master
@technolo-g
technolo-g / gist:bdac8229829c07d4aedd
Created November 4, 2014 19:47
Consul/HAProxy vs VulcanD/EtcD

HAProxy + Consul vs VulcanD + EtcD

HAProxy/Consul

  • Pro: Both are production ready
  • Pro: Can handle any throughput we will see
  • Pro: More feature rich
    1. Healthchecks
    2. DNS and HTTP API available to map endpoints
    3. Lots of service discovery built in
  • Pro: Solution could be used in more than one place (bld/prod/etc..)
alias javaws='/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/javaws'
# Install
Download the package here http://www.lsi.com/support/Pages/download-results.aspx?keyword=megacli
Extract it
On RHEL, Install the rpm under Linux
On Ubuntu:
apt-get install rpm2cpio
cd Linux; rpm2cpio MegaCli-*.rpm | cpio -idmv
# Usage
List all physical disks:
@technolo-g
technolo-g / versions.md
Created January 6, 2015 00:00
Docker Version vs. Swarm version

Docker version info

$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.4
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
Server version: 1.4.1
Server API version: 1.16
@technolo-g
technolo-g / gen_ssl.sh
Created January 6, 2015 16:43
Generate Docker SSL Certificates
#!/bin/bash
echo 'Creating CA (ca-key.pem, ca.pem)'
echo 01 > ca.srl
openssl genrsa -des3 -passout pass:password -out ca-key.pem 2048
openssl req -new -passin pass:password \
-subj '/CN=Non-Prod Test CA/C=US' \
-x509 -days 365 -key ca-key.pem -out ca.pem
echo 'Creating client certificates (key.pem, cert.pem)'
@technolo-g
technolo-g / report.md
Created January 6, 2015 18:22
Vagrant + VMware Issue

Versions

VMware Fusion 7.1.0

$ vagrant version
Installed Version: 1.7.1
Latest Version: 1.7.1

You're running an up-to-date version of Vagrant!
@technolo-g
technolo-g / tls.md
Last active August 29, 2015 14:12
TLS Issue

CLI Output

[14:56:23 mbajor@mbajor-DraakBookPro:~/Dev/docker-swarm/master]
$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[14:57:53 mbajor@mbajor-DraakBookPro:~/Dev/docker-swarm/master]
$ docker run -d -t ubuntu:latest /bin/bash
342e581c14c6ebf9c4b40c5913cd0ffa2824744996781f1379b49f86c18585d4
FATA[0000] Error response from daemon: Post https://dockerhost01:2376/v1.16/containers/342e581c14c6ebf9c4b40c5913cd0ffa2824744996781f1379b49f86c18585d4/start: x509: certificate signed by unknown authority
[14:57:59 mbajor@mbajor-DraakBookPro:~/Dev/docker-swarm/master]
@technolo-g
technolo-g / mnesia_error.md
Created April 11, 2015 01:25
Mnesia on LING
vagrant@vagrant-xen-trusty64:~/testn-autoproxy$ cat domain_config
name = "testn-autoproxy"
kernel = "testn-autoproxy.img"
extra = "-home /testn-autoproxy -pz /testn-autoproxy/apps/autoprox/ebin /testn-autoproxy/deps/ej/ebin /testn-autoproxy/deps/mnesia/ebin /testn-autoproxy/deps/mochijson2/ebin -goofs /tmp"
vif = []
disk = [ "tap:aio:/tmp/fs.img,xvda,w" ]
memory = 1024
vagrant@vagrant-xen-trusty64:~/testn-autoproxy$ sudo xl create -c domain_config
Parsing config from domain_config