Skip to content

Instantly share code, notes, and snippets.

View psachin's full-sized avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@psachin
psachin / lbaas-tripleo-quickstart.md
Last active October 4, 2017 05:46
[WIP] LBaaS on tripleo-quickstart
export TRIPLEO_ROOT="/home/psachin/tripleo-heat-templates"
./quickstart.sh \
--config config/general_config/pacemaker-enable-telemetry.yml \
-N config/nodes/1ctlr_1comp.yml \
-E $TRIPLEO_ROOT/environments/services/neutron-lbaasv2.yaml \
--teardown all \
--tags all \
--clean \
--release ocata $VIRTHOST
@psachin
psachin / common.yaml
Last active October 3, 2017 12:24
Tripleo autoscale instance
heat_template_version: 2016-10-14
description: Common Template
resources:
flavor-cirros:
type: OS::Nova::Flavor
properties:
name: flavor-cirros
ram: 100
@psachin
psachin / .irbrc
Created August 9, 2017 13:00
CMFE/ManageQI rails console
# limit output size in IRB console.
class IRB::Context
attr_accessor :max_output_size
alias initialize_before_max_output_size initialize
def initialize(*args)
initialize_before_max_output_size(*args)
@max_output_size = IRB.conf[:MAX_OUTPUT_SIZE] || 300
end
end
@psachin
psachin / hosts
Created August 3, 2017 08:07
Ansible host inventory(/etc/ansible/hosts) for OCP-3.5 installation. This also includes vars to enable hawkular metrics
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
# - Comments begin with the '#' character
# - Blank lines are ignored
# - Groups of hosts are delimited by [header] elements
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups
@psachin
psachin / review-484254.diff
Created July 17, 2017 09:03
review-484254.diff
diff --git a/api-ref/source/storage-account-services.inc b/api-ref/source/storage-account-services.inc
index b3c19b765c44..37800bc2d36f 100644
--- a/api-ref/source/storage-account-services.inc
+++ b/api-ref/source/storage-account-services.inc
@@ -65,9 +65,11 @@ codes:
``limit``, or ``end_marker`` query parameter and you have reached
the end of the list.
+Response code:
@psachin
psachin / do_file_sub.py
Last active July 4, 2017 13:55
sos/sos/plugins:do_file_sub
import codecs
import re
result, replacement = re.subn(r"^(auth_url[\t\ ]*=[\t\ ]*)(.+)", r"\1****", "auth_url = http://localhost.com:5000/")
print(result, replacement)
with codecs.open("/etc/aodh/aodh.conf", "r", encoding='utf-8') as infile:
for line in infile:
result, replacement = re.subn(r"(^auth_url[\t\ ]*=[\t\ ]*)(.+)", r"\1****", line)
if replacement:
@psachin
psachin / test_event.py.diff
Created June 29, 2017 16:27
aodh/tests/unit/test_event.py
diff --git a/aodh/tests/unit/test_event.py b/aodh/tests/unit/test_event.py
index 2a85b97..0a7d6bb 100644
--- a/aodh/tests/unit/test_event.py
+++ b/aodh/tests/unit/test_event.py
@@ -51,8 +51,32 @@ class TestEventAlarmEvaluationService(tests_base.BaseTestCase):
'traits': ['foo', 'bar'],
'message_id': '20d03d17-4aba-4900-a179-dba1281a3452',
'generated': '2016-04-23T06:50:23.622739'}
+ unicodeevent = {u'event_type': u'compute.instance.power_off.end',
+ u'traits': [[u'user_id', 1, u'89b4e48bcbdb4816add7800502bd5122'],
@psachin
psachin / ceilo-gnocchi-aodh-notes.txt
Last active March 7, 2019 19:46
ceilo-gnocchi-aodh-notes
Gnocchi Archive policies
=========================
1. Capture data every 1 minute for 1 day
[heat-admin@overcloud-controller-2 ~]$ gnocchi archive-policy create 1min1day -d granularity:1m,timespan:1d
+---------------------+----------------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------------+
| aggregation_methods | std, count, 95pct, min, max, sum, median, mean |
| back_window | 0 |
@psachin
psachin / recent_git_commands.md
Last active June 3, 2018 08:43
Recent git commands
  • Show changes in stash
    git stash show -p stash@{0}
    
  • Save stash with message
    git stash save "MESSAGE"
    
  • Authetication GitHub using 2FA(two-factor authentication)
  • create a file ~/.git-credentials with following content
@psachin
psachin / 478402.diff
Last active June 28, 2017 09:29
Review 478402
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 9f5ff87..47719bf 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -44,8 +44,10 @@ sys.path.extend([os.path.abspath('../swift'), os.path.abspath('..'),
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
- 'sphinx.ext.todo', 'sphinx.ext.coverage',
- 'sphinx.ext.ifconfig', 'openstackdocstheme']