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 / wa6877
Last active October 3, 2023 20:40
wa 6877 base task
namespace :after_party do
desc 'Deployment task: unassign_applicants'
task :wa_6877, [:group] => [:environment] do |_task, args|
next if args[:group] != 'before_load' # available before_migrate|before_load|after_load
include ReleaseTaskHelpers
puts "Running deploy task 'wa_6877'"
# if Rails.env.production?
display :info, "wa_6877 Starting task..."
@jcreed
jcreed / master branch
Created July 12, 2023 13:40
ruby upgrade issue
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Welcome to namespace 'wa-only'
/home/app/bundle/ruby/3.2.0/gems/whenever-0.9.7/lib/whenever/cron.rb:48: [BUG] Segmentation fault at 0x000055e1595921c0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0038 p:---- s:0197 e:000196 CFUNC :===
c:0037 p:0026 s:0192 e:000190 METHOD /home/app/bundle/ruby/3.2.0/gems/whenever-0.9.7/lib/whenever/cron.rb:48
c:0036 p:0003 s:0187 e:000186 METHOD /home/app/bundle/ruby/3.2.0/gems/whenever-0.9.7/lib/whenever/cron.rb:42
@jcreed
jcreed / script to dump destination info for org users
Created April 24, 2023 16:05
Destination - Get Organization information for all users
File.open(Rails.root.join("sftp_schedule_information_#{timestamp}.csv"), 'w') do |file|
file.write(to_csv_schedule(all_info))
end
****
all_info = set_info_schedules
** load below in rails console
@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