Skip to content

Instantly share code, notes, and snippets.

View earnubs's full-sized avatar

Stephen Stewart earnubs

  • 08:59 (UTC +01:00)
View GitHub Profile
@earnubs
earnubs / vmware-ubuntu-workspace.md
Last active December 10, 2021 16:45
Ubuntu on VMware with LXD containers
@earnubs
earnubs / .jscs.json
Created October 3, 2014 10:13
hinting and linting
{
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
# 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 / 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

@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 / .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]\] \$ '
#!/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 / dev.js
Last active November 16, 2016 21:44
custom webpack logger (talisker)
webpackApp.use(webpackDevMiddleware(compiler, {
contentBase: webpackDevUrl.href,
quiet: false,
hot: true,
noInfo: false,
stats: {
colors: false,
chunks: false,
children: false
},
@earnubs
earnubs / squid.conf
Created January 13, 2017 11:14
squid config jenkaas
# Allow br0
acl br0 src 192.168.234.140/16
# Allow br1
acl br1 src 172.16.183.160/16
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost
@earnubs
earnubs / selenium-webdriver-proxy-browserstack.md
Last active January 19, 2017 12:20
Browserstack selenium-webdriver within a proxied environment

If you are running selenium-webdriver within an environment that requires an HTTPS proxy to connect to the outside world in order to drive your tests, such as when using the Browserstack webdriver hub, then you may need to configure a webdriver proxy with an HTTP CONNECT tunnelling httpAgent, like so:

import { Builder } from 'selenium-webdriver';
import { httpsOverHttp } from 'tunnel-agent';
import url from 'url';

# other stuff ...
const proxyUrl = url.parse(process.env.HTTP_PROXY);