Blog

  • mdns-reflector works over WireGuard

    See instructions here, just use mdns-reflector instead of Avahi, or use Avahi.

    But trying to get Sure Universal Remote crap to find the Apple TV.

    I know mDNS is working, cause Pyatv in Termux can find it, using the wizard. And looking at the status of mdns-reflector after running the wizard, it shows the Apple TV’s IP. But I was having issues last time I tried Pyatv, I only want a keyboard. No idea if Sure Universal Remote has a keyboard, so far can’t even find the Apple TV. I was connecting probably directly to the IP before I started messing with mDNS.

    So maybe mDNS only works in Termux.

    And I can’t find an app that works to show mDNS on Android. If you try to use avahi-browse in Termux, well you probably need to disable the built in mDNS crap, and then run avahi-daemon. Too much work.

    I was able to cancel the subscription for the inFuse Pro app for the Apple TV from a web browser. So perhaps I’ll just stop using the Apple TV. Just use AtariVCS instead. I can get an app that has a remote keyboard for it most likely, and that probably lets you connect using the IP instead of mDNS.

    You have to do something to get mDNS working over isolated VLANs.

    Another good reason to not use the Apple TV.

    Hmm, maybe my Apple TV isn’t supported, or wants an IPv6 address. I set mdns-reflector to IPv4 only. Can’t connect the Apple TV to a VPN directly, and I’m too lazy to assign some static IPv6 address to the Apple TV. I already poked a hole for the Apple TV. So it should use it. I have no keyboard, and I’m not using a regular remote to type on the Apple TV. The reason I’m trying to get this app to detect it, so I can see if it even has a keyboard.

    Guess if I had WireGuard working with IPv6, I could maybe enable IPv6 in mdns-reflector. But I’m lazy.

    Also, Android sucks ass. I can’t access my router’s IP from a work profile, but can from my main profile. So I had to put the Sure crap in the main profile, and it still can’t find shit. WireGuard is in kernel mode. But perhaps NetGuard in the work profile, is messing that up. In Linux, you can use multiple VPNs no issue.

    But the app might be getting it to forward the Apple TV to it, based on systemctl status and the time.

    Too bad it shows nothing.

    Nope, might not getting anywhere, since mdns-reflector says nothing. Might need to force it to a specific interface. No idea how to do that in Android. The app apparently has zero settings.

    and if the VPN Firewall is breaking mDNS, why does Termux work without using sudo?

    Maybe I need to add a route. But that makes no sense, cause Termux works. Maybe delete all multicast routes, that aren’t on the WireGuard VPN. But Termux works.

    Well, I guess Android, and some of the apps for it, just suck.

    Last time I looked for an Apple TV remote app, that is open source, I found nothing. The AI thinks the Sure crap is open source as well, I doubt it. And if you search for mdns, or zeroconf, you won’t even find service browser using F-Droid, and the repo that has it. Also, that app doesn’t work anymore apparently.

    There’s an app that only shows certain services, so finds nothing.

    Some Bluetooth keyboard app I tried using, the Apple TV couldn’t even find it. There could be a paid app, but that’ll cost you a lot more then money.

    Can’t remember if I tried the Bluetooth remote app for Android TV. No idea why it doesn’t work with Apple TV. I need a generic Bluetooth keyboard app, I only care about keyboard. I use the regular remote for everything else.

    I only pay for apps that aren’t on Google Play. I don’t support bad behavior.

    The AI says Remote Mouse has a keyboard function, and you can download the apk from their site. But if you have to pay for the keyboard, how do you pay?

    Also might have tried it already. Also, lies, you need to download software on your computer. Good job AI.

    No FAQ if you can use without app, mentions Bluetooth, but not if you need the app.

    One way to find out, download it, install it, then try connecting to Laptop, after putting laptop in discovery mode. Now if it shows too many Bluetooth devices, that might take a while.

    Nice LocalSend can find my phone now, without manually entering the IP. Doesn’t really matter, added the VPN IP to the favorites anyways. VPN was off on laptop, guess I forgot to turn it back on.

    Waste of time, the app says upcoming for Bluetooth. You can’t enable it. And might even require Pro. And when starting the app, says you need their software. So it’s useless.

    Not messing with the Sure crap anymore, as LocalSend can detect the Linux app over WireGuard, using mDNS most likely. So the Sure app is junk. “Make sure you’re on the same network, we refuse to support that at all, in fact we make it so using mdns-reflector won’t work”.

    There’s this, but no Apple TV app, and to install app on Apple TV, you have to enter your password. Not typing a long ass random ass password in with a regular remote.

    Apple probably doesn’t allow such apps on Apple TV anyways.

    Maybe there’s something for Linux that gives you a Bluetooth keyboard for a different device. And maybe it works in Termux.

    And might have found something, the site that has the github URL, makes it a real pain in the ass to copy it, get a shitty popup, in it’s stupid fancy code viewer thing.

    There’s this, may or may not work, you got to compile it.

    Maybe I should search for “Bluetooth server”.

    Well, BlueZ can do it, but that might not work in Termux, maybe if you get a full Linux distro in Termux, but that is a shitty solution.

    I know I somehow got my Linux desktop to act like a speaker, and connect my Bluetooth thing to it, and send a record player to it.

    But that record player isn’t great, and I don’t want to buy a new one. Or records, or anything.

    Nope, no BlueZ in Termux.

    Well, Termux probably won’t work at all. Looks like no Bluetooth support in it.

    You know what might work? Make a Pyatv web app using Python of course, since I sort of know how to use Tornado, it might be possible. You could look for one, but good luck.

    Most of the Google Play apps are using Pyatv most likely anyways. That are Apple TV Remotes. You could make your own app using Pyatv as well.

    Both methods are a lot of work though. Think I’d rather just use the AtariVCS, that I can install any Linux app to.

    Hmm, but I might just need a simple HTML page, with an input and maybe a button, or just a post form, and click enter. Do all the configuration with Pyatv on the computer.

    Or run the Python web app on phone directly. Since that might work in Termux. Don’t even need it to be a web app possibly. Maybe just a terminal app.

    Does Termux support Python GUIs without X11 or Wayland? No idea if X11 or Wayland works in Termux. Maybe there’s a library for Python for making Android GUI apps, that work in Termux. Cause I don’t want to fuck around with making an apk app or any of that crap. Too much work.

    And you might need a full thing to do it. Like Kivy. Too much work. Well, too much disk space.

    I already learn Python the very hard way, no need for their link. I haven’t learned it yet. I know the syntax.

    Going to install it on laptop, since you install it using virtualenv, it might not need too much disk space.

    And the code will be released, to say fuck you to the app developers charging for apps that use Pyatv. Hmm, or maybe not, might result in more paid Google Play BS.

    I think I had 6 GB of space free, before installing the venv crap, and now it’s installing the Kivy crap. Hopefully it doesn’t need 6GB+.

    It has no IDE? Lame.

    I want a GUI to make the GUI, cause doing that manually is a real pain in the ass.

    Maybe this will work.

    Well, if the site works in LibreWolf.

    And it costs money. No thanks. Rather make my own IDE then pay them for their’s. Now to lookup Python IDEs, and see if any support Kivy, even with a plugin would be fine.

    Need a Python IDE anyways, Kate is a dick, and I’m too lazy to change the settings, so it stops messing with my quotes.

    And maybe I need to search for open source Python IDE. Don’t want one bad enough to pay $100+.

    Nice site, AI says there’s a community version of Pycharm. Their site, says for individuals $100+.

    Also, why pay for an app made in Python? You can do that yourself easily, and for free. Also, depending on the app, and what it does, that might be a slow app. And depending on who made the app. You might get a really shitty app in other words. My app won’t be pretty, maybe even shitty, but it’ll work for me, and be free.

    And Kivy might work with Pycharm, good, cause it’s almost done downloading.

    Only instructions on the Kivy wiki for Windows and macOS. LOL.

    Pycharm doesn’t use venv? That means I might have to reinstall it, and using system Python, will be a pain in the ass.

    Oh yeah, I can put stuff on my external drive. Even Python crap, anything really.

    And in Linux Pycharm can use venv, does by default.

    Might have no GUI for making GUIs, still better then using Kate.

    You just go into the folder, source the .venv, and install with the Python command on the Kivvy site. After making a project. At least in Linux.

    It’s a pain in the ass, cause you got to read a lot.

    There’s a web app for making Kivy crap. Don’t want a web app though.

    This might work.

    Why the fuck did I put that in the PycharmProjects folder?

    And the requirements apparently doesn’t install distutils.

    And it says to use setuptools instead.

    Well, installing setuptools with pip did the trick. Didn’t even need to modify anything.

    I might need to modify it though, hard to see on 4k monitor.

    Why did they have to make this in Python and Kivy? Might need to find something else.

    Also, I guess you could make the entire app in it. But Pycharm is easier to see. So copy everything to it.

    It found Glade, but that’s on Gnome’s site, and probably not for Kivy. What’s the KDE program for that? And does it do Kivy? Probably not.

    Does Kivy use QT?

    Why not use Flutter? Well it is made by a bad person. Or a person that does bad things.

    Right, I can make a mDNS exploder, I mean browser with Python. Might do that first.

    And with Pycharm, you might have to type everything to make the GUI. See this.

    Their example code still works somehow, bad thing about Python. You might need to fix code you find, if you can’t, well good luck with coding anything.

    Now what is it looking for with the color? Probably not HTML. Maybe hex.

    I’m too lazy to keep reading. That’s why it takes me even longer. I do it the very hard way.

    Hmm, no idea what the color is in, there’s four pairs of numbers.

    Might be RGB. It can have four numbers. Or RGBA. That site doesn’t do .xx. That isn’t white.

    Well, 0 0 0 0, is black, does that mean white is f f f f?

    Is there an html color number for ffff? Cause if you put #ffff in CSS it’s white. And if you put #0000, I’m pretty sure it’s black. I could just lookup Kivy Window.clearcolor.

    Window.clearcolor = (255, 255, 255, 255)

    Did the trick, if you keep first 0, 0, it’s blue. Now what that number is supposed to be for a different color, I can’t tell you. Maybe RGBA.

    It’s RGBA, thought was hex, but then saw that it’s actually RGBA, change the last 255 to 1.

    IDEs are great for lazy people, make a variable called BLACK, and it does mostly what I want, might need one more zero, or maybe you don’t need that.

    #!/usr/bin/env python3
    import kivy
    from kivy.app import App
    from kivy.core.window import Window
    from kivy.uix.boxlayout import BoxLayout
    from kivy.uix.label import Label
    from kivy.uix.textinput import TextInput
    
    BLACK = (0, 0, 0)
    Window.clearcolor = (255, 255, 255, 1)
    
    class ApplicationFormApp(App):
        def build(self):
            layout = BoxLayout(orientation="vertical", padding=[20, 30])
            title_label = Label(
                text="pytv-keyboard", color=BLACK, font_size=24
            )
            keyINPUT = TextInput(
                hint_text="Keyboard", padding=[5, 5], multiline=False
            )
            layout.add_widget(title_label)
            layout.add_widget(keyINPUT)
            return layout
    
    ApplicationFormApp().run()

    See, you don’t need to read that much. Except I need another TextInput to put the TextOutput from pyatv in. Then I need to lookup a lot of stuff. Or not, I forgot I’m using an IDE.

    Who said I was going to have keyboard keys? It should use whatever your keyboard is in Android. The Apple TV remote on iOS, just gives you a text field, smaller then that.

    The code on Kivy’s site doesn’t work, the value isn’t the value.

    If you use a function with instance & value, it only sends one argument. But if you just do instance.text, you can get it. Maybe they should tell you to send the text to it, if you want the value argument. Bad example code.

  • Channels DVR downsides

    There’s plenty of downsides with Channels DVR.

    Like it costs money. Not the worst part though.

    Uses a custom ffmpeg, and I can’t find the source, so I guess a closed source ffmpeg.

    When accessing the web interface, at least on your local network, it loads resources from the internet, possibly a Google IP. That isn’t private. Also, good luck making an exception in LibreWolf, so the time zone isn’t wrong when going to it, since they decided to use your browser’s time zone. At least if using the Docker image.

    Nope, not making another profile in LibreWolf, and not using a different web browser, just for Channels DVR. Also, it accessing some other domain, to load something on the web interface, makes it really questionable if I should keep paying for it.

    And just checked, some Channels DVR domains, and gstatic, which is probably owned by Google.

    So guess what? If you make a white list of IPs your network can access on the internet, and you don’t include any Google shit, well, the web interface may not work. Probably won’t, unless it loads it from somewhere else if those domains fail.

    Also, I won’t bother paying for any DVR shit, or even DirecTV streaming service, if I make a white list. TV Everywhere could be on Google servers or the Google cloud for all I know. Also, DirecTV could be as well, not to mention, I don’t trust DirecTV anyways. So should probably just cancel DirecTV and Channels DVR.

    You can or might be able to record DirecTV from the website, with cc4c, I don’t see why not. I could access the M3U from Channels DVR in Jellyfin, didn’t make a custom M3U and see if that’ll work, maybe copy the one from Channels DVR and remove the chrome:// crap. Jellyfin probably doesn’t have Chrome, or understand whatever that means in Channels DVR.

    All cc4c does, is open a Chrome browser, and make it into a video stream. So why couldn’t you record it with anything?

    And you can get TV guide data for free if you want. Be careful if using Schedules Direct with Jellyfin, just read their homepage. If you use the wrong method of connecting, you might get banned. You can get unbanned, but then you have to email them, and change the method. Or get banned again, and possibly no unban.

    Also, not sure I like Jellyfin, I added my Channels DVR TV recordings folder to it, and good luck finding the show you want to watch with the two clients I have on the Apple TV, MrMC, and the inFuse Pro thing. In the inFuse thing, you can’t seem to sort, well maybe if you go all the way back into settings. And in MrMC, you can search, but it also puts everything in one giant ass folder. No sub folders, and just the name of the file.

    You can search, I tried at least on the web interface, and well good luck with that as well. Doesn’t show the full file name, and only shows a certain amount of shit. So search for expedition, and you no Expedition X will be shown, unless you only have Expedition X.

    And I’m not typing all the time with a regular remote on the Apple TV. And I’m not getting anything from the Google Play store to use a keyboard on the fucking Apple TV.

    I even updated the POS Apple TV, because I was having issues playing my encoded videos.

    Well, there’s poc errors, so I didn’t need to update the spyware on the Apple TV anyways. You can fix it, if you conver the mkv to a 70+ GB AVI file, and the re encode it. I still have the original file Channels DVR made, I’d rather re encode that, if I can using ffmpeg, correctly.

    I don’t want to make a script to convert files to convert the videos to AVI, as I probably don’t have enough space, to keep the AVI files until it’s done. Not deleting files in my script either. Too risky. You could copy files around, or put the file in a tmp folder, overwrite the file, bla bla bla. Still not doing it. I might actually do nothing at this point. Maybe just delete all the new broken mkvs, and restore the .bak files.

    When converting with Handbrake on a Mac mini, I didn’t have any issues. But I won’t use the Mac Mini, or even turn it on to get the file with the encoder settings. Also, what does HandBrake use? Well, on Linux it only supports AMD GPUs, with the Pro driver. So probably not ffmpeg. Maybe their own thing. And I’m not installing the Pro driver, so the settings, might do me no good.

    Now if I knew the settings, Channels DVR uses, maybe I could figure it out easier. And maybe whatever I encoded with, has issues making HEVC, last time might have actually been my desktop using a AMD GPU. I’d think that would be more stable then my Orange Pi 5, and the rockchip BS.

    Just using -c copy does not work for converting the file, and using -c copy to an avi, there’s no video, didn’t have sound on, so not sure about sound. Also, the file was smaller then the original file.

    But if you want to fix a bad video made with ffmpeg, you can use ffmpeg -i input_video -q:v 0 output.avi, depending on the original video, it can easily be 70+GB. So if you have a lot of videos, well have fun. Not worth the time to make the script. I’d re encode the original file, as I already have a script for that. I just need different encoding options I guess.

    And using -err_detect ignore_err from the already encoded video didn’t do anything. Thought somebody said that didn’t work when encoding, but too blind to find the comment. Guess I’ll look that up. Or try it on one original file, to see if that’ll work if you encode it.

    Might have found the problem anyways, the other command I use, might not actually make a working file. One command for most of the files, but the other command, which converts the audio, might be causing issues. Cause apparently converting the audio doesn’t work.

    Nope, should be using the first command, just checked the srt file.

    So what, their ffmpeg is broken? I’m using not the stable version because their proprietary TV Everywhere recording feature broke itself, and they said to update Channels DVR, to non stable version, on their forum.

    Another reason not to use it. Why no open source solution to record TV Everywhere?

    If you look at the debug log of a video file, you can see the domain it’s getting TV Everywhere from. It’s some video service thing, that isn’t free. Either the Discovery channel, uses that for their TV Everywhere, or all TV Everywhere channels use that site, or Channels DVR is paying for some video hosting thing.

    I doubt you can access that URL without logging in.

    Also, the c4cc method, can be detected super easy. All they have to do is look at the server logs, and then log you out, or ask for a captcha. Not worth using AI to read their captcha. AI might use a lot of GPU, at least does for generating images. I guess the login method would be easy enough to fix. But then it’ll be a cat and mouse game, and not worth it.

    Can’t use the official Jellyfin app on Apple TV, probably wants me to login, and the first time it asks me to login, I’ll probably just use my AtariVCS for watching TV. I’m not typing a random password in, I’ll copy and paste, but not type.

    The AtariVCS, I could get an app to control that, might need to install something on it, still better then using Google Play.

    And when I stop using the Apple TV, I need to remember to cancel that inFuse Pro subscription crap.

    You could easily use a web browser on the AtariVCS. Well, maybe not with Jellyfin, since finding shit isn’t easy.

    There’s a DLNA Plugin, but apparently it doesn’t work with the folder I added. Or maybe it doesn’t work at all anymore. If it worked, I could use VLC.

    The command I’m testing with, probably isn’t going to work “corrupt input packet in stream 1”. The reason I most likely don’t convert the audio for most of the files. Doing so, produces errors.

    Possible the custom ffmpeg, in Channels DVR just sucks at making good video files. But Handbrake is able to encode em somehow. But an open source ffmpeg can’t as easily.

    Hmm, so those errors don’t matter? Guess the video is fine with that command. Tested in MPV, and could fast forward, and backwards, much faster. Didn’t open MPV in a terminal though. If you play the broken file in the Channels DVR app, eventually, when you try skipping commercials, it’ll go backwards, and some people will get impatient, and not keep trying.

    That’s a TV Everywhere recording, and it looks like their solution, sucks ass. As why do I have packet corruption?

    Also it’s in the video stream, so might not be from converting the audio. Might not even be an ffmpeg problem, maybe Channels DVR’s custom ffmpeg problem.

    The reason not to use custom shit with no source code.

    I thought I watched an OTA video, cause I thought it worked, well the srt file for the OTA file could have been 0 bytes, and it was using the other command. No point in adding the empty srt file to it.

    $CONVERTERBIN -hwaccel rkmpp -hwaccel_output_format drm_prime -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -strict -2 -c:v hevc_rkmpp -rc_mode 2 -qp_init 26 -c:a aac -b:a 128k -r 30 "$1"/"$filename".mkv

    Possible working options for ffmpeg, you’ll get packet corruption probably though. If the source is a Channels DVR TV Everywhere recording.

    Apparently I ran the command without the -map crap, guess it isn’t needed.

    And this script doesn’t do what I thought, if the mkv exists, it isn’t going to do anything. Guess I’ll let it encode the new crap first. Then check the date of the files instead. That script may be on my desktop.

    Or maybe after it’s done on Orange Pi 5, just run the desktop script on desktop, the AMD GPU is probably faster anyways.

    Under 10 FPS with vaapi on my desktop with AMGPU, using Vulkan around 300 FPS, not much faster then using the Orange Pi 5.

    And radio might sound better with new Python script, and no need to restart anything yet, even if I did, I’d probably just need to click stop and start to restart rtl_fm and sox anyways.

    Almost 4 hours of streaming, and no crapping out like rtl_fm_streamer would probably at least before 3 hours, or maybe 1 hour.

    This radio station reboots at least once a day or something, kind of annoying.

    $CONVERTERBIN -init_hw_device vulkan=vk:0 -hwaccel_output_format vulkan -filter_hw_device vk -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -vf "format=nv12,hwupload" -strict -2 -map 0:0 -c:v hevc_vulkan -rc_mode 2 -b:v 2M -map 0:1 -c:a aac -b:a 128k -r 30 -map 1:0 -c:s srt "$1"/"$filename".fix.mkv
    

    Command for regular ffmpeg, and AMDGPU using vulkan.

    Still encoding, so haven’t tested any of the files yet. And maybe set -b:v to 1.5M. The files might be slightly bigger then my other files, oh well.

    The -qp stuff doesn’t work, always says q=2-31, even though I set -qp to 26, tried -qmin 26, and -qmax 26. It’s a dick head, and always uses 2-31. No info when searching either. And I set the rc_mode to 1.

    Setting -quality to 2 doesn’t appear to do shit either, like make the encoding faster.

    And that command, most likely won’t work. Lots of errors on some recordings, probably because of the audio they use.

    Hmm, just played a video and it worked, might have been the one with I think audio issues, but it’s an OTA recordings, the signal not being perfect, results in a not as good video file.

    And VLC works with DLNA plugin on Jellyfin now, either I didn’t wait long enough, or I should have tried restarting Jellyfin.

  • rtl_fm_streamer

    Well, it stopped working again. Never worked very well anyways. Now it needs to be restarted more then once a day, or maybe it always did. Could be as often as 30 minutes now. No idea.

    I do know, rtl_fm wasn’t working, because it was using the library that instaleld with rtl_fm_streamer, which was in /usr/local/lib.

    I just deleted that entire folder, because that’s all that was in there, the crap for the broken rtl_fm_streamer. Perhaps recompiling it would fix it. But I’m not going to recompile it every time I update or it stops working as “good”.

    So I made a Python script, it only does stereo, as I have no idea why you’d want just mono. Or the option for mono. Now, you can modify the the command(s) so it only does mono if you want.

    Since I made it for myself, I’m not doing much else to it. Not tested much yet, so how well it works, I have no idea. But I can go to bed early tonight if I want.

    Oh yeah, I need to make a systemd service file for it.

    I just tested to make sure the audio actually plays still, and it does, so I assume it mostly works. Now will it crap out after a while? Perhaps, unless I somehow did it right, so it doesn’t just feel the RAM up.

    You could make rtl_fm and/or sox save to a file, and stream that. That could use a lot of disk space though, depending on how long you stream it.

    #!/usr/bin/env python3
    
    import tornado.web
    import tornado.httpserver
    import tornado.ioloop
    import asyncio
    import os
    import signal
    class Runner():
        def __init__(self, name, cmd):
            read1, write1 = os.pipe()
            self.name = name
            self.reader = read1
            self.writer = write1
            self.cmd = cmd
            self.cmd_run = None
    
    class catch_all(tornado.web.RequestHandler):
        def initialize(self):
            self.ioloop = tornado.ioloop.IOLoop.current()
            self.stop_event = asyncio.Event()
            self.soxer_runit = None
            self.rtlfm_runit = None
        def on_connection_close(self):
            print("disconnected")
            if self.soxer_runit.cmd_run.returncode is None:
                self.stop_event.set()
                self.soxer_runit.cmd_run.terminate()
            if self.rtlfm_runit.cmd_run.returncode is None:
                self.rtlfm_runit.cmd_run.terminate()
        async def get(self):
            self.HZ = self.request.uri.replace("/","")
            await self.rtlfm_runner()
        async def rtlfm_runner(self):
            cmd = '/usr/bin/rtl_fm -d 1 -p 55.153 -g35 -f ' + self.HZ + ' -M fm -l 0 -A std -p 0 -s 192k'
            self.rtlfm_runit = Runner("rtlfm", cmd)
            await self.run(self.rtlfm_runit)
            await self.soxer_runner(self.rtlfm_runit)
        async def soxer_runner(self, output):
            while not self.stop_event.is_set():
                if self.soxer_runit is None:
                    cmd = '/usr/bin/sox -t raw -r 192k -b 16 -es -c 1 - -t flac -c 2 -'
                    self.soxer_runit = Runner("soxer", cmd)
                    await self.run(self.soxer_runit, output.reader)
                    print("soxer made")
                if self.soxer_runit:
                    stdout = await self.soxer_runit.cmd_run.stdout.readline()
                    if stdout:
                        self.write(stdout)
                        self.flush()
        async def run(self, runner_it, readit=False):
            if not readit:
                runner_it.cmd_run = await asyncio.create_subprocess_shell("exec " + runner_it.cmd, stdout=runner_it.writer, stdin=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT)
            else:
                runner_it.cmd_run = await asyncio.create_subprocess_shell("exec " + runner_it.cmd, stdout=asyncio.subprocess.PIPE, stdin=readit, stderr=asyncio.subprocess.STDOUT)
            return runner_it.cmd_run
    async def main():
        app = tornado.web.Application(
                [
                    (r'/\d{8,}\Z', catch_all),
                ],
                debug=True,
            )
        http_server = tornado.httpserver.HTTPServer(app)
        http_server.listen(8001, address='xxxxx')
        await asyncio.Event().wait()
    
    if __name__ == "__main__":
        loop = asyncio.new_event_loop()
        try:
            loop.run_until_complete(main())
        except KeyboardInterrupt:
            print("Received exit, exiting")
    
    

    You obviously need to change the address to your IP. Maybe change the port as well.

    Also, if you can’t write any Python scripts yourself, you probably shouldn’t bother using it. There’s a good chance it has some kind of issues. Took a long ass time to get it working right, you can blame search engines for that, and me for not knowing shit about async.

    Probably doesn’t need to use Tornado, but I didn’t want to rewrite it again. Started out with Flask or whatever it’s called, then found Tornado, and it seemed like the better one to use.

    But you might be able to do it all with asyncio and no Tornado crap.

    All you do to listen, is put in http://IP:8001/000000000 replace the “000000000” with the radio station in HZ.

    There was some problem with just using one create_subprocess_shell process, using | in the command to pipe it to sox. Can’t remember anymore what the problem was.

    Well, I know how to use my own pipes with create_subprocess_shell now, use os.pipe. I tried that without looking it up or finding the specific post, but it didn’t work. And using the subprocess.stdout didn’t work either.

    And manually writing the stdout didn’t work either. If you print what it’s writing, you’d see some error or something. Using the os.pipe method is way easier.

    Another benefit to making this, is now I know how to use classes, way less typing if you use a class for some stuff.

    Does anyone really want to type var1, var2, var3, and so on? If you are running processes, and want to store variables, then it’s less typing/work to use a class,. They sort of have the same var name as well, you don’t actually call the same thing though, so not exactly. Just put the class in a variable, then to get something you use var_class.whatever.

    You might want to change Debug to False as well, or maybe not, since it may have issues.

    Works with Python 3.13.5. That’s another problem with writing a fucking Python script, you find very old info when searching, even for Python 2, that obviously isn’t going to work.

    DuckDuckGo loves giving me old stuff. Sometimes when searching, I get an error message, or the site doesn’t even work or exist anymore. I guess search engines are too fucking lazy to remove broken links from their results, or they are intentionally doing it, because of the browser I’m using.

    Not sure why they decided to make versions of Python very different. Maybe from 2 to 3, but I’m not sure every 3x version supports older 3x versions. A real pain in the ass.

    I tried writing a bash script at first, but that didn’t look like a good solution, as the “server” would restart when going to the URL, then you’d have to go into VLC and open the URL again. Might be even more of a pain to detect when somebody disconnects, so it can stop the rtl_fm and sox process. I’m only one person, and don’t need those running when I’m not listening.

    But if you have more then one tuner, and somebody else wants to listen to something else, you could probably easily modify it to do that too. Or maybe some people can listen to two things at once.

    And recording with that script would be pointless, just make a bash script, and no HTTP. Unless you want a web interface, not sure I’d use Python for something with an actual web interface.

    The only reason I want HTTP, is I’m too lazy to login using SSH and running the command, and don’t want rtl_fm + sox running 24/7. Also, if I decide to listen on say my phone, I really don’t want to run SSH to connect, typing on phones sucks.

    No I don’t want icecast or whatever either, seems overkill for what I want.

    Look how long that Python script is, not very long. I suppose the crap it’s using is probably way longer, the reason not using Tornado might be better.

    You might need async of some kind, to make it work without restarting the HTTP server though. But if you want a smaller library, you may have to not use Python. Would it take a ton of code in Ruby to do? Too much work for me, I’ll only do that if it has major issues, and I don’t feel like fucking with Python anymore.

    You could use something else entirely as well. That you need to compile. But I don’t want to ever have to recompile anything, so I’ll pass. I’d rather just fix the script if Python upgrades and it breaks.

    But there’s a solution, don’t use the system Python. Just install an old Python for it, and the modules, and never update it.

    It’s not accessible using the internet, and security doesn’t exist. If somebody wants to hack you, they’ll hack you.

    Just watch the Pegasus scandal on PBS or whatever it was on.

    And then, watch Skinwalker Ranch, and tell me that cracking Quantum resistance encryption isn’t possible.

    Clearly, being born in the Amazon Rain Forest, would have been safer. Unless World War 3 happens, and nukes come falling down. Don’t forget global warming either.

    In other words, a group of humans, or probably even one human, doing bad shit, means everybody will be affected. And the animals. Some animals in the deep ocean could survive maybe.

    At this point, the internet isn’t really worth having or using. It could have been an awesome thing.

    Thought the script was broken, when running with systemd, it was only killing the rtl_fm process, thought I fixed that. Just use Type=simple in the service file.

    Also, slightly changed the script, added self.HZ = “” in the initialize, and just realized, you could probably put the actual value in it. Well too lazy to do that right now. Something I read said something about making sure you make the variable in the init, or maybe that only applies to classes. Cause it was working without it in initialize. And I just added that today as well. I had lots of self.vars, and no initialize, and the variables were most likely working.

  • Finally got another VPN on my phone working from my main profile

    Using Sing Box + NetGuard.

    Don’t know of any good root firewalls, that actually work, Afwall+ doesn’t even block stuff apparently.

    Netbird is free, so accessing my Home Assistant container using that is better then paying for Home Assistant Cloud. Also, if I pay for Netbird, it’s cheaper. Probably won’t need to anyways.

    Netbird isn’t a US company, so I trust them more then Tailscale.

    Also, want to setup some kind of notification server, using Unified Push or something. Might make getting notifications better in Home Assistant. Can’t expose that to the internet with Home Assistant Cloud. And too lazy to write a script for my shared hosting to proxy it. And not searching the internet for an eternity to try and find a solution. Also, don’t know if my host would want me doing that. Not managing a VPS.

    I put Netbird in a container, which is now in a Pod. I had to update Podman, by compiling it, I used distcc, so it didn’t take that long on the Orange Pi 5. Wanted the Pod= support in the quadlet systemd service file.

    If using Sing Box, make sure you get the real one. There might be a fake one on Google Play Store. There’s also some site that is most likely not their site. I was looking for info on configuring it, and that shitty site was in the result.

    I got it from F-Droid, you can find a link to their site on there too. If super paranoid, you can probably compile it yourself.

    ntfy might not even require a public accessible URL, if using Android. It’ll be publicly accessible to me though. Also, the Unified Push site seems to say it’s hard to run your own server, doesn’t look that hard, and ntfy says it isn’t if you use ntfy.

    I put Netbird in a container which is in a Pod, as I only need it for some stuff, also the host is connected to WireGuard, but only a local one.

    I put Sing Box in the work profile, and setup a port forward with nobody, from src port of Home Assistant, to the same dst port, and 127.0.0.1. In Sing Box, you can override the dst IP, probably the port too. It’s using a direct inbound, the override of the dst IP goes in there, if using a direct type. Outbound is direct as well.

    Too lazy to copy and paste the config in a file, and then get it on computer.

    But you access it with http://127.0.0.1:8123/, at least for Home Assistant. Should work with UDP as well, but you probably don’t use http or a browser in that case.

    I excluded the Sing Box app in Netguard from the rules. Probably not needed, since it’s in the work profile, but Sing Box is in the main profile, and I was messing with it in there too.

    And if you can’t connect with a browser, you may need to force close it, and re open it. I used curl in Termux, and it worked, so I knew it was the browser.

    Now browsing the web using port forwarding in Netguard might be a pain, if you want two VPNs, and use one for browsing. But if you have root, apparently using WireGuard with the kernel module works, even with a VPN firewall. The internet won’t tell you that either though.

    [Unit]
    Description=netbird pod
    
    [Pod]
    PodName=netbird
    #Network=netbird.network
    Network=pasta:-t,auto,--map-gw,-a,10.89.0.1,-g,10.89.0.1,-n,24
    HostName=orangepi5
    UserNS=keep-id
    PodmanArgs=--device /dev/net/tun:/dev/net/tun:rw --sysctl=net.ipv4.conf.all.src_valid_mark=1 --sysctl=net.ipv4.ip_forward=1
    
    [Service]
    Restart=always
    
    [Install]
    WantedBy=default.target
    

    There’s a .pod quadlet that works with Netbird if you need one. And in the .container file, make sure you add an IP to it too, using the Network option, but with a different IP. The gateway can and probably should be the same.

    Accessing it using the container’s IP directly doesn’t work, but accessing it from Netbird using the gateway IP works just fine. Maybe the Pod doesn’t need an IP. But I’m too lazy to fuck with that anymore. Also don’t care.

    If you aren’t running anything that requires UserNS, you can remove that. If you do need that for one of the containers, then you need to use User=root in the container for the netbird-client.

    I’m not using a root container.

    The eBPF or whatever might not work, but that might require root, works without it anyways.

    And for ntfy, I’m not sure if I can use port 80, don’t think I can in Linux without root. But Android isn’t Linux, it sucks ass, can’t do more then one VPN easily.

    And don’t ask me how to use multiple VPNs in iOS. Might not be possible at all. But the two main mobile OSes, suck ass.

    And make sure you change the port in server.yaml for ntfy, if not running as root.

    And that’s why eGPUs suck, knock the dock off the GPU, and you got to force shutdown the laptop. Or wait a really long time.

    Well, something might be damaged on laptop or eGPU or dock. Or I guess the new cable.

    But I turned it off, and then turned off eGPU and dock. Then booted live Debian and ran fsck. So if the eGPU craps out again, I guess it’s broken. I was able to get to a tty and shutdown, so the laptop itself might be fine.

    Notifications not supported

    Notifications are only supported over HTTPS. This is a limitation of the Notifications API.

    Bummer. Guess I need to figure out how to get SSL to work with Sing Box. Might be a real pain in the ass.

    Wait, that might be for web notifications. Don’t care about that.

    Well laptop seems stable again. I guess if you mess the eGPU up by knocking the dock over, you have to shutdown unplug, and run fsck. Was super stable before that.

    nfty works, or I assume it does, was able to make a reserved topic, and connect. Might be a while before Home Assistant is configured though. It doesn’t automatically do notifications for what I want.

    Home Assistant has camera motion alerts sending to me now.

    A socks proxy might work, but too much work if accessing using an IP. Too much work, cause nothing was working. Works now, and UDP works with the port forwarding in Netguard as well. So if I ever need UDP, I know what to do.

    You might be able to make stuff accessible on a domain with Netbird too, but you’d probably have to pay for that. I wouldn’t bother hosting my site at home, a shitty 10 Mbps upload is the main reason. I’d also need another VLAN, just for the server, and another server. I’d use a SBC most likely. Might be a little slow, for the WordPress site, that isn’t static.

  • Tasker Direct Purchase version might be a one time payment

    But still a pain in the ass, you have to get a $4 a month subscription, then make sure you get a license, then cancel the membership.

    The open source automation app broke itself again, apparently, didn’t trigger anything when I disconnected from WiFi. I don’t need a Tasker like app to do much, but apparently Automation doesn’t work right for very long.

    I fixed it the first time, by deleting the data, uninstalling, and installing the version from their site. I did import my settings and crap, but it was working fine till today. All the battery saving crap should be disabled, at least all that I can disable.

    Oddly when I connected to WiFi it did it’s stuff. Might just need another automator app to open it once a day, or after it reboots. In that case, easier to try Tasker.

    Now it’ll be a waste of $4 if it has issues too, that means it’s probably Motorola’s and/or Google’s fault. The only reason I have an Android phone is I can remove the Google crap. Good luck removing Apple’s crap on an iPhone. I like my phone to ring when people call me, so no custom ROM for me.

    Also will be a waste of $4 if my subscription is invalid after cancelling my membership. Well, only one way to find out. I won’t search for an eternity to try and find the answer.

    And you can’t pay with PayPal apparently “Please go back to Patreon and choose another way to pay. PayPal isn’t available at this time.”. I’ll have to use my PayPal debit card. Makes it even more of a pain in the ass. I wonder if I can no longer use PayPal.

    Well, I’ll just delete my account, using a browser the dicks allow me to access it with. If I have to cancel all my bills online, so be it, that’ll be internet to.

    PayPal must be working again.

    Just got my license. And you know what makes it even more of a pain in the ass? It makes a PayPal subscription, so if you cancel, make sure that’s cancelled too.

    I did buy Tasker a long time ago, the Google Play version, and probably before whoever owns it now owns it. The FAQ might have said they can’t and won’t give you direct purchase version if you bought it on Google Play. Don’t remember exactly what it said. Not emailing them anyways. Easier to spend $4.

    And if you’re wondering, you need to allow it internet to activate license, not surprising.

    Well, it seems to work, and doesn’t actually need to make the VPN app visible to turn the tunnel on or off. So it’s better then the Automation app anyways.

  • That was fun

    Don’t upgrade your Linux kernel in Debian from stable-backports. That broke my eGPU, and VLC still said it couldn’t load the driver.

    And neither could glxinfo load the driver.

    So I had to make a script to reinstall everything that is the stable-backports version, but the stable version. And since I used -y in the script, I had to make another script to reinstall stuff. You can remove the stable-backports kernel, if you have a stable kernel installed.

    I probably don’t need Deb Multimedia, going to disable it.

    Apparently I installed an old stable version of some packages, just upgraded them.

    To fix hardware decoding in VLC, with AMDGPU, you just need to select the X11 video output, probably what I have it set on my desktop. Should have just checked that before installing more stable-backports.

    If your AMD GPU causes a GPU reset, it may be fixable if you install the following packages from stable-backports.

    firmware-amd-graphics/stable-backports
    firmware-linux-nonfree/stable-backports
    firmware-linux/stable-backports
    firmware-misc-nonfree/stable-backports
    
    

    Fixed it for me, don’t recall the exact message in dmesg.

    No special kernel options, other then for the eGPU.

    Now Debian might be rock stable.

    Also, don’t bother upgrading everything, or everything it will easily to stable-backports, as the kernel being upgraded, may just break something.

    I won’t share my scripts, if you can’t write one, then you should restore your backup and/or reinstall. And I should probably setup my backup script, as I clearly didn’t back up before fucking with stable-backports.

    And also, that’s why putting /home on it’s own partition is a good idea. But it’s less work to backup, if everything you want is on one partition, then you can just tell it to only backup on one partition, if you have /home separate, then you have to remember to include it, if you tell it only one partition.

    Hmm, might have had a urbackup backup of it, can’t remember when I installed that on laptop.

    My scripts could be modified, to reinstall everything from stable-backports, except, you’d have to exclude everything not in stable-backports. Another reason not to share it, you could do some serious damage with it.

    And the time might be wrong on my Orange Pi 5, says last seen 11/23, it’s still 11/22 as far as I know.

    NTP service: n/a

    Well, that could be the problem as well. Guess the upgrade killed NTP. Local time is right, guess Urbackup shows some other time zone.

    Oh wait, I think a lot of stuff in browsers, uses your browser’s time zone. LibreWolf doesn’t use your local time zone, by default, probably fine then. Still need NTP.

    Hmm, Chrony is still needed with Armbian? I uninstalled it to fix my broken upgrade.

    NTP is active now, just installed chrony. Didn’t even know what that was, except it wouldn’t upgrade with it.

    I doubt games worked when glxinfo said it couldn’t load the driver. Or was just the driver for hardware video encoding broken? Not sure just that part can be broken, as I don’t think glxinfo even said the name of GPU.

    Guess VLC’s automatic video output is broken, at least in Wayland, tried the rc version I have, after recompiling it, and it’s broken with that too. So no point in using that version.

  • I get Comedy Central in Channels DVR from DirecTV now

    When adding a custom channel, make sure “EXTM3U” is in it.

    Also, nothing on the internet appears to say how to use it with DirecTV. I was using the wrong URL, and not giving it the channel name. Works with whatever cc4c I have. See some other post on here for my Podman container file.

    #EXTM3U
    #EXTINF:-1 channel-id="DCOMEDY" tvc-guide-stationid="10149",Comedy Central
    chrome://xxxx:5589/stream?url=http://stream.directv.com/guide&ch=Comedy%20Central

    You may need to change the stationid though. You can possibly find it if you go to https://xxx:8089/dvr/guide/stations. That’s how I found it, the zap whatever site, just redirects to some other site now.

    I figured it out, by looking at main.js for the Chrome for Channels thing. I was trying to figure out how to open a bookmark for a macro with some extension, then I found that, no macro needed for DirecTV.

    And VLC doesn’t work in Debian for some unknown reason, I guess it’s broken. Oddly the Flatpak works. Makes no sense to me. They should update their package, or provide instructions on making it work.

    But search engines are useless if you use LibreWolf, as search engines need to track and profile you, to work apparently.

    Now to compile VLC, since apparently there’s no newer deb by anybody else, and I’m not spending eternity looking for one.

    Also, no kernel options needed to prevent some AMDGPU bug I was getting with mostly hardware video decoding. Just update firmware-amd-graphics. Forgot what else I upgraded, maybe some mesa-va-drivers or something.

    sudo apt install -t trixie-backports firmware-amd-graphics

    Also, those kernel options, didn’t even fix it, as mpv would cause the issue with hardware encoding enabled, but after updating some stuff, it works fine now. So if hardware decoding works in mpv, it’s a VLC problem.

    A much easier option, would be to use a rolling distro, like openSUSE or Arch Linux.

    The VLC from Deb Multimedia doesn’t work either.

    Just compile 3.0.22-rc2 and hope for the best.

    Well, VLC might not be broke, one of it’s dependencies might be though.

    Just realized, it’s still using the wrong VLC. And I installed over the other one, so probably why it doesn’t work.

    If you remove all VLC packages, it wants to remove KDE stuff too. No idea why.

    If you break VLC, you can run sudo apt install –reinstall vlc to bring the broken version back. Apparently KDE requires it.

    I ran make uninstall for the one I compiled, just ran ./vlc “url” and it still seg faults.

    And bin/vlc-static, doesn’t work either.

  • GPU resets doesn’t crash Debian

    But both Firefox based browsers and Chrome itself will cause a GPU reset. I disabled hardware decoding in both now, forgot to after installing Chrome, and now I need to remove Chrome, as it looks like I don’t need it, cause Chrome Capture for Channels doesn’t really work in Podman. Can’t type anything in to login to DirecTV.

    Got to build it on my desktop, laptop may or may not be stable enough to run it. Hmm, guess I need Chrome on my desktop, or Chrome based. Might still have the Chrome based one that starts with a V. Just need to delete my profile data, so it’ll open, since it corrupted itself apparently.

    Is hardware decoding disabled in LibreWolf on my desktop? I should check, cause it doesn’t crash. The laptop’s eGPU is a AMD 6xxx and so is the desktop, the one is desktop is supposed to be better.

    Now if it has hardware decoding enabled, and doesn’t crash, perhaps I need a rolling release distro on my laptop. Armbian might have a rolling release version, and maybe an amd64 version. Is that based on Debian or Ubuntu as well? Depends what version the kernel is though, if that would be even worth doing. Otherwise use Arch or openSUSE. But I like Debian.

    Wouldn’t be surprised if I disabled hardware decoding. Must be a new fancy bug.

    Hmm, will that Chrome for Channels thing work on ARM if I compile it? No idea how well Chrome works on ARM Linux, that isn’t using Android crap.

    Well, the desktop isn’t doing much, might as well put it on there.

    All I need is bun to compile this Chrome thing? I already have git, probably on almost if not all my Linux stuff. No idea what bun is, don’t even know if I can easily install it in openSUSE.

    npm install -g bun

    It’s some JavaScript bundler crap.

    Or use their script.

    I guess while that’s slowly installing, I can check hardware encoding in LibreWolf. And see if the Chrome based crap browser is still on there.

    Not disabled, testing DirecTV, in LibreWolf, you have to change the user agent. Might be fine on desktop, so something in openSUSE doesn’t have the issue that laptop has with Debian.

    My desktop running openSUSE is using Kernel 6.17.7-1-default and laptop is 6.12.57+deb13-amd64. The KDE is probably newer on desktop too.

    Too bad NoMachine didn’t work as a server in openSUSE last I tried. Should try again.

    failed to start browser page: Error: Command failed: which chromium which: no chromium in

    Now to make a script called that, so it can open the other Chrome based browser crap that might be installed. Or better, use ln -s.

    failed to start browser page: TargetCloseError: Protocol error (Target.setDiscoverTargets): Target closed

    Guess I need Chromium, too lazy to mess with Vivaldi. Thought it was based on Chromium though.

    Oh I think it has to be open already. Probably didn’t need to install Chromium.

    Nope, probably need to run main.js on it not from SSH.

    Just crashes, when trying to open a stream by URL.

    No way to make NoMachine work in openSUSE? Get a connection reset by peer error.

    Got to love search engines, some of the links get a warning page in my browser.

    x2go might still be installed on desktop, I’ll just use that, instead of fucking with broken shit, like search engines that don’t work anymore.

    Oh yeah, x2go doesn’t support wayland, just use krdc.

    Nice, get to debug some puppeteer crap.

    I got farther, might need xvfb-run.

    Hmm don’t run npm install -g, you need sudo. Maybe fine for bun itself, but not everything else.

    If using Chromium, you might need the widevine package, but it says cdm, not drm, so I removed Chromium, and modified main.js to look for vivaldi-stable.

    Unhandled rejection: TargetCloseError: Protocol error (Extensions.loadUnpacked): Target closed
    

    Trying debug instead of stream now.

    Still broken. Guess I should reinstall Chromium and that Widevine crap.

    Or stop trying to use headless.

    Oh wait, think I have to use Chrome or based on it, on laptop for debug to work.

    And get non headless to work first, or good luck. You probably need chromium-ffmpeg-extra too.

    And it might be slow as fuck. Is the GPU disabled or something?

    And might have crashed my desktop, by using –enable-gpu. Looks like that AMDGPU bug is everywhere.

    Also krdc sucks compared to NoMachine.

    Hmm, looks like ethernet crapped out, nice.

    Trying Ungoogled Chromium from Flatpak on laptop now.

    Is krfb better? Nope, use some other VNC server, that thing sucks.

    One of those network keyboard mouse switcher apps would probably work the best with Wayland. I bought one long ago, forgot what it’s called though.

    There’s Rustdesk, but be careful, if you maximize the screen, your AMD GPU might crap out for a second in Debian, same GPU reset that browsers trigger.

    It’s faster but buggy.

    Maybe the non Flatpak is better.

    Why do you need the server? The direct connection works fine apparently. And I’m only allowing the direct server to connect to local IPs. And the damn thing keeps changing the config file, so it’s not using the custom server I guess, it’s using the default one.

    Well, I guess that Chrome thing doesn’t work anymore.

    I got TV Everywhere working again earlier anyways, apparently it broke somehow, had to update to a pre release.

    Wanted to record Comedy Central, so I don’t need to use their app to watch anything. Oh well. I’m too lazy to fix, or anything. And I don’t like Chrome anyways, so not worth my time.

    There’s some Windows junk, but it’s for using a USB encoder. I have one, but I’d rather use the GPU. Or no GPU, I don’t give a damn.

    There’s something for ESPN crap, that might work on other OSes besides Windows. Don’t care about ESPN.

    $HOME/.cache/puppeteer

    That folder doesn’t exist.

    Hmm the thing I have could work with Chrome, instead of Chromium. Too many Chrome versions.

    Not recommended, uses the wrong Chrome data. I should rm -fr my chrome data folder too.

    Easiest way to run actual Chrome, is by uninstalling Vivaldi, well uninstalled google-chrome-stable too, then reinstalled it.

    CHROME_BIN=/usr/bin/google-chrome-stable DOCKER=true LIBGL_ALWAYS_INDIRECT=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true bun main.js doesn’t seem to work either.

    Hmm they say how to run xvfb, here.

    Should have kept Remmina installed on laptop, no need to use Rustdesk, it makes a VNC for the Chrome. I will eventually put it in it’s own user or something. Just testing, then going to bed.

    Maybe it doesn’t work with DirecTV.

    Maybe just open a new tab and go to the DirecTV site yourself, and login.

    Now how the fuck do I automate that?

    You could put it in Distrobox as well. Instead of LXC.

    Either it’s broken with newest Chrome, or I’m missing something in openSUSE.

    And yes hardware encoding might work, but I’m not using a container. Isn’t that nice?

    npx @puppeteer/browsers install chrome@stable

    Might fix it.

    Wait, it works in Podman somehow? Hmm. Then I don’t need to mess with this Node BS as much. Now how do I mess with Portainer? I need one for Podman, maybe Podman Desktop. Maybe I’ll stay up till 5 AM.

    Portainer may work with Podman, but possibly not with openSUSE. And I’ll just do it manually, using Cockpit maybe.

    Almost bed time, apparently for a new user, if using Cockpit, you have to run in a terminal as user podman pull.

    And if that doesn’t work, you may need to run “usermod –add-subuids 100000-165535 –add-subgids 100000-165535“.

    Nope, I can’t remember how I setup Podman.

    Almost was working, till my outgoing firewall blocked it. Finally loaded after allowing it.

    It would work, if I could get the URL to the channel.

    Nice old version of Chrome, so insecure.

    cat .config/containers/systemd/cc4c.container 
    [Unit]
    Description=cc4c
    
    [Container]
    Image=docker.io/bnhf/cc4c
    ContainerName=cc4c
    ShmSize=1g
    Network=host
    Timezone=America/Los_Angeles
    Environment=HOST_PORT=5589
    Environment=CC4C_PORT=5589
    Environment=HOST_VNC_PORT=5900
    Environment=VIDEO_BITRATE=9500000
    Environment=AUDIO_BITRATE=256000
    Environment=FRAMERATE=60
    Environment=VIDEO_WIDTH=1920
    Environment=VIDEO_HEIGHT=1080
    Environment=VIDEO_CODEC=hevc_vaapi
    Environment=AUDIO_CODEC=aac
    Environment=TZ=US/Mountain
    Environment=HOST_VOLUME=cc4c_chromedata
    Environment=DEVICES=true
    Volume=/dev/dri:/dev/dri
    Volume=/home/cc4c/cc4c_chromedata/cookies:/home/chrome/chromedata/Default/Cookies
    Volume=/home/cc4c/cc4c_chromedata/logins:/home/chrome/chromedata/Default/Login Data
    Volume=/home/cc4c/cc4c_chromedata/localstorage:/home/chrome/chromedata/Default/Local Storage
    Volume=/home/cc4c/cc4c_chromedata/prefs:/home/chrome/chromedata/Default/Preferences
    Volume=/home/cc4c/cc4c_chromedata/secure:/home/chrome/chromedata/Default/Secure Preferences
    
    [Service]
    # Restart service when sleep finishes
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    

    That’s how I’m running it, those container files are nice and easy.

  • Vanilla OS not more stable then Fedora for eGPU

    And possible Gnome has issues with eGPUs, or at least on this HP laptop. But Vanilla OS probably isn’t stable for anything.

    Ended up putting Debian on the laptop, and tried Gnome first, but installed KDE, I didn’t remove Gnome though.

    Easier to debug Debian anyways, not much info on the Vanilla OS site about it. So you mostly have to figure everything out yourself. You can try searching, but you may be searching for eternity, I can get different results every time I search. Sounds like DuckDuckGo isn’t very private.

    Hmm Fedora, might have been unstable because of some bug.

    amdgpu 0000:6a:00.0: [drm] *ERROR* [CRTC:85:crtc-0] flip_done timed out

    Not sure if Fedora got that or not, was completely locking up. Good news is, Debian, you can still access a tty on the laptop display.

    There’s various workarounds that may or may not work. And may be a problem with VRR in KDE. If you have to use the KWIN things, VRR might not even work anymore. And since VRR is experimental in Gnome, the thing to disable for that, might affect VRR as well, no idea.

    But maybe I can go back to Gnome soon.

    Currently trying “amdgpu.dcdebugmask=
    0x200 amdgpu.runpm=0
    “.

    KWIN_DRM_NO_AMS=1
    KWIN_DRM_NO_DIRECT_SCANOUT=1

    Putting that in /etc/environment, might fix it as well. I put it in there, but commented it out. In case I don’t need it. For Gnome, you only need to change one thing. I’m too lazy to find the info. It was on one of the Git things for something.

    Steam hasn’t crapped it out yet, last time I tried opening a game, while doing the shader thing it crapped out. I had to go into a tty and reboot, couldn’t login to KDE, and didn’t say the password was wrong. Well not every time, I kept trying, then I typed it wrong multiple times. But I guess you’d need to rmmod amdgpu, which probably won’t work.

    Guild Wars 2 opened, and was able to get in the game, so maybe it’s fine now.

    Good luck getting into a tty in Vanilla OS, when it craps out. Pretty sure even when the laptop display was enabled in Gnome, I still couldn’t get in a tty or at least not always. All those buttons do is make it restart the Display Manager, if you are lucky, unlucky and nothing will happen. Perhaps it has no tty. Nice feature, not worth my time to fuck with it anymore.

    Well, beginners might like it, they’ll never need a tty. So if it freezes, they can just hold the power button down. And if there data gets corrupted, they can reinstall. Hopefully beginners backup any data they care. The Vanilla OS website says beginners can use it.

    I’d prefer to get into a tty, and reboot correctly myself. And check dmesg to see if it says what went wrong. Journalctl may have info, but if it just completely freezes up, maybe not. Not to mention, you might get data corrupted if you reboot or power off incorrectly. So journalctl might be useless.

  • Orange Pi 5 is good enough for encoding Channels DVR recordings

    No idea about 4k, but no 4k OTA here, and don’t think any TV Everywhere channels have 4k. Most of my shows are TV Everywhere.

    deleted
    

    There’s my script, it uses rkmppenc and ccextractor for the subtitles. Used to use handbrake on the Mac mini, and didn’t need anything else for subtitles. But ffmpeg, the one in Armbian, doesn’t like some of the recordings subtitles, so it just fails to do anything. And too lazy to mess with rkmppenc to figure out if it can or even supports the subtitles in the Channels DVR recordings.

    Had to turn the Mac mini on to get the script, not sure you can access the file easily from a Time Machine backup on a Linux computer, that it backed up to using Samba. Search engines appeared to break, as I can’t find anything anymore. Or is it because I don’t use an easy to track browser? Google sucks too, last time I used a search engine that uses Google And DuckDuckGo claims to be private, if so, I guess it just sucks. Shouldn’t need to track me. Or access anything from my browser that can be used to track me. I won’t use a different browser to search, eventually I’ll stop searching instead.

    And be careful when that scripts runs, especially if you don’t manually run it. It will move the mpg to .bak, and ln -s the mkv to the old mpg name. But if Channels DVR is recording, and it can move the file, while ffmpeg is writing to it, you might, well probably, will get a failed recording.

    Either modify the script to make it safer, or run it manually and when you know you have enough time to encode everything.

    Is it slower then the Mac mini? Probably not by much if at all. At least with the settings I’m using in the script above. The longest time might be 10 minutes or a little less. Way better then using a CPU. And all the commercials I keep, because it isn’t exactly accurate by default, and might remove some of the show. Too lazy to make the commercial detection better, and don’t care.

    File sizes are small enough for me, it’s using hevc. That can be changed as well.

    I won’t use the Mac mini anymore, don’t trust Apple anymore. You get to pay more, and soon get screwed by Apple and US government. Unless you’re into mass surveillance. At least you have nothing to hide.

    And I might need to remove the Motorola Installer, it’s getting blocked by my firewall. Might be hard to install the new update, that became available shortly after updating finally. The amount of work needed to get root back from a non full OTA, might not be worth it, so I may never update again.

    Update

    If you used the old script, you probably got some broken recordings. Apparently you should just copy the audio, not encode it, unless you know what you’re doing. Easier to copy the audio anyways.

    Updated script using ffmpeg, still extracts the subtitles, since I can’t copy the subtitles from all recordings using ffmpeg directly.

    #!/bin/bash
    
    SUBBIN=ccextractor
    CONVERTERBIN=ffmpeg
    
    get_mpgs () {
            cd "$1"
            #echo "$1/*"
            for FILE in "$1"/*
            do
                    filename=$(basename "$FILE")
                    extension=${filename##*.}
                    filename=${filename%.*}
                    if [ "$extension" = "mpg" ]
                    then
                            if [ ! -e "$1"/"$filename".mkv ]
                            then
                              echo "$1/$filename.mkv doesn't exist"
                              #$HANDBRAKE_CLI -s "1,2,3,4,5,6,7,8,9,10" --preset-import-file "$PRESET_FILE" -Z "$PRESET" -i "$FILE" -o "$1"/"$filename".mkv
                              if [ ! -e "$1"/"$filename".srt ]
                              then
                                    $SUBBIN "$FILE" -o  "$1"/"$filename".srt
                              fi
                              if [ -e "$1"/"$filename".srt ]
                              then
                                    $CONVERTERBIN -hwaccel rkmpp -hwaccel_output_format drm_prime -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -map 0:v? -c:v hevc_rkmpp -rc_mode VBR -b:v 1.5M -minrate 1.5M -maxrate 2M -map 0:a? -c:a copy -map 1:s:0 -c:s:0 copy "$1"/"$filename".mkv
                              fi
                              if [ -e "$1"/"$filename".mkv ]
                              then
                                    actualsize=$(du -m "$1"/"$filename".mkv | cut -f 1)
                                            if [ $actualsize -ge 30 ]; then
                                            mv "$FILE" "$FILE".bak
                                                    ln -s "$filename".mkv "$filename".mpg
                                            else
                                                    echo "$1/$filename.mkv is only $actualsize mb."
                                            fi
                              fi
                             fi
                    elif [ -d "$1/$filename" ]
    
                    then
                            get_mpgs "$1/$filename"
                    fi
            done
    }
    get_mpgs "$1"
    

    And if you need to re encode everything from this month:

    #!/bin/bash
    
    CONVERTERBIN=ffmpeg
    
    get_mpgs () {
            cd "$1"
            #echo "$1/*"
            for FILE in "$1"/*
            do
                    filename=$(basename "$FILE")
                    extension=${filename##*.}
                    filename=${filename%.*}
                    filename="${filename//.mpg}"
                    file_mod_date=$(ls -l --time-style=+%Y-%m "$FILE" | awk '{print $6}')
                    if [ "$extension" = "bak" ];
                    then
                            if [ ! -e "$1"/"$filename".fix.mkv ] && [ -e "$1"/"$filename".srt ] && [ "$file_mod_date" = "2025-11" ];
                            then
                              echo "$1/$filename.fix.mkv doesn't exist"
                              if [ -e "$1"/"$filename".srt ];
                              then
                                    $CONVERTERBIN -hwaccel rkmpp -hwaccel_output_format drm_prime -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -map 0:v? -c:v hevc_rkmpp -rc_mode VBR -b:v 1.5M -minrate 1.5M -maxrate 2M -map 0:a? -c:a copy -map 1:s:0 -c:s:0 copy "$1"/"$filename".fix.mkv
                              fi
                              if [ -e "$1"/"$filename".fix.mkv ];
                              then
                                    actualsize=$(du -m "$1"/"$filename".fix.mkv | cut -f 1)
                                            if [ $actualsize -ge 30 ];
                                            then
                                            mv "$1"/"$filename".fix.mkv "$1"/"$filename".mkv
                                            else
                                                    echo "$1/$filename.fix.mkv is only $actualsize mb."
                                            fi
                              fi
                             fi
                    elif [ -d "$1/$filename" ]
    
                    then
                            get_mpgs "$1/$filename"
                    fi
            done
    }
    get_mpgs "$1"
    

    That’s why the script makes a backup of the original file, now if you ran the first script and deleted the .bak files, without testing, well then I guess you’ll have to rerecord the show(s).