Skip to content

Instantly share code, notes, and snippets.

View lcarva's full-sized avatar

Luiz Carvalho lcarva

  • Red Hat, Inc.
  • Eastern US
View GitHub Profile
@lcarva
lcarva / kubectl-new-env
Last active October 31, 2022 20:13
Easily create a new temporary kubeconfig
#!/bin/bash
# Create a new temporary kubeconfig file and display a command to
# configure the current shell to use the new kubeconfig file.
# This is helpful if you interact with multiple OpenShift clusters
# at the same time.
#
# Usage:
# $(kubectl-new-env)
set -euo pipefail
@lcarva
lcarva / jira_issue_url_handler.py
Created August 27, 2019 12:50
Terminator plugin to turn JIRA issue identifiers into a link
from terminatorlib import config, plugin
AVAILABLE = ['JiraIssueURLHandler']
DEFAULT_JIRA_URL = 'https://jira.atlassian.com/browse'
DEFAULT_MATCH = '[A-Z0-9]{3,}-[0-9]{3,}'
class JiraIssueURLHandler(plugin.URLHandler):
capabilities = ['url_handler']
handler_name = 'jira_issue'
@lcarva
lcarva / registry_usage.py
Last active January 29, 2018 18:59
Compute storage used by container images per OpenShift project
#!/bin/env python
from __future__ import print_function
from collections import Counter
import os.path
import subprocess
import json