Skip to content

Instantly share code, notes, and snippets.

View kstevens715's full-sized avatar

Kyle Stevens kstevens715

View GitHub Profile
class ActiveRecordComparer
def initialize(original, new)
@original = original
@new = new
end
def method_missing(m, *arg)
puts arg
@original = @original.send(m, *arg)
@new = @new.send(m, *arg)
desc 'Determine if Resque is Alive or not'
task :liveness, [:queue_name] => [:environment] do |_task, args|
Resque.workers.select { |w| w.hostname == Socket.gethostname }.each do |worker|
begin
Process.kill(0, worker.pid)
rescue Errno::ESRCH
puts "Dead: Resque process with pid #{worker.pid} should exist, but cannot be found."
exit 1
end
module Etl
class Liveness
extend Forwardable
ProcessInfo = Struct.new(:pid, :text)
def initialize(command_runner: CommandRunner)
@command_runner = command_runner
end
# app@1290894361f7:/opt/app$ pgrep -af resq
# 461 resque-1.26.0: Waiting for etl_applicant_deferred_heavyweight
# 464 resque-1.26.0: Waiting for cas_3_gpa_deferred_heavyweight
#
# app@1290894361f7:/opt/app$ pgrep -af resq
# 461 resque-1.26.0: Forked 1698 at 1484951377
# 464 resque-1.26.0: Waiting for cas_3_gpa_deferred_heavyweight
# 1698 resque-1.26.0: Processing etl_applicant_deferred_heavyweight since 1484951377 [Etl::ApplicantJob]
#
# for each queue:
def alive
end
version: '2'
services:
msql:
image: microsoft/mssql-server-linux
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=1337Password
version: '2'
services:
etl:
build:
context: .
dockerfile: Dockerfile
command: sleep infinity
volumes:
- .:/opt/app
@kstevens715
kstevens715 / install.log
Created November 17, 2016 13:22
SQL Server on Ubuntu install error
kstevens@liaison-dell:~$ sudo apt-get install mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
class UserIdentity
def cas_attachments
sql = id_column.in(cas_attachment_belongs_to_my_cas).or(id_column.in(cas_attachment_belongs_to_my_programs))
CasAttachment.where(sql)
end
def table
CasAttachment.arel_table
end
" Installing plugins to /home/kstevens/.vim/bundle
Plugin 'gmarik/Vundle.vim'
Plugin 'Quramy/vim-js-pretty-template'
Plugin 'bling/vim-airline'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'kien/ctrlp.vim'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'mileszs/ack.vim'
Plugin 'sickill/vim-monokai'