Skip to content

Instantly share code, notes, and snippets.

require 'ipaddr'
ips = %w{192.168.0.1 2001:0db8:85a3:0000:0000:8a2e:0370:7334 10.0.0.256}
ips.each do |ip|
begin
ip_obj = IPAddr.new(ip)
puts "#{ip}....OK"
rescue IPAddr::InvalidAddressError => e
puts "#{ip}....FAILED (#{e.message})"
module Delayed
module Heartbeat
class WorkerModel < ActiveRecord::Base
self.table_name = 'delayed_workers'
attr_accessible :name, :last_heartbeat_at
before_create do |model|
model.last_heartbeat_at ||= Time.now.utc
end

The process starts by creating the CSR and the private key:

openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"

Generates

  • dotmarks.net.key
  • dotmarks.net.csr
# switch default editor for pry to sublime text
Pry.config.editor = "sublime"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
module Announcement
OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
module_label 'announcement.announcement'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'admin.announcement'
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"