Skip to content

Instantly share code, notes, and snippets.

{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS template for a dev AEM full stack (author, publish, mongoDB)",
"Parameters" : {
<%= snippet 'instance_typical_parameters', single_subnet: true %>,
<%= snippet 'aem_instance', section: 'parameters', type: 'author' %>,
set groups knuedge-default-applications applications application knu-ftp application-protocol ftp
set groups knuedge-default-applications applications application knu-ftp protocol tcp
set groups knuedge-default-applications applications application knu-ftp destination-port 21
set groups knuedge-default-applications applications application knu-tftp application-protocol tftp
set groups knuedge-default-applications applications application knu-tftp protocol udp
set groups knuedge-default-applications applications application knu-tftp destination-port 69
set groups knuedge-default-applications applications application knu-rtsp application-protocol rtsp
set groups knuedge-default-applications applications application knu-rtsp protocol tcp
set groups knuedge-default-applications applications application knu-rtsp destination-port 554
set groups knuedge-default-applications applications application knu-netbios-session protocol tcp
@jgnagy
jgnagy / spf.rb
Last active June 15, 2016 22:21
A sloppy shortest-path-first example
#!/usr/bin/env ruby
class Connection
include Comparable
attr_reader :node
attr_accessor :metric
def initialize(node, metric)
@node = node
@metric = metric
@jgnagy
jgnagy / rabbitmq.json
Created June 21, 2016 16:10
example rabbitmq.json
{
"rabbitmq": {
"port": 5671,
"host": "sensu-rabbitmq-elb.domain.tld",
"user": "sensumq",
"password": "SomeSecretP4ssw0rd%",
"vhost": "/sensu",
"reconnect_on_error": true,
"prefetch": 1,
"ssl": {
tab_count = 0
File.readlines('/path/to/file').each do |line|
# The regexp looks for 1 or more tabs at the beginning of the line as a group.
# We then split the result by character, then get the size of the Array from the split.
# Only do all that if the line matches the regexp in the first place.
tab_count += line.match(/^([\t]+)/)[1].split('').size if line.match /^([\t]+)/
end
tenant.rb
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class Tenant
attr_reader :nickname, :occupation
attr_writer :nickname, :occupation
def initialize f_name, l_name, born_on, gender
@f_name = f_name
@l_name = l_name
@born_on = born_on
def log(message, level: :info)
message.split("\n").each { |line| logger(level, line) }
end
@jgnagy
jgnagy / wooden_puzzle.rb
Created March 15, 2022 04:54
A Puzzle Solution
class Cube
attr_accessor :sides
ALLOWED_COLORS = %i[red green yellow blue].sort.freeze
def initialize(sides)
@sides = sides
end
def rotate!