Skip to content

Instantly share code, notes, and snippets.

View psachin's full-sized avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@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 / 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 / redeploy.py
Created November 14, 2017 16:35
[WIP] Redploy stack using OpenStack client APIs
import json
import os
from keystoneauth1 import loading
from keystoneauth1 import session
from heatclient import client
loader = loading.get_plugin_loader('password')
auth = loader.load_from_options(auth_url=os.environ.get("OS_AUTH_URL"),
username=os.environ.get("OS_USERNAME"),
password=os.environ.get("OS_PASSWORD"),
@psachin
psachin / gnocchi-s3.org
Last active November 15, 2017 06:44
Gnocchi with AWS S3 backend(tested on tripleo-quickstart(PIKE))
emacs --eval "(load-theme 'manoj-dark)" /etc/gnocchi/gnocchi.conf
@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 / battery.diff
Created November 7, 2017 04:20
Making below changes battery status shows correctly
diff --git a/lisp/battery.el b/lisp/battery.el
index b1834f06ff8d..dd0b8f652426 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -58,7 +58,7 @@
((and (eq system-type 'gnu/linux)
(file-directory-p "/proc/acpi/battery"))
#'battery-linux-proc-acpi)
- ((and (eq system-type 'gnu/linux)
+ ((and (or (eq system-type 'gnu/linux) (eq system-type 'gnu))
@psachin
psachin / .Xresources
Last active October 31, 2017 07:34
My xterm configuration.
! My xterm configurations
! Copy this file or put entire setting in ~/.Xresources and run below command
! and run: xrdb -merge ~/.Xresources
xterm*faceName: DejaVu Sans Mono Book
xterm*faceSize: 14
xterm*loginShell: true
xterm*saveLines: 50000
xterm*rightScrollBar: true
xterm*ScrollBar: true
xterm*scrollTtyOutput: false