Skip to content

Instantly share code, notes, and snippets.

View carlwgeorge's full-sized avatar

Carl George carlwgeorge

View GitHub Profile
- hosts: all
vars:
user: carl
uid: 1000
become: true
tasks:
- name: install syncthing
package:
name: syncthing
@carlwgeorge
carlwgeorge / gnome.yml
Last active March 14, 2024 22:16
ansible playbook for my gnome setup
# https://docs.ansible.com/ansible/latest/modules/dconf_module.html
#
# To determine what dconf keys and values to use, you can run `dconf watch /`
# in a terminal as you make changes in settings or tweaks. You can also use
# `dconf read <key>` and `dconf write <key> <value>` to experiment with various
# settings. The dconf-editor application is also useful for exploring various
# keys along with their descriptions.
- hosts: localhost
tasks:

How I switched from mdadm to btrfs

After reading [this Ars Technica article][1], I decided that I wanted to start using btrfs on my home fileserver. It had been running for a few years with an mdadm raid-10 array, formatted with ext4, holding about 3.4 TB of data. I figured I would take advantage of some of the special capabilities of btrfs to perform the conversion in place. After some research, I formed my basic plan.

  • backup data to external drives
  • remove two of the drives from the mdadm raid-10
  • configure those two drive with a btrfs raid-0 filesystem
  • copy the data from the degraded mdadm raid-10 to the new btrfs raid-0
  • completely deactivate the mdadm raid-10
#!/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 \

Debian Kernel Hooks

Recently I setup my work laptop to dual boot Arch Linux and Ubuntu server with syslinux as my bootloader. I setup the laptop with a dedicated /boot partition that would be shared between the two operating systems. I added this boot entry to /boot/syslinux/syslinux.cfg.

LABEL ubuntu
    MENU LABEL Ubuntu 
    LINUX ../vmlinuz-3.8.0-29-generic
    APPEND root=LABEL=UBUNTU rw

INITRD ../initrd.img-3.8.0-29-generic

@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
#!/usr/bin/bash
set -ue
name=$(basename $0)
utils_dir='/home/carl/sync/containers/utils'
if [[ "$name" == "run-image" ]]; then
echo "Don't run this directly, symlink it as the name you want to run."
exit 1