Skip to content

Instantly share code, notes, and snippets.

View jamesiarmes's full-sized avatar

James Armes (they/them) jamesiarmes

View GitHub Profile
@jamesiarmes
jamesiarmes / Gemfile
Last active November 3, 2023 20:46
Connection test for ruby to Informix
# frozen_string_literal: true
source 'https://rubygems.org'
# Required for ruby 3.2 to add a method alias that was removed.
gem 'file_exists', '~> 0.2'
# IBM database drive: https://github.com/ibmdb/ruby-ibmdb
gem 'ibm_db', '~> 5.4'
# Database library.
gem 'sequel', '~> 5.74'
@jamesiarmes
jamesiarmes / ControlTowerIAM.yml
Created July 6, 2023 18:13
AWS Control Tower execution role for existing accounts
Description: Create permissions required for AWS Control Tower
Parameters:
ManagementAccountID:
Type: String
Default: ''
Description: Id of the management account for the AWS organization
Resources:
AWSControlTowerExecution:

Keybase proof

I hereby claim:

  • I am jamesiarmes on github.
  • I am jamesiarmes (https://keybase.io/jamesiarmes) on keybase.
  • I have a public key ASBj-YcpR6NtedxatcxsgvEy8ZzuxemPC0UHYAnPwY_pbgo

To claim this, I am signing this object:

@jamesiarmes
jamesiarmes / RequireSelfManagedMFA.yml
Created July 15, 2022 20:48
CloudFormation template to create a group and policy that will require users to configure an MFA device.
Description: Require MFA for user access.
Resources:
MFAPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
ManagedPolicyName: RequireSelfManagedMFA
PolicyDocument:
Version: '2012-10-17'
Statement:
require 'openssl'
require 'pp'
def create_pair
rsa_key = OpenSSL::PKey::RSA.new(2048)
{
public: rsa_key.public_key,
private: rsa_key.to_s,
}
diff --git a/lib/travis/client/entity.rb b/lib/travis/client/entity.rb
index d374e98..e7ee939 100644
--- a/lib/travis/client/entity.rb
+++ b/lib/travis/client/entity.rb
@@ -169,7 +169,12 @@ module Travis
end
def relations
- self.class.relations.map { |r| public_send(r) }.flatten(1)
+ relations = self.class.relations.map { |r| public_send(r) }