Skip to content

Instantly share code, notes, and snippets.

View groundwater's full-sized avatar
:electron:
Performing Alchemy

Groundwater groundwater

:electron:
Performing Alchemy
View GitHub Profile

Keybase proof

I hereby claim:

  • I am groundwater on github.
  • I am groundwater (https://keybase.io/groundwater) on keybase.
  • I have a public key whose fingerprint is 2A5C 5EB2 E3C7 2DD5 4670 9E6C A3E8 5A7A 83C8 431A

To claim this, I am signing this object:

The Nano Kernel

A nano-kernel (nK) a cross between a second boot-loader, and a micro-kernel. The nK does not provide memory isolation or process segregation. It's only role is to bootstrap high-level VMs in kernel space.

A nK serves a special type of system where all programs are JIT compiled by the kernel before execution.

Features

I've been using CoreOS as an internal Docker PaaS, and have had a few thoughts.

  1. While sub-optimal, there is a need to map in network storage to containers.

    For example, Jenkins stores its configuration on the file system. As CoreOS containers can and should be portable around the cluster, unless you're using some kind of distributed storage your Jenkins configs will disappear periodically.

  2. Almost everything else should be ephemeral. You should replace CoreOS machines with fresh images periodically. Rather than perform maintenance and cleanup of the CoreOS hosts, just replace them. This is not only convenient, but tests failover constantly.

  3. Map in ephemeral storage for apps to use as temporary/scratch disk.

  4. Corollary: databases that do their own replication can use scratch disk instead of network storage

  5. Leverage etcd for service discovery

class Server {
constructor(){
this.user = {}
}
// add a single user
// this is a simple case
async putUser(uid, user){
this.user[uid] = user
}
let sink = async function(iter) {
for (let item of iter) {
console.log('got', await item)
}
}
sink(function*(){
var i = 0
while(true) {
yield new Promise(done => {
@groundwater
groundwater / index.js
Last active August 29, 2015 14:18
JavaScript Modules and Dependency Injection
import {Router} from './myRouter'
import {Component} from './myComponent' with {Router} // inject Router into imported module
const component = new Component()
component.doSomething()
@groundwater
groundwater / Application.scala
Created April 11, 2012 05:34
Scala Anorm and Google Protocol Buffers
package controllers
import anorm._
import anorm.SqlParser._
import play.api.db.DB
import play.api.Play.current
import play.api._
import play.api.mvc._
javascript:
/* tldr.js copyright Seth Raphael 2011 */
void(initsumm());
function initsumm() {
initStopList();
var paragraphs = document.getElementsByTagName('p');
var rootContent;
if (!rootContent) rootContent = document.getElementById('post');
/*blogs*/
if (!rootContent) rootContent = document.getElementById('content');
@groundwater
groundwater / Application.scala
Created April 12, 2012 08:12
Play with HBase
package controllers
import play.api._
import play.api.mvc._
import com.googlecode.protobuf.format._
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.{ HTable, Put, Scan, Get }
import org.apache.hadoop.hbase.util.Bytes
@groundwater
groundwater / TransactionalCoprocessors.scala
Created April 20, 2012 06:02
Coprocessor Transactions in HBase and Scala
/** This builds a transactional layer into HBase via coprocessors.
*
* Transactions can be performed by sending a group of mutations,
* to a coprocessor. The coprocessor modifies the table using a
* special mutation protocol that ensures anyone using the same
* protocol will only view atomic commits.
*
* Querying the table directly does not guaruntee atomicity. You
* _must_ query using the provided protocol.
*