Skip to content

Instantly share code, notes, and snippets.

View todd-dsm's full-sized avatar
🏗️
Just trying stuff...

Todd Thomas todd-dsm

🏗️
Just trying stuff...
  • smpl-cloud
  • SoCal
View GitHub Profile
@todd-dsm
todd-dsm / packer-template-collision
Created August 2, 2016 15:12
build crashes on name collision with another (public) AMI also called 'template'
$ packer build ami-rhel-7.2-x86_64.json
amazon-ebs output will be in this color.
==> amazon-ebs: Force Deregister flag found, skipping prevalidating AMI Name
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Creating temporary keypair: packer 57a0b035-02ff-447f-d366-41b5b93c3369
==> amazon-ebs: Launching a source AWS instance...
amazon-ebs: Instance ID: i-080cd371343b6baea
==> amazon-ebs: Waiting for instance (i-080cd371343b6baea) to become ready...
==> amazon-ebs: Waiting for SSH to become available...
@todd-dsm
todd-dsm / Vagrantfile
Created September 14, 2016 15:46
packer-ansible-vagrant-issue
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
---
#!/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}"
@todd-dsm
todd-dsm / anonymous smb.conf
Last active September 15, 2022 18:09
nobody should be using this but here's an anon samba fileshare
# Samba 4 Anonymous Read-Only File Server
# URL: https://wiki.samba.org/index.php/Setting_up_a_Samba_Standalone_Server
# Server role: ROLE_STANDALONE
# ---------------------------- Browser Control ----------------------------- #
[global]
workgroup = YO
netbios name = YO-SERVER
server string = Samba %v
name resolve order = wins, bcast
socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=32768 SO_RCVBUF=32768
@todd-dsm
todd-dsm / packer "Segmentation fault" CentOS 7.2
Created October 27, 2016 15:04
packer gets a "Segmentation fault" CentOS 7.2 when headless
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
==> 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’
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"
@todd-dsm
todd-dsm / debian-jessie-bin-sh
Created November 10, 2016 16:27
Why do scripts execute against dash when $SHELL=/bin/bash ?
#!/usr/bin/env bash
sleep 2
set -eux
###----------------------------------------------------------------------------
### VARIABLES
###----------------------------------------------------------------------------
export DEBIAN_FRONTEND=noninteractive
vagrantHome='/home/vagrant'
backupDir="$vagrantHome/backup"
@todd-dsm
todd-dsm / main.tf
Last active January 16, 2017 19:49
# ------------------------------------------------------------------------------
# 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
# ------------------------------------------------------------------------------
@todd-dsm
todd-dsm / git-submodule-untracked-content
Created January 17, 2017 14:51
how to solve the "untracked content" / "modified content" message?
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .gitmodules
modified: vim/after/ftplugin/json.vim
new file: vim/bundle/Dockerfile
new file: vim/bundle/ansible-vim