Skip to content

Instantly share code, notes, and snippets.

locals {
vpc_cidr = "172.31.0.0/16"
region = "us-east-1"
azs = ["a", "b", "c"]
subnets = {
"private" = {
all = 2,
az = 2,
},
"public" = {
Ex9QQs3iqWtest
@mhorbul
mhorbul / reading-log.js
Last active June 7, 2018 03:04
Fill in Reading Log on parentstudentportal.com
Array.from(document.getElementsByClassName('lpform')).forEach(function(f) {
f.select('input[type=TEXT]').each(function(e) {
e.value = 'AH'
});
var submit = f.select('input[type=SUBMIT]');
submit.find(function(e) { return e.name == 'action[save]' }).click();
setTimeout(function() { submit.find(function(e) { return e.name == 'action[print]' }).click() }, 3000)
})

Keybase proof

I hereby claim:

  • I am mhorbul on github.
  • I am mhorbul (https://keybase.io/mhorbul) on keybase.
  • I have a public key ASCGpBTeY1v2RLvpa2wBIhW4kmRlJ8Dr9KsO2RbZSBoLrQo

To claim this, I am signing this object:

Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `tv_sec' for #<Array:0x4791d607>
at LogStash::Event.sprintf(file:/opt/logstash/logstash.jar!/logstash/event.rb:226)
at org.jruby.RubyString.gsub(org/jruby/RubyString.java:3062)
at LogStash::Event.sprintf(file:/opt/logstash/logstash.jar!/logstash/event.rb:212)
at LogStash::Outputs::ElasticSearch.receive(file:/opt/logstash/logstash.jar!/logstash/outputs/elasticsearch.rb:153)
at RUBY.worker_setup(file:/opt/logstash/logstash.jar!/logstash/outputs/base.rb:65)
class NodeExec < Chef::Knife
banner "knife node exec NODE CODE (options)"
deps do
require 'chef/search/query'
end
def run
if name_args.size == 2
node_name = name_args.first
@mhorbul
mhorbul / cookbooks.sh
Created March 13, 2012 22:46 — forked from dysinger/cookbooks.sh
Re-write Opscode Cookbooks as individual Git repos
#!/bin/bash
for cookbook in $(find * -type d -maxdepth 0); do
git clone ./ ../${cookbook}
cd ../${cookbook}
git remote rm origin
git filter-branch --subdirectory-filter ${cookbook} -- --all
git gc --aggressive
done
@mhorbul
mhorbul / middleware.rb
Created November 15, 2011 20:35 — forked from skippy/middleware.rb
delete vagrant vm's chef client and node from chef server on destroy
class OnDestroyMiddleware
def initialize(app, env)
@app = app
end
def call(env)
env["config"].vm.provisioners.each do |provisioner|
next unless provisioner.config.class.name.match(/::ChefClient/)
env.ui.info "Attempting to remove client #{provisioner.config.node_name}"
`knife client show #{provisioner.config.node_name}`
class A
def foo
raise "error from old"
end
end
require 'forwardable'
class A
def foo(*args)
puts "from A; #{args.inspect}"
end
end