Skip to content

Instantly share code, notes, and snippets.

View luckylittle's full-sized avatar
:octocat:
Working for @RedHatOfficial

Lucian Maly luckylittle

:octocat:
Working for @RedHatOfficial
View GitHub Profile
@luckylittle
luckylittle / check_etcd.sh
Created February 22, 2021 01:32 — forked from pichuang/check_etcd.sh
Check etcd status on OCP 4.6.1
#!/bin/bash
# Ref: https://docs.openshift.com/container-platform/4.6/backup_and_restore/backing-up-etcd.html
etcd_node=`oc get pods -n openshift-etcd -l app=etcd -o=jsonpath='{.items[0].spec.nodeName}'`
ssh -i ~/.ssh/dmz-ocp4-rsa core@$etcd_node
id=$(sudo crictl ps --name etcdctl | awk 'FNR==2{ print $1}') && sudo crictl exec -it $id /bin/bash
etcdctl member list -w table
etcdctl endpoint health --cluster
@luckylittle
luckylittle / changelog.sh
Last active August 14, 2019 06:24 — forked from kingkool68/changelog.sh
Bash script to generate a markdown change log of GitHub pull requests between tagged releases
#!/bin/bash
# Generate a Markdown change log of pull requests from commits between two tags
# Author: Russell Heimlich
# Original URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a
# Modified for Atlassian Stash and older Git version by author: Lucian Maly <lucian@redhat.com>
# URL: https://gist.github.com/luckylittle/7e7192743514d08989a6fc0cdbd93e61
# HOW TO USE
# Copy this script to a directory under Git version control
# Make the script executable i.e. chmod +x changelog.sh
@luckylittle
luckylittle / converter.py
Created October 26, 2017 09:17 — forked from kj187/converter.py
Converting a CloudFormation Template from JSON to YAML
#!/usr/bin/env python
## Converting a CloudFormation Template from JSON to YAML
## Script copyright: http://blog.flux7.com/how-to-convert-a-cloudformation-template-from-json-to-yaml
##
## Example:
## $ python converter.py --json my-stack.template --yaml my-stack.yaml
import yaml
import json
@luckylittle
luckylittle / cloudformation-yaml-to-json.py
Created October 26, 2017 09:15 — forked from kesor/cloudformation-yaml-to-json.py
Convert CloudFormation YAML format to JSON format
#!/usr/bin/env python
import sys, yaml, json
def funcparse(loader, node):
node.value = {
yaml.constructor.ScalarNode: loader.construct_scalar,
yaml.constructor.SequenceNode: loader.construct_sequence,
yaml.constructor.MappingNode: loader.construct_mapping,
}[type(node)](node)
node.tag = node.tag.replace(u'!Ref', 'Ref').replace(u'!', u'Fn::')