This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It SEEMS that the issue lies with Vagrant not using the latest packer build. The Vagrantfile is simple: | |
$ vagrant init builds/safworx.virtualbox.box | |
$ egrep -v '^($|#|\ \ #)' Vagrantfile | |
Vagrant.configure("2") do |config| | |
config.vm.box = "builds/safworx.virtualbox.box" | |
end | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -uex | |
dirIndex=() | |
while read -r -d ''; do | |
dirIndex+=("$REPLY") | |
done < <(find ~/.gem/jruby/ -print0) | |
#printf '%s\n' "${dirIndex[@]}" | |
printf '%s\n\n' "${dirIndex[@]:(-2):1}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are some details up front: | |
$ file /usr/local/bin/packer | |
/usr/local/bin/packer: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, not stripped | |
$ uname -a | |
Linux system.domain.tld 3.10.0-327.36.2.el7.x86_64 #1 SMP Mon Oct 10 23:08:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux | |
----CORE DUMP----------------------------------------------------------------------- | |
$ gdb /usr/local/bin/packer -c core.10590 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> default: Prepping ssh stuff... | |
==> default: + ssh-keyscan github.com | |
==> default: # github.com SSH-2.0-libssh-0.7.0 | |
==> default: # github.com SSH-2.0-libssh-0.7.0 | |
==> default: no hostkey alg | |
==> default: # github.com SSH-2.0-libssh-0.7.0 | |
==> default: no hostkey alg | |
==> default: + chown vagrant:vagrant /home/vagrant/.ssh/known_hosts | |
==> default: + cp -fv /vagrant/sources/id_rsa /vagrant/sources/id_rsa.pub /home/vagrant/.ssh | |
==> default: ‘/vagrant/sources/id_rsa’ -> ‘/home/vagrant/.ssh/id_rsa’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootstrap.sh pulls in the build keys and calls the 'git-code' script: | |
... | |
###--- | |
### bootstrap.sh: Copy keys for github | |
###--- | |
printf '\n\n%s\n' "Prepping ssh stuff..." | |
# FIX this later | |
#sed -i 's/.*StrictHostKeyChecking.*/StrictHostKeyChecking no/g' /etc/ssh/ssh_config | |
ssh-keyscan github.com >> "$vagrantHome/.ssh/known_hosts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sleep 2 | |
set -eux | |
###---------------------------------------------------------------------------- | |
### VARIABLES | |
###---------------------------------------------------------------------------- | |
export DEBIAN_FRONTEND=noninteractive | |
vagrantHome='/home/vagrant' | |
backupDir="$vagrantHome/backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------ | |
# This file defines an EC2 instance with: | |
# * Origins in the GOLDEN_IMAGE AMI. | |
# * Its own security groups. | |
# ** That leverages our ssh key(s). | |
# * Deploys a simple script. | |
# * And fires-up the app with Docker | |
# vim: et:ts=2:sw=2 | |
# ------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chdir(/tmp) | |
fchdir() to previous dir | |
chdir(/usr/local/share/vim) | |
fchdir() to previous dir | |
could not source "$VIM/vimrc" | |
chdir(/usr/local/share/vim/vim80) | |
fchdir() to previous dir | |
could not source "$VIMRUNTIME/macmap.vim" | |
chdir(/Users/vagrant) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install python python3 | |
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.13.sierra.bottle.tar.gz | |
Already downloaded: /Users/vagrant/Library/Caches/Homebrew/python-2.7.13.sierra.bottle.tar.gz | |
==> Pouring python-2.7.13.sierra.bottle.tar.gz | |
==> Using the sandbox | |
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u | |
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u | |
==> /usr/local/Cellar/python/2.7.13/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/u | |
==> Caveats | |
Pip and setuptools have been installed. To update them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
import socket | |
import fcntl | |
import struct | |
app = flask.Flask(__name__) | |
# http://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python | |
def get_ip_address(ifname): |