This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| from llama_index.core import SummaryIndex | |
| from llama_index.readers.mongodb import SimpleMongoReader | |
| from langchain_community.llms import HuggingFaceEndpoint | |
| import os | |
| os.environ["HUGGINGFACEHUB_API_TOKEN"] = {HUGGINGFACE_API_TOKEN} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| from flask import Flask, request | |
| import requests | |
| import json | |
| import os | |
| JIRA_WEBHOOK_ID = os.getenv("JIRA_WEBHOOK_ID") | |
| JIRA_WEBHOOK = f"https://issues.redhat.com/rest/cb-automation/latest/hooks/{JIRA_WEBHOOK_ID}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/env python | |
| import yaml | |
| def prompt_user(config): | |
| for key in config.keys(): | |
| if isinstance(config[key], dict): | |
| config[key] = prompt_user(config[key]) | |
| else: | |
| # Convert the key into a human-friendly format | |
| prompt = ' '.join(word.capitalize() for word in key.split('_')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from grafanalib.core import ( | |
| Dashboard, Graph, | |
| OPS_FORMAT, Row, | |
| single_y_axis, Target | |
| ) | |
| dashboard = Dashboard( | |
| title="Python generated dashboard", | |
| rows=[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo dnf remove -y python3-badfish | |
| rm -rf /home/grafuls/rpmbuild/RPMS/noarch/python3-badfish-1.0.2* | |
| make clean && make srpm | |
| rpmbuild --rebuild $(ls /home/grafuls/Sources/badfish-mine/rpm/python3-badfish-1.0.2-git*) | |
| sudo dnf -y install $(ls /home/grafuls/rpmbuild/RPMS/noarch/python3-badfish-1.0.2-git*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zlib | |
| import struct | |
| PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n" | |
| class Png: | |
| def __init__(self, file): | |
| self.file = file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import asyncio | |
| from datetime import date, datetime | |
| from quads.config import conf | |
| from quads.model import Cloud, CloudHistory, Schedule | |
| from quads.tools.jira import Jira | |
| async def main(loop): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import asyncio | |
| from datetime import date, datetime, timedelta | |
| from quads.config import conf | |
| from quads.model import Cloud, CloudHistory, Schedule | |
| from quads.tools.jira import Jira | |
| async def main(loop): | |
| jira = Jira( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import asyncio | |
| from datetime import date, datetime | |
| from quads.config import conf | |
| from quads.model import Cloud, CloudHistory, Schedule | |
| from quads.tools.jira import Jira | |
| async def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| from pysnmp import hlapi | |
| from pysnmp.smi import builder | |
| from pyasn1.type.univ import OctetString | |
| from pysnmp.proto.rfc1902 import OctetString, IpAddress | |
| def get(target, oids, credentials, port, engine, context): | |
| udp_target = hlapi.UdpTransportTarget((target, port)) | |
| object_types = construct_object_types(oids) | |
| handler = hlapi.getCmd(engine, credentials, udp_target, context, *object_types) |