This file contains 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/python3 | |
import subprocess | |
import enum | |
class State(enum.Enum): | |
ignore = enum.auto() | |
section = enum.auto() | |
commit = enum.auto() | |
This file contains 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
app-id: org.flatpak.Hello | |
runtime: org.freedesktop.Platform | |
runtime-version: '22.08beta' | |
sdk: org.freedesktop.Sdk | |
command: true | |
modules: | |
- name: hello | |
buildsystem: simple | |
build-commands: | |
- python -mpip install . --prefix "${FLATPAK_DEST}" --ignore-installed --no-build-isolation --no-index |
This file contains 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/bash | |
source /etc/os-release | |
NEXT_VERSION=$((VERSION_ID+1)) | |
FULL_REF=fedora:fedora/${NEXT_VERSION}/x86_64/silverblue | |
echo Updating to ${FULL_REF} | |
rpm-ostree rebase ${FULL_REF} |
This file contains 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/python3 | |
import yaml | |
import sys | |
import os | |
import os.path | |
def main(filename): | |
with open(filename) as file: | |
data = yaml.load(file, Loader=yaml.CLoader) |
This file contains 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/python3 | |
import yaml | |
import sys | |
import os | |
import os.path | |
def valid(element_name): | |
return os.path.exists(f"elements/{element_name}") |
This file contains 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 python3 | |
import json | |
import subprocess | |
import sys | |
def grab_packages(): | |
process = subprocess.run([sys.executable, "-mpip", "list", "-o", | |
"--format=json"] + sys.argv[1:], | |
capture_output=True) |
This file contains 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
class Person: | |
def __init__(self, owner=None): | |
self.owner = owner | |
def __set_name__(self, _, name): | |
self.name = name | |
def __get__(self, inst, _): | |
if self.owner is None: | |
print("Binding person to world") |
This file contains 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 ruamel.yaml import YAML | |
import json | |
from pathlib import Path | |
import sys | |
from collections import OrderedDict | |
import collections | |
from ruamel.yaml.comments import CommentedMap | |
def convert(filename): | |
yaml = YAML() |
This file contains 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/sh -xe | |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
flatpak install flathub org.freedesktop.Platform/i386 org.freedesktop.Sdk/i386 | |
if [ ! -d com.valvesoftware.Steam ] | |
git clone git://github.com/flathub/com.valvesoftware.Steam | |
fi | |
( | |
cd com.valvesoftware.Steam | |
git pull | |
flatpak-builder --repo=$HOME/flatpak-builds --disable-cache --force-clean --arch=i386 com.valvesoftware.Steam com.valvesoftware.Steam.json |
This file contains 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 suds.transport import Transport, Reply | |
from suds.client import Client | |
import requests | |
from StringIO import StringIO | |
class RequestsTransport(Transport): | |
def open(self, request): | |
""" suds assumes urllib2 which doesn't have keepalives so things can go royally wrong if it doesn't | |
read the entire request. Hence, read it all up and give a StringIO object instead. |