Skip to content

Instantly share code, notes, and snippets.

View carlwgeorge's full-sized avatar

Carl George carlwgeorge

View GitHub Profile
@carlwgeorge
carlwgeorge / repocount.sh
Created September 24, 2024 19:55
script to count the number of packages in a yum repo
#!/usr/bin/bash
set -eou pipefail
# TODO: loop multiple
if [[ $# -ne 1 ]]; then
echo "usage: $(basename $0) <baseurl>"
exit 1
fi
--- zlib-ng.spec 2024-08-28 16:10:30.713794292 -0500
+++ zlib-ng-epel.spec 2024-08-28 16:14:33.850601166 -0500
@@ -1,4 +1,3 @@
-%bcond_without compat
%bcond_without sanitizers
# Be explicit about the soname in order to avoid unintentional changes.
@@ -7,23 +6,17 @@
# A change proposal is needed:
# https://docs.fedoraproject.org/en-US/program_management/changes_policy/
@carlwgeorge
carlwgeorge / removed-in-c10.py
Created August 22, 2024 22:48
list packages that were in CentOS 9 that are not in CentOS 10
#!/usr/bin/python3
import json
from urllib.request import urlopen
def get_pkgs(compose_url):
rpms_url = compose_url + 'compose/metadata/rpms.json'
with urlopen(rpms_url) as response:
data = json.loads(response.read())
#!/usr/bin/python3
import repomd
def count(name, rpms_repo_url, srpms_repo_url):
rpm_count = len(repomd.load(rpms_repo_url))
srpm_count = len(repomd.load(srpms_repo_url))
print(f'{name}: {rpm_count:7,} RPMs {srpm_count:6,} SRPMs')
#!/usr/bin/python3
import repomd
def count(baseurl):
r = repomd.load(baseurl)
print(f'{len(r)} - {baseurl}')
@carlwgeorge
carlwgeorge / pandoc-container-build.sh
Created May 9, 2022 16:52
buildah script to create pandoc cli container
#!/usr/bin/bash
set -eu
buildah unshare << EOF
set -eu
ctr=\$(buildah from scratch)
mnt=\$(buildah mount \$ctr)
dnf \
--releasever 35 \
--disablerepo '*' \
--enablerepo fedora,updates \
@carlwgeorge
carlwgeorge / real-epel-vs-oracle-epel.py
Created November 23, 2021 17:43
script to compare the real EPEL repositories to Oracle's EPEL repositories
#!/usr/bin/python3
import repomd
epol7_repo = repomd.load('https://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/x86_64/')
epel7_repo = repomd.load('https://dl.fedoraproject.org/pub/epel/7/x86_64/')
epol8_repo = repomd.load('https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/x86_64/')
epel8_repo = repomd.load('https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/')
epel7_names = {p.name for p in epel7_repo if not p.arch == 'src'}
#!/usr/bin/python3
import asyncio
import pathlib
import textwrap
import bs4
import httpx
import rfc3986
- hosts: all
vars:
user: carl
uid: 1000
become: true
tasks:
- name: install syncthing
package:
name: syncthing
#!/usr/bin/python
import click
import koji
import koji_cli.lib
import rpm
TAG='dist-c8-stream'