Skip to content

Instantly share code, notes, and snippets.

View earnubs's full-sized avatar

Stephen Stewart earnubs

View GitHub Profile
#!/bin/bash
# configure LXD profile for dual nic macOS/vmware fusion set up https://gist.github.com/earnubs/eec3c6aa1e091c0a898c
set -eu
_UID=$(id -u)
GID=$(id -g)
GROUP=$(id -gn)
SUBUID=root:$_UID:1
SUBGID=root:$GID:1
@earnubs
earnubs / .bashrc
Last active July 28, 2016 15:10
PS1 with node version
PS1='\[\e]0;\w\a\]\[\n\]\[\e[32m\]\u@\h: \[\e[33m\]\[\w\]\[\e[0m\]\[\n\][node \[\e[0;36m\]$(node -v)\[\e[m]\] \$ '
@earnubs
earnubs / watch.sh
Created May 22, 2015 12:52
run a bunch of fswatch tasks
#!/bin/sh -u
folders=( "www/public/images" "www/templates" "www/public/js" "www/public/css")
echo "Sending watched files to ${UBUNTU_CORE_ADDR:?"Need to set UBUNTU_CORE_ADDR"}"
for i in "${folders[@]}"
do
echo $i
fswatch -0 $i | xargs -0 -n 1 -I {} scp {} $UBUNTU_CORE_ADDR:/apps/webdm/current/$i &
done
wait
@earnubs
earnubs / snappy-osx-vmware-fusion-howto.md
Last active August 13, 2018 21:09
How to setup Ubuntu Core 16 for developers on OS X with VMWare Fusion

Creating an Ubuntu Core Series 16 image

On VMWare fusion, running an Ubuntu Xenial VM, which has a copy of your OS X public SSH key -- the script to build the image will add it to the generated image -- grab the script at https://github.com/zyga/devtools/blob/master/ubuntu-image to create a new image:

./ubuntu-image.sh --developer-mode pc

Convert .img to .vmdk

qemu-img convert pc-devel.img -O vmdk snappy.vmdk

# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu
# Parameters passed to the template: -a amd64 -r trusty -b{$USER}
# For additional config options, please look at lxc.container.conf(5)
# Autostart a container with name NAME (change this)
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
# Container specific configuration
@earnubs
earnubs / .jscs.json
Created October 3, 2014 10:13
hinting and linting
{
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
@earnubs
earnubs / vmware-ubuntu-workspace.md
Last active December 10, 2021 16:45
Ubuntu on VMware with LXD containers
@earnubs
earnubs / gulpfile.js
Last active August 29, 2015 14:05
yui module build
var buffer = require('vinyl-buffer');
var concat = require('gulp-concat');
var fs = require('fs');
var gulp = require('gulp');
var src = require('vinyl-fs').src;
var tap = require('gulp-tap');
var through = require('through2');
var uglify = require('gulp-uglify');
var paths = {
'use strict';
module.exports = function(grunt) {
grunt.registerMultiTask('blanket', 'Instrument files with Blanket.js', function() {
var blkt = require("blanket")({
"data-cover-flags": ['*.js']
});
#!/bin/bash
PROJECT_ROOT="/path/to/project/"
API_PATH="$PROJECT_ROOT/api/workspace"
WEB_PATH="$PROJECT_ROOT/web/workspace"
cd $API_PATH
tmux new-session -d -s appstore "make build run"
tmux rename-window 'Logs'