Skip to content

Instantly share code, notes, and snippets.

View jcreed's full-sized avatar

Jeff Reed jcreed

  • Liaison International
  • Amherst NY
  • X @jcreed63
View GitHub Profile
@jcreed
jcreed / instructions
Created December 7, 2022 14:47
start resque scheduler
#start up a resque-scheduler pod from command line in wa-devenv project
monster set --namespace={eco system name}
kubectl scale --replicas=1 deployment/wa-resque-scheduler
#after entering the wa-resque-scheduler pod thru ecomaster run:
PIDFILE=./resque-scheduler.pid BACKGROUND=yes bundle exec rake environment resque:scheduler
- OR -
@jcreed
jcreed / documents test
Created October 25, 2022 19:57
test/models/documents/downloadable_document_test.rb
require "test_helper"
require "support/page_objects/webadmit_administrator"
describe Documents::DownloadableDocument do
let(:user_identity) { PageObjects::WebadmitAdministrator.new }
let(:downloader) { Documents::Downloader.name }
let(:downloadable_document) { Documents::DownloadableDocument.new(options) }
let(:filename) { "BroDawg.pdf" }
let(:md5_sum) { "f3e86ec5310eab180a8d884dd483f307" }
let(:options) do
@jcreed
jcreed / sidekiq-scheduler
Created October 12, 2022 14:16
change over to sidekiq scheduler
*** - branch https://github.com/Liaison-Intl/WebAdMIT/compare/feature/NF-53110...run-ci/feature/testing-sftp-swap
Gemfile
gem 'sidekiq-scheduler'
****
Initializer Sidekiq
unless ENV['RUNNING_ASSETS_PRECOMPILE']
# Running:
The redis deletion strategy's #url method is deprecated. It will be removed in database_cleaner-redis 2.0 in favor of #db.
.................................No route to host - connect(2) for [2607:f8b0:4006:820::2004]:22
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:1214:in `__connect_nonblock'
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:1214:in `connect_nonblock'
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:56:in `connect_internal'
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:137:in `connect'
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:642:in `block in tcp'
/Users/jeffreed/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/socket.rb:227:in `each'
@jcreed
jcreed / test run
Created October 12, 2022 12:49
rails test test/integration/schedules_test.rb
WARNING on line 548 of /Users/jeffreed/Liaison/WebAdMIT/app/assets/stylesheets/webadmit_main.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 150 of /Users/jeffreed/Liaison/WebAdMIT/app/assets/stylesheets/_tables.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 151 of /Users/jeffreed/Liaison/WebAdMIT/app/assets/stylesheets/_tables.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 178 of /Users/jeffreed/Liaison/WebAdMIT/app/assets/stylesheets/_tables.sass:
This selector doesn't have any properties and will not be rendered.
The redis deletion strategy's #url method is deprecated. It will be removed in database_cleaner-redis 2.0 in favor of #db.
......unable to sign request without credentials set
@jcreed
jcreed / run at testing
Created October 11, 2022 18:39
scheduler run_at
it '#update_run_at' do
s1 = create :schedule, wanted_run_at: '2022-01-25 17:00', run_at: '2022-01-25 17:00', schedule_option: 'monthly'
s2 = create :schedule, wanted_run_at: '2022-01-29 17:00', run_at: '2022-01-29 17:00', schedule_option: 'monthly'
s3 = create :schedule, wanted_run_at: '2022-01-30 17:00', run_at: '2022-01-30 17:00', schedule_option: 'monthly'
s4 = create :schedule, wanted_run_at: '2022-01-31 17:00', run_at: '2022-01-31 17:00', schedule_option: 'monthly'
s5 = create :schedule, wanted_run_at: '2024-01-31 17:00', run_at: '2024-01-31 17:00', schedule_option: 'monthly'
s6 = create :schedule, wanted_run_at: '2024-01-30 17:00', run_at: '2024-01-30 17:00', schedule_option: 'monthly'
s7 = create :schedule, wanted_run_at: '2024-01-29 17:00', run_at: '2024-01-29 17:00', schedule_option: 'monthly'
s8 = create :schedule, wanted_run_at: '2024-01-28 17:00', run_at: '2024-01-28 17:00', schedule_option: 'monthly'
s9 = create :schedule, wanted_run_at: '
require 'net/sftp'
require 'uri'
class SftpUploader
attr_reader :host, :username, :password, :ssh_private_key, :port, :auth_type, :root_path
def initialize(host, user, auth_type, port, password: nil, ssh_private_key: nil, root_path)
@host = host
@user = user
@port = port
@jcreed
jcreed / next run at
Created September 14, 2022 15:12
concept run_at
class ScheduleNextRunAt
MONTHS = { "30" => [1,3,4,5,6,7,8,9,10,11,12], "31" => [1,3,5,7,8,10,12] }.freeze
def initialize(date, schedule_option, advance_to_date=nil)
@date = date
@schedule_option = schedule_option
@advance_to_date = advance_to_date
end
def next_run_date
@jcreed
jcreed / gender fix
Created April 29, 2022 12:50
aamc staging
namespace :releases do
namespace 'one_offs' do
desc 'fix-genders - CASPA22: Delete test applicants from WebAdMIT - CASPA Test Organization'
task 'fix-genders': :environment do |task|
include ReleaseTaskHelpers
display :notice, task.full_comment
unless if Rails.configuration.is_aamc
GENDERS = ["MAN", "WOMAN", "OTHER"]
@jcreed
jcreed / On branch gold-regular-prelaunch-fix
Created March 3, 2022 19:35
prelaunch eco create attempt
jreed@Jeff-Reeds-MacBook-Pro wa-devenv % monster recycle --postgres-version=postgres:13.2 --cas-tag=develop --etl-tag=master --wa-field-manager-tag=master --wa-tag=release-v2022.002.000 --expire=8 --cas-reflector-tag=master --snapshot-id=gold-regular-prelaunch --namespace=cf-demo-prelaunch --owner=Jenkins-cferraraccio@liaisonedu.com --model=all
Updates are available for some Cloud SDK components. To install them,
please run:
$ gcloud components update
Updated property [compute/zone].
Updated property [core/project].
Fetching cluster endpoint and auth data.
kubeconfig entry generated for demo.