Skip to content

Instantly share code, notes, and snippets.

View jasonpincin's full-sized avatar
🌎

Jason Pincin jasonpincin

🌎
View GitHub Profile
@jasonpincin
jasonpincin / vmmv
Created February 13, 2013 16:42
Moves a SmartOS VM to a different SmartOS host
#!/usr/bin/bash
# Moves a SmartOS VM to a different host
# This script stops the VM, sends it to the target host,
# imports it on the target host, and starts it on the
# target host. It is your responsibility to remove it on
# the origin host after confirming the script worked as
# expected.
#
# Usage:
@jasonpincin
jasonpincin / SDK-interface.js
Created May 19, 2020 16:46
SDK Topic Interface RFD
async function topicInterests() {
return [
{ topic, keyDeserializer, valueDeserializer, onCurrent }
]
}
@jasonpincin
jasonpincin / vmip.sh
Created February 7, 2013 00:12
Updates IP addresses of a SmartOS VM (with less hassle)
#!/usr/bin/bash
# Updates IP addresses of a SmartOS VM
# This script stops the VM, updates the IP address(es),
# and starts the VM back up.
#
# Usage:
# vmip.sh <uuid> <ip1> [ip2] [ip3] [...]
#
# The IP's are applied to NICs of the VM in order. The

Quimby

Quimby is Walmart's service layer for mobile clients' configuration, CMS, a-b testing setup, and a few other sundry related services. It stitches together a constellation of data sources into a concise menu of API calls that mobile clients make to intialize and configure themselves.

Quimby is a REST service layer based upon the Gogo micro-service framework that we in turn built with Node.js, Hapi, Zookeeper, and Redis. Gogo is able to expose an array of web servers as a single host, and offers the ability to isolate tasks into smaller focused processes, emphasizing scalability and failure recovery. For example, a failure in any micro-service will not affect the life cycle of a request. Gogo also offers the additional features required to build distributed services with shared state, such as leader election.

Quimby components

  • Penny (part of Gogo) - The micro-service router, responsible for pairing a request with a servicer
#!/usr/bin/env bash
VDATA=$(vault read -format=json secret/core/core-id/staging/us-east-1/rds)
PW=$(echo $VDATA | jq -r .data.password)
USER=$(echo $VDATA | jq -r .data.username)
DBNAME=$(echo $VDATA | jq -r .data.dbname)
HOST=$(echo $VDATA | jq -r .data.endpoint)
tables="Users,AccessToken,AuthorizationCode,Client,ClientCredentials,IdStore,InitialAccessToken,RefreshToken,RegistrationAccessToken,Session"
@jasonpincin
jasonpincin / docker-compose.yml
Last active March 6, 2017 19:33
example autopilotpattern/redis docker-compose config for Triton deployment
version: '2.1'
services:
redis:
image: autopilotpattern/redis:3.2.8-r1.0.0
mem_limit: 4g
restart: always
expose:
- 6379
- 26379
@jasonpincin
jasonpincin / docker-compose.yml
Created March 6, 2017 19:33
example autopilotpattern/redis docker-compose config for local deployment
version: '2.1'
services:
redis:
image: autopilotpattern/redis:3.2.8-r1.0.0
mem_limit: 512m
restart: always
expose:
- 6379
- 26379
@jasonpincin
jasonpincin / gist:6135060
Created August 1, 2013 20:38
Enable tap reporting for jasmine-node
if (require.main === module) {
var _t = require('jasmine-node').getEnv()
_t.addReporter(new (require('jasmine-tapreporter'))(console.log))
process.nextTick(_t.execute.bind(_t))
}
@jasonpincin
jasonpincin / test_spec.js
Created July 2, 2013 23:54
jasmine test with tap output
if (require.main === module) {
var _t = require('jasmine-node').getEnv()
_t.addReporter(new (require('jasmine-tapreporter'))(console.log))
process.nextTick(_t.execute.bind(_t))
}
describe('something', function () {
it('should do something', function () {
})
@jasonpincin
jasonpincin / mkimg
Last active December 13, 2015 18:49
Companion script to import-image script (https://gist.github.com/jasonpincin/4958050), this script is intended for running against VM's in the global zone. It will snapshot them, and send them off to the image server (equipped with the import-image script).
#!/usr/bin/bash
# Creates an image from a VM
# WARNING: You should run sm-prepare-image inside the zone
# BEFORE running this script!
#
# This script requires the smartos-image-server to be
# equipped with the import-image script:
# https://gist.github.com/jasonpincin/4958050
#