Skip to content

Instantly share code, notes, and snippets.

View etdsoft's full-sized avatar

Daniel Martin etdsoft

View GitHub Profile
@etdsoft
etdsoft / mount_luks.sh
Created October 9, 2013 08:39
Mounting the Dradis Pro LUKS encrypted volume after the appliance has started
# as root or via sudo
cryptsetup luksOpen /dev/dradispro/data data-open
mount /dev/mapper/data-open /mnt/data
@etdsoft
etdsoft / convert.rb
Created November 1, 2013 23:01
CSV to Textile table
require 'csv'
if ARGV.count != 1
puts "Usage:\n\t#{$0} <file.csv>"
exit 1
end
file = ARGV.first
if !File.exist?(file)
@etdsoft
etdsoft / fail2ban_notifier.rb
Last active March 3, 2023 18:21
Simple Fail2banNotifier for exception_notification (will submit a pull request and update gist when accepted).See: https://dradisframework.com/academy/knowledge-base/ruby/ruby-on-rails/protect-rails-application-with-fail2ban.html
class Fail2banNotifier
def initialize(options)
@default_options = options
@default_options[:logfile] ||= Rails.root.join('log', 'fail2ban.log')
# Roll over every 30M, keep 10 files
@logger ||= Logger.new(@default_options[:logfile], 10, 30*1024*1024)
end
def call(exception, options={})