Skip to content

Instantly share code, notes, and snippets.

View duksis's full-sized avatar
🇪🇺
I definitely will be slow to respond.

Hugo Duksis duksis

🇪🇺
I definitely will be slow to respond.
View GitHub Profile
@duksis
duksis / neighbor_search.py
Last active July 23, 2023 14:40
Script to find running web servers in local network
#!/usr/bin/env python
#########################################################################
# #
# Script for finding neighbor web servers in local network #
# #
# Author: Hugo Duksis <[email protected]> #
# Usage: python neighbor_search.py
# TODO: move pinging in multiple treads to increase performance #
# #
@duksis
duksis / delayed_job.rake
Created February 21, 2012 08:08
Monitor delayed_job processes.
namespace :jobs do
#bundle exec rake delayed_job:monit RAILS_ENV=demo
desc "Monitor delayed_job processes."
task :monit => :environment do
@server_name = `uname -n`.split("\n").first
@application_name = Rails.application.class.parent_name
delayed_job_found = Hash.new
def do_alert(msg)
@duksis
duksis / ext.rb
Created February 15, 2012 21:26
Capistrano receipt configure logrotate
namespace :deploy do
desc "Configure logrotate"
task :logrotate, :roles => :install do
config_file = "/etc/logrotate.d/app_#{rails_env}"
config_lines = ["daily",
"rotate 10",
"missingok",
"nocompress",
"sharedscripts",