Skip to content

Instantly share code, notes, and snippets.

View psachin's full-sized avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@psachin
psachin / demo_dro.rb
Last active January 27, 2018 16:54
Demo DRO
irb(main):024:0> dro_class = $evm.vmdb(:generic_object_definition).find_by(:name => "demo_dro")
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
=> #<MiqAeServiceGenericObjectDefinition:0x1b5f38c @object=#<GenericObjectDefinition id: 6, name: "demo_dro", description: "Used for enablement", properties: {:attributes=>{"name"=>:string, "is_tired"=>:boolean, "created"=>:datetime, "retirement"=>:datetime}, :associations=>{}, :methods=>["kick", "laugh_at", "punch", "buy_a_drink"]}, created_at: "2017-12-04 19:57:17", updated_at: "2017-12-06 16:43:42">, @virtual_columns=["generic_objects_count", "href_slug", "region_description", "
@psachin
psachin / LearnDRO.rb
Created January 27, 2018 16:08
Learning ManageIQ's DROs
[root@localhost vmdb]# rails c
Loading production environment (Rails 5.0.6)
irb(main):001:0> $evm=MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
=> #<MiqAeMethodService::MiqAeService:0x0000000b647188 @drb_server_references=[], @inputs={}, @workspace=#<MiqAeEngine::MiqAeWorkspaceRuntime:0x0000000b6473b8 @readonly=false, @nodes=[], @current=[], @datastore_cache={}, @class_methods={}, @dom_search=#<MiqAeEngine::MiqAeDomainSearch:0x0000000b6472c8 @fqns_id_cache={}, @fqns_id_class_cache={}, @partial_ns=[], @prepend_namespace=nil>, @persist_state_hash={}, @current_state_info={}, @state_machine_objects=[], @ae_user=nil, @rbac=false>, @persist_state_hash={}, @logger=#<Vmdb::Loggers::MulticastLogger:0x000000039a3aa0 @loggers=#<Set: {#<VMDBLogger:0x000000039a3cf8 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x000000039a3c58 @datetime_format=nil>, @formatter=#<VMDBLogger::Formatter:0x000000039a3b40 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x000000039a3c08 @shift
@psachin
psachin / cfme-rh-sso.yml
Created January 8, 2018 10:09 — forked from jairojunior/cfme-rh-sso.yml
Playbook to configure CFME login with RH-SSO
---
- hosts: all
become: yes
become_user: root
vars:
appliance_file_name: "https_{{ appliance_name }}"
tasks:
- name: SAML configuration dir
@psachin
psachin / ip-slink
Created January 5, 2018 09:47
ip -s link output
@psachin
psachin / miq-all-about-db.org
Last active December 28, 2017 04:49
Miq DB notes

Environment having 2 standby(1 on same region, other in cross region)

vmdb
rails db

select * from repl_nodes;
  id  |  type   | upstream_node_id |        cluster        |     name     |                      conninfo                      |    slot_name     | priority | active
------+---------+------------------+-----------------------+--------------+----------------------------------------------------+------------------+----------+--------
 3003 | standby |             3002 | miq_region_30_cluster | 10.222.73.24 | host=10.222.71.24 user=root dbname=vmdb_production | repmgr_slot_3003 |      100 | t
 3002 | master  |                  | miq_region_30_cluster | 10.222.73.31 | host=10.222.71.31 user=root dbname=vmdb_production | repmgr_slot_3002 |      100 | t
@psachin
psachin / wrk_mem.sh
Last active December 27, 2017 08:04
Check workers with exceeded memory on Red Hat CloudForms
# Author: Niladri Roy <niroy@redhat.com>
# Usage:
# 1) without specifing evm.log file
# curl -s https://gist.githubusercontent.com/psachin/36c7e4ff04bdd0a07a64065d0c477eaf/raw | bash -
# 2) specify file name
# curl -s https://gist.githubusercontent.com/psachin/36c7e4ff04bdd0a07a64065d0c477eaf/raw | bash -s evm.log-20171103
if [ -z $1 ];
then
EVM="evm.log"
@psachin
psachin / hotspotd.rules
Created December 11, 2017 17:21
iptables rules for hotspotd
# Generated by iptables-save v1.4.20 on Mon Dec 11 21:02:07 2017
# To restore: iptables-restore < hotspotd.rules
*nat
:PREROUTING ACCEPT [373:31754]
:INPUT ACCEPT [96:7870]
:OUTPUT ACCEPT [107:7914]
:POSTROUTING ACCEPT [5:1080]
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
# Completed on Mon Dec 11 21:02:07 2017
@psachin
psachin / 3ctrl_3comp_3swift.yml
Last active December 5, 2017 08:59
tripleo-quickstart: Dedicated swift nodes
# Path: tripleo-quickstart/config/nodes/
# Deploy a big HA OpenStack environment(NON-CONTAINERIZED)
# Total memory: (8192 * 9) + 12288 = 86016
control_memory: 8192
compute_memory: 8192
objectstorage_memory: 8192
undercloud_memory: 12288
@psachin
psachin / tripleo-quickstart.org
Last active November 30, 2017 10:19
Notes from tripleo-quickstart bootcamp session

ooo-quickstart

All in one(single physical node deployment)

adduser NON-ROOT-USER -G wheel
passwd NON-ROOT-USER

# login as NON-ROOT-USER
ssh-keygen
export VIRTHOST=127.0.0.2
ssh-copy-id root@$VIRTHOST
@psachin
psachin / gnocchi-s3.org
Last active November 15, 2017 06:44
Gnocchi with AWS S3 backend(tested on tripleo-quickstart(PIKE))