Skip to content

Instantly share code, notes, and snippets.

View iandelahorne's full-sized avatar

Ian Delahorne iandelahorne

  • San Francisco
  • 04:43 (UTC -07:00)
View GitHub Profile
✔ ~/src/ansible [master|✚ 1…1⚑ 3]$ ./scripts/pssh i-021dc9f489f95bbfc hostname
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/ian/.ssh/config
debug1: /Users/ian/.ssh/config line 4: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Executing proxy command: exec aws ssm start-session --debug --region us-west-1 --target i-021dc9f489f95bbfc --document-name AWS-StartSSHSession --parameters 'portNumber=22'
debug1: identity file /Users/ian/.ssh/id_rsa type 0
debug1: identity file /Users/ian/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
@iandelahorne
iandelahorne / keybase.md
Last active May 30, 2018 16:14
keybase.md

Keybase proof

I hereby claim:

  • I am iandelahorne on github.
  • I am iandelahorne (https://keybase.io/iandelahorne) on keybase.
  • I have a public key ASBJoX8d6KzH6I9qXQjwULBoVkbeUwb4idDrVNm7z5TXRAo

To claim this, I am signing this object:

@iandelahorne
iandelahorne / sbin.sh
Created November 1, 2013 11:11
/etc/profile.d/sbin.sh
path_elems=(${PATH//:/ })
sbin_missing=1
usr_sbin_missing=1
usr_local_sbin_missing=1
for i in "${!path_elems[@]}" ; do
if [ "${path_elems[i]}" = /sbin ]; then sbin_missing = 0 ; fi
if [ "${path_elems[i]}" = /usr/sbin ]; then usr_sbin_missing = 0 ; fi
if [ "${path_elems[i]}" = /usr/local/sbin ]; then usr_local_sbin_missing = 0 ; fi
done
@iandelahorne
iandelahorne / s3.h
Last active December 20, 2015 22:39
#ifndef _S3_H
#define _S3_H
struct s3_string {
char *ptr;
size_t len;
};
struct s3_string * s3_string_init();
size_t s3_string_curl_writefunc(void *ptr, size_t len, size_t nmemb, struct s3_string *s);
#
# Author:: Ezra Pagel (<ezra@cpan.org>)
# License:: Apache License, Version 2.0
#
require 'chef/knife'
require 'chef/knife/BaseVsphereCommand'
# Lists all known virtual machines in the configured datacenter
class Chef::Knife::VsphereVmList < Chef::Knife::BaseVsphereCommand
@iandelahorne
iandelahorne / rename-node.rb
Created August 14, 2012 10:35 — forked from jtimberman/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# ian-note: run from your home directory. Add the following to your .chef/knife.rb:
# knife[:ssh_user] = "myusername"
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
* Basic scenario is that we want to hand out static IPs over DHCP
using hostnames provided by the clients. Ideally we could use the
hostname, but I haven't found dhcpd configuration that works, so I
used dhcp-client-identifier instead.
Our setup is:
* VMs get created in VMware by deploying from a template, which is a
base VM image. VMware has limited customization possibilities when
deploying, so it can only really set the hostname and configure
interfaces' IP address / use DHCP.
@iandelahorne
iandelahorne / vsphere_vm_listall.rb
Created March 12, 2012 10:56
knife vsphere vm listall
# Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
cookbook_file "/opt/cntw/conf/create_cntw.pgsql" do
mode "0644"
owner "root"
group "root"
source "create_cntw.pgsql"
end
#include_recipe "database"
package "cntw-plsqlmodules" do
action [:install, :upgrade]
include_recipe "postgresql_database"
postgresql_database 'test' do
connection { :host => "127.0.0.1", :port => 5432, :username => 'postgres', :password => node['postgresql']['password']['postgres'] }
action :create
provider "postgresql_database"
end