Skip to content

Instantly share code, notes, and snippets.

@antonxy
antonxy / download_jellyfin_stream.py
Created December 30, 2021 13:42
Download stream from jellyfin. Useful for downloading a video with reduced bitrate on slow internet connections.
import requests
import argparse
import re
parser = argparse.ArgumentParser(description="Download stream from jellyfin. Useful for downloading a video with reduced bitrate on slow internet connections.")
parser.add_argument('-a', '--append', action="store_true", help="Append to existing stream file. Can be used for resuming download.")
parser.add_argument('-s', '--start', type=int, default=0, help="First chunk to download")
parser.add_argument('url', help="Stream url. Get this from the developer tools network tab while watching stream with the intended bitrate and audio channel. Should look like https://.../hls1/main/123.ts?...")
parser.add_argument('output', help="Output filename")
args = parser.parse_args()
@antonxy
antonxy / less_addictive_youtube.txt
Last active November 7, 2025 22:42
uBlock / Adblock rules for a less addictive YouTube. Removes recommendations from homescreen and video page.
! Less addictive YouTube
! Remove homepage recommendations - use the subscriptions page instead
www.youtube.com###page-manager > .style-scope[page-subtype=home]
! Hide shorts in subscriptions
www.youtube.com##.ytd-rich-section-renderer[is-shorts=""]
! Remove related videos sidebar and endscreen
www.youtube.com###related
@antonxy
antonxy / artnet_to_eurolite.py
Created July 21, 2018 09:39
Artnet to Eurolite USB-DMX512-PRO
import sys
from socket import (socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR,
SO_BROADCAST)
from struct import pack, unpack
import time
import serial
from threading import Thread
@antonxy
antonxy / ppm_serial.ino
Created October 27, 2017 21:16
Arduino sketch to test servos or brushless motor controllers
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 15/01/15
@author: Sammy Pfeiffer
# Software License Agreement (BSD License)
#
# Copyright (c) 2016, PAL Robotics, S.L.
# All rights reserved.
@antonxy
antonxy / example.csv
Created April 26, 2015 12:35
simple script I used to learn my theatre lines
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
1;"Parris,
delighted:
Mr. Hale! Oh! it’s good to see you again!
Taking some books:
My, they’re heavy! ";d
2;"Hale,
setting down his books:
They must be; they are
weighted with authority. ";aa
1;"Parris,
@antonxy
antonxy / main.cpp
Created January 30, 2015 23:15
libfreenect opencv template
#include <stdio.h>
#include <libfreenect.h>
#include <opencv2/opencv.hpp>
#include <thread>
#include <mutex>
#define FREENECTOPENCV_RGB_WIDTH 640
#define FREENECTOPENCV_RGB_HEIGHT 480
#define FREENECTOPENCV_DEPTH_WIDTH 640
#define FREENECTOPENCV_DEPTH_HEIGHT 480
@antonxy
antonxy / pyobfuscate_directory
Created September 14, 2014 15:49
pyobfuscate whole directory
import os
import shutil
import subprocess
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('indir')
args = parser.parse_args()