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 __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import shutil | |
import ansible.constants as C | |
from ansible.executor.task_queue_manager import TaskQueueManager | |
from ansible.module_utils.common.collections import ImmutableDict | |
from ansible.inventory.manager import InventoryManager | |
from ansible.parsing.dataloader import DataLoader |
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 -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm | |
sudo dnf -y install https://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm | |
sudo dnf -y install dnf-utils hexchat git git-extras git-review tig make cmake gimp flatpak kernel-devel google-chrome-stable tlp tlp-rdw htop vlc gpaste gnome-shell-extension-gpaste dnf-plugin-system-upgrade zlib.i686 ncurses-libs.i686 bzip2-libs.i686 icedtea-web screen exfat-utils fuse-exfat rpmdevtools gparted krb5-workstation albert powerline powerline-fonts fedora-workstation-repositories sshuttle podman VirtualBox tmate python3-black pulseaudio-libs-devel ca-certificates python3-devel | |
sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin | |
sudo dnf groupupdate sound-and-video | |
sudo yum-config-manager --add-repo |
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) |
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 | |
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(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
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
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
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
#! /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('_')) |