Skip to content

Instantly share code, notes, and snippets.

View cben's full-sized avatar

Beni Cherniavsky-Paskin cben

View GitHub Profile
@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'
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
[{:ems_ref=>
"f07093d7-ba34-11e7-8aa5-001a4a16260b_kibana_openshift3/logging-kibana:v3.6",
:name=>"kibana",
:image=>"openshift3/logging-kibana:v3.6",
:image_pull_policy=>"Always",
:command=>nil,
:memory=>nil,
:cpu_cores=>0.0,
:capabilities_add=>"",
:capabilities_drop=>"KILL,MKNOD,SETGID,SETUID,SYS_CHROOT",
@cben
cben / rake-test.txt
Last active October 16, 2017 08:38
requires by all tests vs monitoring_manager_spec.rb (https://github.com/ManageIQ/manageiq-providers-kubernetes/issues/131)
> bundle exec rake
require(*["/home/bpaskinc/miq/grafresh/plugins/manageiq-providers-kubernetes/spec/spec_helper"])
require(*["/home/bpaskinc/miq/grafresh/app/models/container_group"])
require(*["/home/bpaskinc/miq/grafresh/app/models/mixins/tenant_identity_mixin"])
require(*["/home/bpaskinc/miq/grafresh/app/models/mixins/archived_mixin"])
require(*["/home/bpaskinc/miq/grafresh/app/models/container_group/purging"])
require(*["/home/bpaskinc/miq/grafresh/app/models/mixins/purging_mixin"])
require(*["/home/bpaskinc/miq/grafresh/app/models/custom_attribute"])
require(*["/home/bpaskinc/miq/grafresh/app/models/container_condition"])
@cben
cben / fragments-from-init.el
Created October 1, 2017 09:12
emacs more CUA
;; use on top of cua-mode.
;; Extreme CUA - kill buffers with C-w like browser tabs.
;; I still have motor memory for cutting with C-w :-(, hopefully this will help.
(defun kill-buffer-unless-selection ()
(interactive)
(if (region-active-p)
(progn
(beep)
(message "Use C-x for cutting, lest you kill the buffer you're working on."))
@cben
cben / 1.regenerate secret token.patch
Last active September 24, 2017 16:32
Running manageiq from user's database dump
diff --git a/app/models/miq_database.rb b/app/models/miq_database.rb
index 2d5d51041e..4ad616df54 100644
--- a/app/models/miq_database.rb
+++ b/app/models/miq_database.rb
@@ -52,8 +52,8 @@ class MiqDatabase < ApplicationRecord
def self.seed
db = first || new
- db.session_secret_token ||= SecureRandom.hex(64)
- db.csrf_secret_token ||= SecureRandom.hex(64)
@cben
cben / evm.log-grepped-by-pid
Last active September 13, 2017 19:00
working EventCatcher log
[----] I, [2017-09-13T14:46:29.403981 #20812:66f7c6d0dc] INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher.close_pg_sockets_inherited_from_parent) Closing socket: 24
[----] I, [2017-09-13T14:46:29.631900 #20812:66f7c6d0dc] INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner#sync_config) ID [48], PID [20812], GUID [daa6df64-98b3-11e7-9f6f-02427af19f47], Zone [default], Active Roles [automate,database_operations,database_owner,ems_inventory,ems_operations,event,reporting,scheduler,smartstate,user_interface,web_services,websocket], Assigned Roles [automate,database_operations,database_owner,ems_inventory,ems_operations,event,reporting,scheduler,smartstate,user_interface,web_services,websocket], Configuration:
[----] I, [2017-09-13T14:46:29.632363 #20812:66f7c6d0dc] INFO -- : :count: 1
[----] I, [2017-09-13T14:46:29.632404 #20812:66f7c6d0dc] INFO -- : :gc_interval: 900
[----] I, [2017-09-13T14:46:29.632431 #20812:66f7c6d0dc] INFO -- : :heartbe