Skip to content

Instantly share code, notes, and snippets.

View cben's full-sized avatar

Beni Cherniavsky-Paskin cben

View GitHub Profile
@cben
cben / 0.README.md
Created April 18, 2018 15:59
ansible test/sanity/validate-modules/main.py spurious E324 with suboptions

ansible-test sanity --test validate-modules manageiq_dynamic_resource_definition

doc dict is:

{'author': 'Ahmed Bashir (@ahmbas)',
 'description': ['The manageiq_dynamic_resource_definition module supports adding, updating and deleting dynamic resource definitions in ManageIQ.'],
 'module': 'manageiq_dynamic_resource_definition',
 'options': {u'manageiq_connection': {u'description': [u'ManageIQ connection configuration information.'],
@cben
cben / README.md
Last active April 11, 2018 13:57
svg>switch>foreignObject>img fallback in email

From what I read known SVG->PNG fallbacks don't work well in email:
http://stylecampaign.com/blog/2014/01/basics-of-svg-in-email/
http://emailcodegeek.com/svg-images/
http://mikevoermans.com/css/svg-png-fallback-html-email

But then I stumbled upon this 2009 technique: http://www.kaizou.org/2009/03/inline-svg-fallback/ and it works surprisingly well!

Caveat: apparently it only works when the svg contains no text; any text content might be visible (in addition to the fallback) in clients that don't understand svg.

@cben
cben / README.md
Last active April 11, 2018 13:50
testing mathml->image fallback in email

Test mail1.html

Tested 2 fallback ways inside semantics tag:

  1. <annotation-xml encoding="MathML-Presentation"><mtext><img ... (the math was display="block")
  2. <annotation-xml encoding="text/html"><img ... (the math was inline)

Didn't try altimg fallbacks, nor <annotation encoding="image/png" src=...> as I figure it's unlikely any clients that don't understand MathML would honor them. img can be honored simply by skipping all the unfamiliar tags.

I tried to use xmlns in a way that (hopefully) would work both in HTML5 and older parsers...

$ ag 'def scan' -w . plugins/*
app/models/vm_or_template/scanning.rb
5: def scan(userid = "system", options = {})
app/models/ems_cluster.rb
212: def scan
app/models/storage.rb
366: def scan(userid = "system", _role = "ems_operations")
~/miq/PLU/manageiq-providers-ovirt ((811201b3…)|…) $ bundle exec rake
Randomized with seed 62429
WARNING: Use of `have_attributes` with array access (:[]) is deprecated and will be removed shortly.
If you're matching attributes in hashes, use appropriate hash matchers instead (`include`, `eq`).
Called from /home/bpaskinc/miq/PLUGINS/manageiq-providers-ovirt/spec/models/manageiq/providers/redhat/infra_manager/event_catcher/runner_spec.rb:17:in `block (4 levels) in <top (required)>'
.
WARNING: Use of `have_attributes` with array access (:[]) is deprecated and will be removed shortly.
If you're matching attributes in hashes, use appropriate hash matchers instead (`include`, `eq`).
@cben
cben / gist:077f9d0c5dbfec31377ca66286bc5212
Created February 6, 2018 13:21
tests error: undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x0055d15468c998>
~/miq/master (kubeclient-2.5|…) $ bundle exec rspec ./spec/models/vmdb_database_spec.rb ./spec/models/vmdb_database_connection_spec.rb
Randomized with seed 745
...The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
...........The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
.....F.The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
..............F
@cben
cben / 1.refresh-graph-main.svg
Last active January 18, 2018 15:31
Diagrams used in 2018-01-17 inventory team talk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cben
cben / 0.results.markdown
Last active November 27, 2017 10:49
benchmarking manageiq tag mapping approaches for openshift

Info "owned" by a specific container

[2] pry(main)> c = Container.first
=> #<ManageIQ::Providers::Kubernetes::ContainerManager::Container:0x0055cd589010e8
 id: 1,
 ems_ref:
  "95b9aa14-7186-11e7-8ac6-001a4a162683_mongodb_centos/mongodb-32-centos7@sha256:02685168dd84c9119f8ab635078eec8697442fba93a7b342095e03b31aa8c5dd",
 restart_count: 4,
 state: "running",
gem 'benchmark-ips'