Skip to content

Instantly share code, notes, and snippets.

View vfreex's full-sized avatar

Yuxiang Zhu vfreex

View GitHub Profile
@vfreex
vfreex / shield-kodi-exit-only.redacted.log
Created June 23, 2026 04:35
Redacted logcat for Kodi Shield normal menu exit crash
--------- beginning of main
06-23 12:30:48.617 W/adbd (25638): timed out while waiting for FUNCTIONFS_BIND, trying again
06-23 12:30:48.617 I/adbd (25638): UsbFfs: connection terminated: monitor thread finished
06-23 12:30:48.617 I/adbd (25638): UsbFfs: already offline
06-23 12:30:48.617 I/adbd (25638): destroying transport UsbFfs
06-23 12:30:48.617 I/adbd (25638): UsbFfsConnection being destroyed
06-23 12:30:48.651 I/adbd (25638): opening control endpoint /dev/usb-ffs/adb/ep0
06-23 12:30:48.652 I/adbd (25638): UsbFfsConnection constructed
06-23 12:30:48.652 I/adbd (25638): UsbFfs-monitor thread spawned
06-23 12:30:48.760 D/NetworkMonitor/104( 3713): PROBE_FALLBACK http://www.google.com/gen_204 Probe failed with exception java.net.SocketTimeoutException: failed to connect to www.google.com/2001::1 (port 80) from /<PUBLIC_IPV6> (port 36072) after 10000ms
@vfreex
vfreex / shield-kodi-exit-relaunch.redacted.log
Created June 23, 2026 04:07
Redacted logcat for Kodi Shield exit/relaunch crash
--------- beginning of main
06-23 11:50:06.521 W/adbd (25638): timed out while waiting for FUNCTIONFS_BIND, trying again
06-23 11:50:06.521 I/adbd (25638): UsbFfs: connection terminated: monitor thread finished
06-23 11:50:06.521 I/adbd (25638): UsbFfs: already offline
06-23 11:50:06.521 I/adbd (25638): destroying transport UsbFfs
06-23 11:50:06.521 I/adbd (25638): UsbFfsConnection being destroyed
06-23 11:50:06.555 I/adbd (25638): opening control endpoint /dev/usb-ffs/adb/ep0
06-23 11:50:06.556 I/adbd (25638): UsbFfsConnection constructed
06-23 11:50:06.556 I/adbd (25638): UsbFfs-monitor thread spawned
06-23 11:50:06.576 V/hdcp up ( 3396): tsec_version: 1
import asyncio
import sys
from pathlib import Path
from ruamel.yaml import YAML
from sqlalchemy import create_engine, text, Table, MetaData, select, Column, String, DateTime
yaml = YAML(typ="rt")
yaml.preserve_quotes = True
@vfreex
vfreex / redis_lock_with_auto_extend.py
Created September 13, 2023 11:44
redis_lock_with_auto_extend.py
import asyncio
import os
import redis.asyncio as redis
from redis.asyncio.lock import Lock
from redis.asyncio.retry import Retry
from redis.backoff import ExponentialBackoff
async def long_running_task():
# install dependencies with `pip install requests requests-gssapi`
import requests
from requests_gssapi import HTTPSPNEGOAuth
def main():
non_paginated_url = "https://errata.devel.redhat.com/api/v1/cve_package_exclusion?filter[errata_id]=103179&page[size]=600&page[number]=1"
resp = requests.get(non_paginated_url, auth=HTTPSPNEGOAuth(), verify=False)
resp.raise_for_status()
non_paginated_result = resp.json()
@vfreex
vfreex / fetch-artifacts-url.yaml
Last active May 6, 2022 08:56
Test fetch-artifacts-url.yaml
- sha256: e84fb1481f603a0512be9bd2e1c181433fe17dfff5942769b4aed417c6502f62
url: http://download.eng.bos.redhat.com/rcm-guest/puddles/RHAOS/plashets/4.11/art3171/4.11-202203121512.p%3f-embargoed/plashet.yml
target: test-plashet.yml
@vfreex
vfreex / README.md
Last active July 31, 2021 02:56
Disable multicast snooping on ASUS router
  1. Add a script /jffs/my-startup.sh:
#!/bin/sh
# Copyright (C) 2021 Yuxiang Zhu <me@yux.im>

# Disable multicast snooping on br0
cru a br0-no-mcast-snooping "* * * * * /bin/sh -c '/bin/echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping'"
import asyncio
from os import wait
import re
from io import StringIO
import sys
from typing import Dict, List, Optional, TextIO
import aiohttp
import koji
from datetime import datetime, timedelta
@vfreex
vfreex / attach-security-bugs.sh
Created April 27, 2020 07:05
attach-security-bugs.sh
#!/bin/bash
TRACKER=$1
if [ -z "$TRACKER" ]; then
echo "Usage: $0 TRACKER_BUG_ID"
exit 1
fi
echo "Finding flaw bugs for tracker $TRACKER..."
@vfreex
vfreex / nftables.conf
Created April 2, 2020 17:16
netfilter flow offload example
table inet flowoffload {
flowtable f {
hook ingress priority 0
devices = { eno1, eno2, ens1f0, ens1f1, virbr0, virbr-cube-kvm }
}
chain flowoffload {
type filter hook forward priority 0; policy accept;
ip protocol { tcp, udp } flow offload @f
ip6 nexthdr { tcp, udp } flow offload @f