Skip to content

Instantly share code, notes, and snippets.

View calh's full-sized avatar

Cal Heldenbrand calh

  • FBS
  • Fargo, ND
View GitHub Profile
@calh
calh / port_passwords.sh
Last active January 5, 2023 16:48
Port mysql 4.x and 5.x passwords to 8.0
#!/bin/bash
# This script will port old mysql 5.5 passwords to
# something remotely workable with mysql 8.x.
#
# If we find OLD mysql 4.x password hashes, I'll
# ask to find and set in a new password format. If
# the password you entered doesn't match the old hash,
# it repeats and lets you retry a different password.
#
# Run me with something like
@calh
calh / rds-top.sh
Last active June 16, 2022 13:59 — forked from sherwind/rds-top.sh
Get AWS RDS Enhanced Monitoring statistics from CloudWatch and show something similar to Linux top command
#!/bin/bash
# rds-top.sh
# by <cal@fbsdata.com>, 20220616
# * Changed some --start-time syntax
# * Added --profile and --region
# * Made nicer numbers for memory/swap
# * Fixed disk IO output to only show devices with real data
# by <sherwin@daganato.com>, 20190822
# based on the work of Matheus de Oliveira <matioli.matheus@gmail.com>
#
@calh
calh / gist:5e8052cd195664d39a286e7bbd15c8af
Created March 18, 2019 20:29
test/functional/consumer_controller_test.rb test_edit_account_with_missing_portal_slug
[DEBUG] [Ticket] Loaded config file statsd into PID 29463
[DEBUG] [Ticket] Loaded config file memcached into PID 29463
[DEBUG] [Ticket] New MC connection to ["authdb.fbsdata.com:11211", "authdb.fbsdata.com:11212", "authdb.fbsdata.com:11213"]
[DEBUG] [Ticket] Loaded config file mysql into PID 29463
[DEBUG] [Ticket] New master mysql connection to zoidberg.fbsdata.com in PID 29463
[DEBUG] [Ticket] Loaded config file prefs into PID 29463
[DEBUG] [Ticket] Loaded config file mysql_auth into PID 29463
[DEBUG] [Ticket] Loaded config file cookies into PID 29463
[DEBUG] [Ticket] New slave mysql connection to zoidberg.fbsdata.com in PID 29463
@calh
calh / gist:a8fe37049f21908d0690ebdc73cfcfb8
Created March 18, 2019 20:28
test/functional/consumer_controller_test.rb test_edit_account_with_Voucher
[DEBUG] [Ticket] New slave mysql connection to zoidberg.fbsdata.com in PID 29094
[DEBUG] MOPED: 192.168.74.21:27018 COMMAND database=admin command={:ismaster=>1} (10.4039ms)
[DEBUG] MOPED: 192.168.74.21:27018 COMMAND database=twilio_cal command={:drop=>"sms_message"} (0.6475ms)
[DEBUG] MOPED: 192.168.74.21:27018 COMMAND database=twilio_cal command={:drop=>"voice_call"} (0.5147ms)
[DEBUG] MOPED: 192.168.74.21:27018 INSERT database=twilio_cal collection=system.indexes documents=[{:ns=>"twilio_cal.sms_message", :key=>{:date_sent=>1}, :name=>"date_sent_1"}] flags=[] (0.1259ms)
[DEBUG] MOPED: 192.168.74.21:27018 INSERT database=twilio_cal collection=system.indexes documents=[{:ns=>"twilio_cal.sms_message", :key=>{:to=>1}, :name=>"to_1"}] flags=[] (0.0813ms)
[DEBUG] MOPED: 192.168.74.21:27018 INSERT database=twilio_cal collection=system.indexes documents=[{:ns=>"twilio_cal.voice_call", :key=>{:start_time=>1}, :name=>"start_time_1"}] flags=[] (0.0660ms)
[DEBUG] MOPED: 1
@calh
calh / gist:ecd243d7e2ed458c6b522bc5e35bc0f9
Last active March 18, 2019 20:23
prod-merge build fails
Loaded suite /home/cal/ticket_auth/vendor/bundle/ruby/2.3.0/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
...................................................................................................
Finished in 37.427476079 seconds.
-------------------------------------------------------------------------------------------------------------------------
99 tests, 252 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
-------------------------------------------------------------------------------------------------------------------------
2.65 tests/s, 6.73 assertions/s
@calh
calh / therubyracer2
Created November 20, 2014 14:35
therubyracer rubyjs/libv8#156 running individual specs with segfaults
Manually running each individual spec file, showing the results:
[therubyracer (master)]$ for i in `find ./spec -name \*_spec.rb` ; do cmd="bundle exec ruby -S rspec $i --tag ~memory --tag ~threads " ; echo $cmd ; $cmd ; done
bundle exec ruby -S rspec ./spec/v8/object_spec.rb --tag ~memory --tag ~threads
Run options: exclude {:memory=>true, :threads=>true}
..
Finished in 0.00391 seconds
2 examples, 0 failures
@calh
calh / therubyracer1
Last active August 29, 2015 14:10
therubyracer rubyjs/libv8#156 spec segfault
[therubyracer (master)]$ bundle exec rake spec
/home/cal/.rvm/rubies/ruby-1.9.3-p545/bin/ruby -S rspec ./spec/c/array_spec.rb ./spec/c/constants_spec.rb ./spec/c/exception_spec.rb ./spec/c/external_spec.rb ./spec/c/function_spec.rb ./spec/c/handles_spec.rb ./spec/c/locker_spec.rb ./spec/c/object_spec.rb ./spec/c/script_spec.rb ./spec/c/string_spec.rb ./spec/c/template_spec.rb ./spec/c/trycatch_spec.rb ./spec/mem/blunt_spec.rb ./spec/redjs_spec.rb ./spec/threading_spec.rb ./spec/v8/context_spec.rb ./spec/v8/conversion_spec.rb ./spec/v8/error_spec.rb ./spec/v8/function_spec.rb ./spec/v8/object_spec.rb --tag ~memory --tag ~threads
Run options: exclude {:memory=>true, :threads=>true}
/home/cal/gems/therubyracer/spec/c/array_spec.rb:5: [BUG] Segmentation fault
ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0023 p:---- s:0095 b:0095 l:000094 d:000094 CFUNC :New
c:0022 p:0019 s:0092 b:0092 l:001418 d:000091 BLOCK /home/cal/g