Skip to content

Instantly share code, notes, and snippets.

View myersCody's full-sized avatar

Cody Myers myersCody

  • RedHat
  • Durham, NC
View GitHub Profile
---
- name: Testing yum module difference
hosts: localhost
tasks:
- name: Test if yum list can tell if a package is installed (ansible)
yum:
list: ansible
register: have_ansible_raw
become: true

Bash locale warning:

The initial issue was brought on by a packaging change in glibc, all of the locales no longer come with the common package because the total locales added up to be 108 MB of space in the default container. Now each local is installed independently, for example our server requires the en_us locale which is provided by the glibc-langpack-en.

[root@rhel8 discovery-server-container]# podman exec -it discovery-server /bin/bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
import itertools
import requests
import json
def index_swap(string, start, current_idx):
for i in range(start, current_idx):
if string[i] == string[current_idx]:
return 0
return 1
@myersCody
myersCody / KOKU_Endpoints.md
Last active July 7, 2020 19:05
List of all the koku endpoints for quick clicking
import ciso8601
import pytz
from dateutil import parser
from datetime import datetime
start_date = "20200701"
end_date = "20200731"
ciso_start_date = start_date.replace(" +0000 UTC", "+0000")
ciso_end_date = end_date.replace(" +0000 UTC", "+0000")
@myersCody
myersCody / qe_aws_org_tree.yml
Created July 13, 2020 18:51
yml file for Luke
---
account_structure:
days:
- day:
date: -90
nodes:
- organizational_unit:
org_unit_id: 'R_001'
org_unit_name: 'Root'
- organizational_unit:
@myersCody
myersCody / openshift_on_prem_cost_model.json
Created August 26, 2020 17:07
openshift cost model with multiple rates for each cost type
{
"name": "Cost Management OpenShift Cost Model",
"description": "A cost model of on-premises OpenShift clusters.",
"source_type": "OCP",
"source_uuids": ["PROVIDER_UUID"],
"rates": [{
"metric": {"name": "cpu_core_usage_per_hour"},
"tiered_rates": [{
"unit": "USD",
"value": 0.0010000000,
{
"meta": {
"count": 10,
"cost_type": "unblended_cost",
"compute_count": false,
"check_tags": false,
"group_by": {
"tag:app": [
"*"
]