Skip to content

Instantly share code, notes, and snippets.

View tfluehmann's full-sized avatar
💭
😎

Tobias Flühmann tfluehmann

💭
😎
View GitHub Profile
@tfluehmann
tfluehmann / post-install.sh
Created July 7, 2023 14:06
post-install.sh Hetzner (dropbear initramfs)
#!/bin/bash
add_rfc3442_hook() {
cat << EOF > /etc/initramfs-tools/hooks/add-rfc3442-dhclient-hook
#!/bin/sh
PREREQ=""
prereqs()
@tfluehmann
tfluehmann / reschedule jobs
Last active June 22, 2016 06:23
reschedule sidekiq cron jobs
scheduled_jobs = YAML.load_file('schedule.yml')
existing_jobs = Sidekiq::Cron::Job.all
existing_jobs.delete_if{|job| !job.name.downcase.match(/^my_pattern\_/)}
existing_jobs.each do |job|
queue = job.instance_variable_get(:@queue)
new_hash = {class: job.klass, cron: job.cron, description: job.description, args: job.args, status: job.status, queue: queue}
scheduled_jobs[job.name] = new_hash
end
Sidekiq::Cron::Job.load_from_hash!(scheduled_jobs )