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
#!/bin/bash
BLK=$(tput setaf 0)
RED=$(tput setaf 1)
GRN=$(tput setaf 2)
YEL=$(tput setaf 3)
BLU=$(tput setaf 4)
MAG=$(tput setaf 5)
CYN=$(tput setaf 6)
WHY=$(tput setaf 7)
#!/bin/bash
# COLORS!!!!
RED=$(tput setaf 1)
CLR=$(tput sgr0)
# 1. grab pending chagnes
# 2. remove ?? files that aren't part of the commit
# 3. only grab things in the index
git status --porcelain |\

dependencies

root@de2af2218c88:/tpo-api# apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Overview

A fully transparent http proxy that can be used to swap out npm packages on the fly.

Configuration

Environment

UPSTREAM_HOST=http://api.npmjs.org/
ADMIN_USER=bob

Creating a SmartOS VM

imgadm import 17c98640-1fdb-11e3-bf51-3708ce78e75a
vmadm create < vm.json

Update VM

  1. edit vm.json
This file has been truncated, but you can view the full file.
start entry
dyld_stub_binding_helper entry
_dyld_func_lookup entry
node::FSEventWrap::FSEventWrap(v8::Handle<v8::Object>) entry
node::FSEventWrap::~FSEventWrap() entry
node::FSEventWrap::Initialize(v8::Handle<v8::Object>) entry
node::FSEventWrap::New(v8::Arguments const&) entry
node::FSEventWrap::Start(v8::Arguments const&) entry
node::FSEventWrap::Close(v8::Arguments const&) entry
node::FSEventWrap::OnEvent(uv_fs_event_s*, char const*, int, int) entry

Raspberry Pi NodeOS

ifconfig eth0 192.168.2.2
route 192.168.2.1
npkg install nko2013-raspinodeos-server
npkg start nko2013-raspinodeos-server
#-- Boilerplate --
#
# This must be a layer-2 image
# Use the default unless you're customizing layer-2 or below
FROM nodeos/base
# Important to have /root/bin binaries accessible
ENV HOME /root
ENV PATH /root/bin:/usr/bin:/usr/sbin:/bin:/sbin
@groundwater
groundwater / Dockerfile
Last active December 24, 2015 05:09
Build a Custom NodeOS with a Dockerfile
FROM nodeos/base
MAINTAINER Jacob Groundwater <groundwater@gmail.com>
ENV HOME /root
ENV PATH /root/bin:/usr/bin:/usr/sbin:/bin:/sbin
# Use `init` to boot the system
ENTRYPOINT ["init"]

NodeOS Init

History

Init is the first process launched on boot that is not in kernel space. Init runs as the root user, but it is still a user land process. Init has a process-id, it can be sent signals, and uses standard syscalls to interact with the kernel.

What makes init special is that it is essentially in charge of booting the operating system. During the boot process