Skip to content

Instantly share code, notes, and snippets.

View Twilight0's full-sized avatar
🏠
Working from home

Paradigm Shifter Twilight0

🏠
Working from home
View GitHub Profile
@romanvm
romanvm / multi_select.py
Last active March 22, 2020 19:13
The example of a multi-select dialog in a Kodi addon created with PyXBMCt framework
# The example of a multi-select dialog in a Kodi addon created with PyXBMCt framework.
# You will need a checkmark image file.
import os
import xbmcgui
import xbmcaddon
import pyxbmct.addonwindow as pyxbmct
_addon = xbmcaddon.Addon()
_path = _addon.getAddonInfo("path")
_check_icon = os.path.join(_path, "check.png") # Don't decode _path to utf-8!!!
@brikeats
brikeats / wxpython_template.py
Last active August 21, 2022 09:53
Skeleton simple GUI application in wxpython
import wx
APP_EXIT = 1
FILE_SAVE = 2
FILE_OPEN = 3
SHOW_HELP = 4
SHOW_ABOUT = 5
class Example(wx.Frame):
@jkent
jkent / rpcclient.py
Last active August 15, 2022 21:05
Simple python RPC server/client
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set ts=4 et
import json
import socket
class RpcException(Exception):
pass
@hamidzr
hamidzr / playYoutube.sh
Last active July 19, 2022 19:33
Play youtube videos from commandline to kodi / xbmc.
#!/bin/bash
REGEX="^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*"
ID=$1
if [ "$ID" == "" ];
then
echo "Syntax $0 <id|url>"
exit
fi
@scottopell
scottopell / setup_hc2.markdown
Last active February 24, 2020 08:03
Setup torrent + media server on Orange Pi HC2

Orange pi HC2 setup

This is my 3rd iteration of this guide, and now it appears that armbian officially supports the orange pi pc2!

Goals

  • rtorrent
  • plex
  • flood (or similar rtorrent web interface)
  • support external usb3 hd with exfat
@Pulimet
Pulimet / AdbCommands
Last active July 23, 2024 18:05
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@gasman
gasman / encode.py
Created October 25, 2020 12:23
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@lmmx
lmmx / nosnap.pref
Created February 2, 2021 09:23
Contents of `/etc/apt/preferences.d/nosnap.pref` in Linux Mint 20.1 (removed manually to install `snapd`) https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html
# To prevent repository packages from triggering the installation of Snap,
# this file forbids snapd from being installed by APT.
# For more information: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html
Package: snapd
Pin: release a=*
Pin-Priority: -10