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 / vim-html.log
Created January 19, 2017 22:47
There's an error when writing an HTML file.
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)
@todd-dsm
todd-dsm / gist:0f90b4dbd1c3e8a2ab64ddc90dae55b2
Created January 30, 2017 19:53
python2 and python3 install
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
@todd-dsm
todd-dsm / app.py
Created March 20, 2017 21:36 — forked from nZac/app.py
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):
@todd-dsm
todd-dsm / sftp_upload.sh
Created April 15, 2017 18:42
sftp sftp non-interactive PUT/upload file
sftp username@host -b <<EOF
put filename
EOF
#!/usr/bin/env bash
###----------------------------------------------------------------------------
### VARIABLES
###----------------------------------------------------------------------------
declare myServers=('typeX' 'typeY')
declare netInternal='10.240.0'
let 'machineCount = 3'
let 'dTens = 1'
@todd-dsm
todd-dsm / byteme.sh
Created July 12, 2017 01:22
byteMe
#------------------------------------------------------------------------------
# PUPOSE: Function: Divides by 2^10 until < 1024 and then append metric suffix
# AUTHOR: Joe Negron - LOGIC Wizards ~ NYC
# LICENSE: BuyMe-a-Drinkware: Dual BSD or GPL (pick one)
# USAGE: byteMe (bytes)
# ABSTRACT: Converts a numeric parameter to a human readable format.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
@todd-dsm
todd-dsm / asdf
Created July 15, 2017 22:58
dfadsf
$ cat values.yaml
replicaCount: 1
image:
repository: neo4j
tag: enterprise
pullPolicy: Always
ingress:
annotations: {
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "ssl",
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443,7687",
@todd-dsm
todd-dsm / debian.json
Created July 31, 2017 18:16
packer snippet / ansible provisioner credentials
# During the first run, the default debian account is used; with that my account is created.
# During the second run, the attempt is made with my account but it fails.
{
"provisioners": [
{
"type": "ansible",
"user": "admin",
"playbook_file": "scripts/configure.yml",
"extra_arguments": [ "-v" ],
@todd-dsm
todd-dsm / tf_aws_vpc_dhcp_options
Created September 2, 2017 21:02
just pushed/tagged this but I can't pull it with `tf get` from source in line 6
# -----------------------------------------------------------------------------
# NETWORK SERVICES: DHCP
# FIX: modularize: https://github.com/todd-dsm/tf_aws_vpc_dhcp_options
# -----------------------------------------------------------------------------
resource "aws_vpc_dhcp_options" "dev" {
source = "github.com/todd-dsm/tf_aws_vpc_dhcp_options?ref=v0.1"
domain_name = "dev.ptest.us"
domain_name_servers = ["205.251.194.141"]
ntp_servers = ["104.154.189.119"]
@todd-dsm
todd-dsm / ansible.cfg
Created October 4, 2017 21:44
ansible config
egrep -v '^(#|$)' ~/.ansible/ansible.cfg
[defaults]
inventory = $HOME/.ansible/hosts
roles_path = $HOME/.ansible/roles
host_key_checking = False
retry_files_enabled = False
[privilege_escalation]
[paramiko_connection]
[ssh_connection]
control_path = %(directory)s/ansible-ssh-%%C