This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| ## | |
| # Backup Generated: nightly_s3_db | |
| # Once configured, you can run the backup with the following command: | |
| # | |
| # $ backup perform -t nightly_s3_db [-c <path_to_configuration_file>] | |
| # $ backup perform -t nightly_s3_db -c ./config.rb --root_path '/db/backups' | |
| # | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| pid = ARGV[0] | |
| puts "watching and waiting for pid #{pid} to complete" | |
| while `ps --no-headers #{pid}`.size > 0 | |
| puts "pid lives, waiting" | |
| sleep 10 | |
| # try again | |
| end | |
| # do something now, notify,etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Sidekiq | |
| class Info | |
| class << self | |
| def queue_names | |
| Sidekiq.redis {|conn| | |
| conn.smembers('queues').sort | |
| } | |
| end | |
| def queue_counts | |
| queue_status = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a user with Login | |
| sql = [%(CREATE ROLE jsmith WITH PASSWORD 'foobar' LOGIN)] | |
| # # Allow to connect | |
| sql << %(GRANT CONNECT ON DATABASE reports TO jsmith) | |
| # # Allow to use schema | |
| sql << %(GRANT USAGE ON SCHEMA public TO jsmith) | |
| # # grant on current objects | |
| sql << %(GRANT SELECT ON ALL TABLES IN SCHEMA public TO jsmith) | |
| # # grant on future objects | |
| sql << %(ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO jsmith) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conn = Sidekiq.redis {|conn| c = conn} | |
| conn.get 'stat:processed' | |
| conn.set 'stat:failed', 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This needs to be in tmux.conf | |
| # Should always be last to allow for overrides | |
| # source-file ~/.tmux.conf.local | |
| # Start numbering at 1 | |
| set -g pane-base-index 1 | |
| set -g base-index 1 | |
| ## C-b is not acceptable -- Vim uses it | |
| set-option -g prefix C-a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -g default-terminal "screen-256color" | |
| setw -g xterm-keys on | |
| set -g status-bg white | |
| set -g status-fg black | |
| set -g history-limit 999999999 | |
| bind C-d detach | |
| bind r source-file ~/.tmux.conf | |
| set -g prefix C-z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Add this to ~/.vimrc.after | |
| " should always be last here | |
| "if filereadable(expand('~/.vimrc.local')) | |
| "source ~/.vimrc.local | |
| "endif | |
| let g:NERDTreeMapOpenSplit = 'i' | |
| set nu | |
| set et | |
| set ts=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'yaml' | |
| class SSOConfig | |
| class << self | |
| attr_accessor :config | |
| def method_missing(method_name) | |
| config[method_name.to_s] | |
| end | |
| end | |
| end | |
| SSOConfig.config = YAML.load(File.open(File.join(Rails.root,'config/signon.yml')).read)[Rails.env] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps -ef | grep sidek | grep -v grep | cut -c10-14 | grep -v tail| xargs kill -USR1 | |
| # after this you'll need to restart Sidekiq via sidekiqctl or monit,etc |