Skip to content

Instantly share code, notes, and snippets.

View gembin's full-sized avatar
🎯
Focusing

gembin

🎯
Focusing
  • Seattle, WA
  • 09:11 (UTC -07:00)
View GitHub Profile
@gembin
gembin / README.md
Created March 21, 2016 08:08 — forked from mhausenblas/README.md
Kubernetes debugging session leveraging labels

That's our RC:

$ cat ws-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: webserver-rc
spec:
  replicas: 5

selector:

@gembin
gembin / user_data.sh
Created March 9, 2016 17:14
Custom IP Resolution with Cloud-Config
#!/bin/sh
workdir=$(mktemp --directory)
trap "rm --force --recursive ${workdir}" SIGINT SIGTERM EXIT
cat >"${workdir}/cloud-config.yml" <<EOF
#cloud-config
coreos:
etcd:
@gembin
gembin / whatimdoing.yaml
Created March 9, 2016 17:14 — forked from ForbiddenEra/whatimdoing.yaml
my cloud-configz yo
#cloud-config
ssh_authorized_keys:
- ssh-rsa key
write_files:
- path: /opt/cloud-config.yml
permissions: 0644
content: |
#cloud-config
@gembin
gembin / gist:f855dce496a1a341da06
Created February 18, 2016 16:52 — forked from rednaxelafx/gist:925323
Correspondence between Sun/Oracle JDK, OpenJDK and HotSpot VM versions

Correspondence between Sun/Oracle JDK, OpenJDK and HotSpot VM versions

build date Sun/Oracle JDK Version OpenJDK Version HotSpot VM Version
2006-11-29 1.6.0-b105 1.6.0-b105
2007-03-14 1.6.0_01-b06 1.6.0_01-b06
2007-06-22 1.6.0_02-b05 1.6.0_02-b05
2007-09-24 1.6.0_03-b05 1.6.0_03-b05
2007-12-14 1.6.0_04-b12 10.0-b19
@gembin
gembin / gist:0aef0ae7770f6e3fbebc
Created February 15, 2016 09:10 — forked from kchida/gist:d1c15f3968f4f8272c49
etcd vs consul vs ???
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@gembin
gembin / pedantically_commented_playbook.yml
Created February 1, 2016 18:12 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@gembin
gembin / gulpfile.js
Created January 13, 2016 17:06 — forked from balthazar/gulpfile.js
gulp-rev-all mockup
var gulp = require('gulp');
var rev = require('gulp-rev-all');
var css = require('gulp-minify-css');
var img = require('gulp-imagemin');
var rs = require('run-sequence');
var del = require('del');
gulp.task('image', function () {
return gulp.src('image.jpeg')
.pipe(img({ progressive: false }))
@gembin
gembin / initd
Created December 10, 2015 16:04 — forked from pdeschen/initd
CentOS service initd erb template. Ready to use in Opscode Chef or replace template variables with your own hard-coded value. Takes into account priority/nice, sudo user, and /etc/sysconfig/ Support start, stop, restart, console.
#!/bin/sh
#
# <%=@service%> This shell script takes care of starting and stopping
# the <%=@service%> service.
#
# chkconfig: 2345 65 35
# description: <%=@description%>
#
SERVICE=<%=@service%>
@gembin
gembin / tasks.yml
Created December 10, 2015 09:05 — forked from maxim/tasks.yml
Copy file on remote machine in ansible
- name: ensure file exists at path
shell: rsync -ci /source/path /destination/path
register: rsync_result
changed_when: "rsync_result.stdout != ''"
package vmarcinko.undertow;
import io.undertow.Handlers;
import io.undertow.Undertow;
import io.undertow.server.HttpHandler;
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.handlers.RedirectHandler;
import io.undertow.server.handlers.resource.FileResourceManager;
import io.undertow.servlet.Servlets;
import io.undertow.servlet.api.DeploymentInfo;