Skip to content

Instantly share code, notes, and snippets.

View kamilbednarz's full-sized avatar

Kamil Bednarz kamilbednarz

View GitHub Profile
@kamilbednarz
kamilbednarz / olive_grove.rb
Last active July 17, 2024 07:53
Olive Grove generatoin script
# EDlink Olive Grove District generation
require 'faker'
require 'digest'
# To always get the same names
Faker::Config.random = Random.new(42);
I18n::Debug.logger = Logger.new('/dev/null')
def fake_guid(key)
hash = Digest::SHA1.hexdigest(key)
@kamilbednarz
kamilbednarz / stop_sidekiq.sh
Created February 14, 2018 12:18
Stop sidekiq, but first wait until it finishes all the running jobs
#!/bin/bash
RETRY_FREQUENCY=5
MAX_TRIES=100
PIDFILE=/var/www/app/current/tmp/pids/sidekiq.pid
# Helper function for printing logs with timestamp
echo_time() {
date +"[%H:%M:%S] [Sidekiq-smart-restart] $*"
}