Skip to content

Instantly share code, notes, and snippets.

View gasinvein's full-sized avatar

Sergei von Alis gasinvein

  • Tel Aviv, Israel
View GitHub Profile
@gasinvein
gasinvein / flatpak-cleanup-local-repo.py
Last active November 16, 2021 16:21
Remove all refs from a local flatpak repository, except installed ones
#!/usr/bin/env python3
import argparse
import logging
import subprocess
import typing as t
import gi
gi.require_version('GLib', '2.0')
gi.require_version('Gio', '2.0')
@gasinvein
gasinvein / flatpak-remote-metadata.py
Last active March 27, 2021 13:41
Retrieves all apps metadata from flathub and prints it as json array
#!/usr/bin/env python3
import json
import sys
import re
import gi
gi.require_version("GLib", "2.0")
gi.require_version("Flatpak", "1.0")
@gasinvein
gasinvein / flathub_stats.py
Last active April 24, 2020 11:59
Retrieve download counts per day for given apps on Flathub and saves it to CSV
#!/usr/bin/python3
from urllib import request
from urllib.error import HTTPError
import json
import csv
import datetime
import os
import argparse
import logging
@gasinvein
gasinvein / container_desktop_args.py
Last active March 10, 2020 17:51
This script generates arguments for a container system (e.g. Podman) to run GUI apps within a container.
#!/usr/bin/python3 -u
import os
import subprocess
import glob
import re
import pwd
GUEST_GL_DIR = "/run/host/gl"
GUEST_XAUTHORITY = "/run/host/Xauthority"
#! /usr/bin/env python3
'''
Register a mDNS/DNS-SD alias name for your computer using the Avahi daemon
This script will register an alternate CNAME alias besides your hostname,
which could be useful for ex. when serving several http virtual hosts to
your ffriends on the local network and you don't want to make them configure
their /etc/hosts.
Why a CNAME? You could also publish your current address with avahi-publish-address
@gasinvein
gasinvein / create-osx-iso.sh
Last active July 12, 2018 09:35 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash -e
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
SOURCE_APP="$1"
DEST_IMAGE="$2"
if ! [ -d "$SOURCE_APP" ]; then