Skip to content

Instantly share code, notes, and snippets.

View glinton's full-sized avatar

Greg glinton

View GitHub Profile
@glinton
glinton / get-it.md
Last active August 14, 2017 18:03
Fetch file from Nanobox launched app
# '##' is a command to be run after modification

# console into your host server (VERY risky! Please do not modify anything unless you fully understand and accept the consequences)
nanobox console my-app do.1

# add your public key (from your laptop) to the authorized_keys file
# DO NOT REMOVE ANYTHING FROM THIS FILE! (Nanobox will fail to work if you do)
## edit `/root/.ssh/authorized_keys` and ADD/APPEND your public key (located on your laptop, generally at ~/.ssh/id_rsa.pub)
@glinton
glinton / evars.sh
Created August 22, 2017 16:47
Adding 'complex' evars with `nanobox`
# Add it after manually converting the newlines
nanobox evar add local KEY1="-----BEGIN RSA PRIVATE KEY-----\nM\nW\nA\na\n5\nZ\nA\n5\nJ\nU\nC\na\nr\nR\nD\nS\nY\nb\n0\nK\n4\nM\nM\n1\nD\n-----END RSA PRIVATE KEY-----"
# Add it via a bash-friendly string
nanobox evar add local KEY2="-----BEGIN RSA PRIVATE KEY-----
M
W
A
a
5
@glinton
glinton / portal.md
Last active November 26, 2017 10:58
Portal as an SSL terminator for `nanobox run`

Download portal for your OS.

Create a config file for portal

config.json

{
 "db-connection": "scribble:///tmp/portal",
 "log-level": "info",
 "server": true,

>> "just-proxy": true

@glinton
glinton / bootstrap.sh
Last active March 1, 2018 19:35
nanoagent-v2 bootstrap script
#!/bin/bash
#
# Boostraps an ubuntu machine to be used as an agent for nanobox
# exit if any any command fails
set -e
set -o pipefail
# todo:
@glinton
glinton / progress.md
Last active April 2, 2018 21:29
Rosetta permute. Generate simple progress from rsync.

Rosetta rsync output parsing

Comparing various text "permuters" to show pretty output for rsync

awk Winner

rsync --info=progress2 * [email protected]:/tmp/new/ 2> /dev/null | stdbuf -i0 -o0 tr $'\r' $'\n' | awk '{printf "\rSyncing image: %s - %s",$2,$3}'
# Syncing image: 100% - 37.30MB/s
# real	0m3.012s

perl Runner up