Skip to content

Instantly share code, notes, and snippets.

@kingdonb
kingdonb / Gemfile
Last active November 5, 2022 20:56 — forked from bf4/Gemfile
Ruby Time and Timezone walkthrough
source "https://rubygems.org"
gem "rack", "~> 1.x"
gem "tzinfo"
gem "webrick"
# Source: https://gist.github.com/0c56f8b8a820198ada44123fa1bf4b60
################################################################
# How To Apply GitOps For Everything Using Crossplane And Flux #
# https://youtu.be/dunU2ABitMA #
################################################################
# Additional Info:
# - eksctl - How to Create and Manage AWS EKS clusters: https://youtu.be/pNECqaxyewQ
# - Flux CD v2 With GitOps Toolkit - Kubernetes Deployment And Sync Mechanism: https://youtu.be/R6OeIgb7lUI
crd = KubeDSL.custom_resource_definition do
metadata do
# name must match the spec fields below, and be in the form: <plural>.<group>
name 'dailies.fluxwebstats.fluxcd.io'
end
spec do
# group name to use for REST API: /apis/<group>/<version>
group 'fluxwebstats.fluxcd.io'
# list of versions supported by this CustomResourceDefinition
version(:v1alpha1) do
@kingdonb
kingdonb / k3d_local_git.sh
Last active May 23, 2023 21:35 — forked from fragolinux/k3d_local_git.sh
complete setup of a local k3d cluster on macos with flux enabled on local git server
#!/usr/bin/env bash
set -m # enable job control
## change your LAN ip address in the variable "PUBLICIP" before run
## run with "-d" command line switch to debug each step, script will wait for keypress to go on
## integrated mods by KingdonB in his fork: https://gist.github.com/kingdonb/dec74f3b74ffbb83b54d53d5c033e508
## added proper coredns patching via "coredns-custom" configmap
## added automatic /etc/hosts file modification if needed, sudo password will be asked in case
## added (commented out) lines to add Flux extra controllers to the setup
$ flux tree ks flux-system
Kustomization/flux-system/flux-system
├── CustomResourceDefinition/alerts.notification.toolkit.fluxcd.io
├── CustomResourceDefinition/buckets.source.toolkit.fluxcd.io
├── CustomResourceDefinition/gitrepositories.source.toolkit.fluxcd.io
├── CustomResourceDefinition/helmcharts.source.toolkit.fluxcd.io
├── CustomResourceDefinition/helmreleases.helm.toolkit.fluxcd.io
├── CustomResourceDefinition/helmrepositories.source.toolkit.fluxcd.io
├── CustomResourceDefinition/imagepolicies.image.toolkit.fluxcd.io
├── CustomResourceDefinition/imagerepositories.image.toolkit.fluxcd.io
@kingdonb
kingdonb / test_output.txt
Created February 15, 2020 20:01
ActiveRecord 6.0.2.1 with the latest composite_primary_keys gem (master), test output on Oracle 18.4.0 (XE)
Finished in 16.489541s, 11.5225 runs/s, 28.3816 assertions/s.
1) Error:
TestDelete#test_destroy_has_many_delete_all:
ActiveRecord::StatementInvalid: OCIError: ORA-00920: invalid relational operator
stmt.c:267:in oci8lib_260.bundle
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/ruby-oci8-2.2.8/lib/oci8/cursor.rb:137:in `exec'
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/activerecord-oracle_enhanced-adapter-6.0.2/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:146:in `exec_update'
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/activerecord-oracle_enhanced-adapter-6.0.2/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb:152:in `block in exec_update'
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:718:in `block (2 levels) in log'
@kingdonb
kingdonb / test_output.txt
Created February 15, 2020 19:02
ActiveRecord 5.2.4.1 with the latest composite_primary_keys gem, test output on Oracle 18.4.0 (XE)
Finished in 9.115729s, 20.8431 runs/s, 53.3144 assertions/s.
1) Error:
TestDelete#test_delete_all_with_join:
ActiveRecord::StatementInvalid: OCIError: ORA-00904: "DEPARTMENTS"."[:department_id, :location_id]": invalid identifier: DELETE FROM "DEPARTMENTS" WHERE (departments.department_id, departments.location_id) IN (SELECT departments.department_id, departments.location_id FROM "DEPARTMENTS" INNER JOIN "EMPLOYEES" ON "EMPLOYEES"."[:department_id, :location_id]" = "DEPARTMENTS"."[:department_id, :location_id]" WHERE (departments.department_id = 1) AND (departments.location_id = 1))
stmt.c:267:in oci8lib_260.bundle
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/ruby-oci8-2.2.8/lib/oci8/cursor.rb:137:in `exec'
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/activerecord-oracle_enhanced-adapter-5.2.8/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:144:in `exec_update'
/Users/kbarret8/.rvm/gems/ruby-2.2.10/gems/activerecord-oracle_enhanced-adapter-5.2.8/lib/active_record/connecti
@kingdonb
kingdonb / test_output.txt
Created February 15, 2020 19:00
ActiveRecord 5.2.3 with the latest composite_primary_keys gem, test output on Oracle 18.4.0 (XE)
Finished in 9.062635s, 20.9652 runs/s, 54.2888 assertions/s.
1) Failure:
TestAssociations#test_limitable_reflections [/Users/kbarret8/Desktop/devel/ruby/composite_primary_keys/test/test_associations.rb:336]:
Expected: [1, 1]
Actual: [3, 2]
2) Failure:
TestAssociations#test_has_one_association_primary_key_and_foreign_key_are_present [/Users/kbarret8/Desktop/devel/ruby/composite_primary_keys/test/test_associations.rb:109]:
Expected: 1
kbarret8@kbarret8-mbp:~/Desktop/devel/ruby/composite_primary_keys (compat-5-2-4)$ rake oracle:test
Warning: NLS_LANG is not set. fallback to US7ASCII.
/Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291: warning: /Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291: warning: loading in progress, circular require considered harmful - /Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/activerecord-5.2.4.1/lib/active_record/relation/predicate_builder/association_query_value.rb
from /Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/rake_test_loader.rb:5:in `<main>'
from /Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/rake_test_loader.rb:5:in `select'
from /Users/kbarret8/.rvm/gems/ruby-2.6.5/gems/rake-13.0.1/lib/rake/rake_test_loader.rb:17:in `block in <main>'
from /Users/kbarret8/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /U