Wednesday, March 26, 2025

2025-03-26 - File Server went down again for the second time this month

    Last week, I had a problem with my File Server. This was frustrating because I use it every day and before I go to bed, I like to watch a movie or fall asleep to one on loop. That's not happening without the server. I don't store movies locally. Although I guess I should, pfft! I got this TEMPer 2 temperature sensor I bought in the mail hoping my file server, which also has home assistant installed, could track my room temp and automatically trigger my smart LG portable AC for my room. The temp is different all the time, like it stays out of alignment with the timers you have set for the AC, and you get frustrated with it after long enough that you knee-jerk react with a highly tuned setting for turning on and off regularly to keep the temperature in an expectable range and the second you do that, there's a wide temperature swing like a week later. Then you just deal with that for a month or something before you finally change it again and it changes like a week after that too. And this winter has been strange where I live too because that groundhog said winter was over I think and then the temperature seemed to go up about twenty degrees, then a week or two later we had one of the first snow storms of our entire winter, then a few weeks later, an even bigger snow storm. But I think now it is officially over, the temperature is swinging up into the fifties every few days. 

    So I got that temperature sensor in the mail hoping to configure the server to trigger my AC on and off according to my room temperature since for some strange reason, this AC is so smart that it won't track the temperature like my last AC did. I am not a fan of smart devices, they just don't seem that smart because they frequently miss the obvious thing or they are intentionally programmed to do so in order to benefit the companies that sell them, like the remote for the AC not being so handy, forcing you to use the app, which forces you to wait while it loads ads every time you want to turn the ac on or off without getting up out of bed or something. 

    Unfortunately, my attempts to configure the sensor caused me to have to update a python package so the server could read it, which required a Kernel update, which it told me required a reboot and since I wanted to best results possible right now so I could get it working, I decided to reboot. But I thought for some reason that Linux updated the Kernel before reboot and the reboot simply put the changes into affect, like it gets saved to the hard drive and then after reboot, it gets loaded into RAM for actual usage. So when it didn't immediately finish rebooting, I thought something went wrong, but because its headless, and there's no video signal output until you reboot with a screen plugged in and on, then it will just keep negating the video output. So I rebooted with a screen plugged in. Little did I realize what a huge mistake this was. Apparently it loads during reboot, and I interrupted it mid loading. And so I couldn't SSH into it, for some reason it completely escaped me to try pinging it but it's not like that would have changed much. I knew it was running because the motherboard lights and the CPU fan were on. But after many reboots, no screen output still and I couldn't SSH into it at all after many tries. I left it running and went to bed. I think I tried again after I woke up and it still didn't work. I had a friend come over like a few days later I think and he was running through it with me, starting by trying to access the BIOS which I said, hey just so you know, I can't seem to get any screen output just so you know. And there are no keyboard lights either and I tried multiple USB ports too. So I can't tell that it's actually passing POST. But there's no beep code, and I don't recall it ever beeping when booting so I was at a total loss. And first thing when he sat down and had me reboot, he looked up how to access BIOS on this motherboard and started spamming and then just holding down the delete key for my MSI board. And it worked. The SMI logo appeared big on the screen like when it boots, and then it went into BIOS. Typical! It waited till he got here to work fine. 

    I seriously looked into setting it up to always put out a video signal even if there's no screen plugged in because this one screen output problem has caused me trouble nearly every time I can recall there was an issue in the past year and a half since I built this server.  The problem was very simple. In fact, there was no problem. Now that he was here, the screen turned on, unlike before. Now that he was here and we entered BIOS, there was no BIOS setting to fix, boot drive order was fine. We exited without saving and then it booted normal. I checked to make sure I could SSH into it, I could. I checked to see if I could access filed through SMB, I could. Tss! 

    Then about a week later I realized the TEMPer2 sensor came with a CD ROM probably with a driver to load. I thought, oh, well, since my previous attempts to get the sensor working didn't work, maybe this driver will fix the issue. I did find something online I could install through the CLI, but I wanted to be sure I exhausted all other possibilities before I did it because I don't always install things willy-nilly, just to see if it works and then leave it on there if it doesn't, and I try not to at all because it seems the more you install with reckless abandon, the sooner you'll have to reinstall the OS. So if I do, I try to keep it at a minimum. 

    Well, was experimenting with something that required my DVD burner that I haven't needed in years, and it was an internal DVD burner and my current case doesn't have a place to install the burner. I could plug it in with some effort to take the desktop off its VESA mount and unscrew the pack and access the cable compartment in the back and fiddle with the wires and figure out a way to get this thing plugged in, but then I realized I had a SATA to USB 3 adapter with a 12 volt power plug attached. I bought it for other reasons but this should work great, I pulled it out and started using it and then because I used it for this other project, I suddenly realized, hey, might as well put the driver CD in it. So I did, and then started thinking for some reason how to get the driver software transferred to the server from Windows. I imagined all the difficulty I went through a few months ago when I accidentally deleted a whole folder full of recordings I didn't want to lose because they couldn't be replaced, and thanked my lucky stars when I realized this is why I utilize cold storage and not not just my RAIFD 5. So I accessed my IronWolf I use for cold storage, which I back up automatically once a week, and it was a nightmare accessing it just to pull the recordings off of it and put them back on the RAID 5. Since then I have concluded that I should have just created another SMB share straight to the IronWolf, assuming there's no reason I can't do that. As a matter of fact now that I think of it, perhaps I could just set up some sort of mechanism that will automatically undo any mistaken deletes, just revive them from cold storage just like File History on Windows. I looked it up and that is a thing you can do in Linux, I would have to adjust my Cron job for RSYNC to run once a week to then organize backups according to date and create a snapshot. And then you can just CD to a directory for easy restoration. But I want something with easier access that doesn't require SCP. Well, I suppose this would make for a good opportunity to get good at using SCP. 

    So I had this idea over the past week, why am I struggling to find the will power to transfer the files from this CD to my server from my Windows desktop, when I can simply plug the USB 3 adapter into the server for the DVD burner? So I did. And then I was going to work on it remotely when it just didn't work out that way. I am supposed to be studying my butt off to pass y Network + certification these past few weeks so I can take it end of this month. But I had a migraine from a dietary issue I had, which is taking days to go away and it went away briefly after a heavy dose of medicine so I thought, well, this driver issue has just been sitting there waiting for one spare moment, how hard can this be. I mounted it, I explored the contents, and I discovered the driver was in msi format. I started to think this might be an issue because Linux doesn't read .msi, which is meant for Windows. There was a thing I could try but then I thought I would put it down for now and go to bed since it was the end of the day, and then I discovered that my server was totally inaccessible from my Windows desktop I watch movies on before bed. And then I discovered it was totally inaccessible from my Windows laptop too. I could SSH into it no problem, SMB was running, I rebooted my laptop even though I didn't think that would fix the issue because the problem seemed to happen at the exact same time for both Windows computers which is a fantastic coincidence when both are trying to access the same common file share from the Linux File Server, the common denominator. The only thing I know happened was that I mounted the DVD burner in Linux. I looked online to see if that could mess up a file share and the internet said "Yes!" It seemed strange to me that just trying to access a drive could interfere with a share on an unrelated drive. I rebooted the server, nothing. I was out of options and unmounted the drive. That didn't fix anything either. I was just about thinking at this point, well, Robert will come here again and sit down for five minutes just for the server to be like, "What? Misbehaving? Me? You're mistaken!" for the second time. And then when asking ChatGPT about this problem, it suggested rebooting the SMB service. So I did that too.     

    sudo systemctl restart smbd

    sudo systemctl status smbd

    That fixed it, the share worked just fine again! Gah! At least it only took one hour to fix this time. 

This has been Truncat3d 00000000111100010100110______________end of line

Friday, March 7, 2025

2025-03-05 - YouTube fake buffer skip-script

    I have been thinking for a while about creating a script that when I am using YouTube, can tell when YouTube is pausing under the pretense that it's buffering and even shows the circular loading thing on the screen, all just because I want to play the video at a faster speed than 1x. For The Mighty Jingles, I can't watch at a rate any faster than 1.25 without this fake buffer happening about every twenty or thirty seconds or something like that. For Linus Tech Tips I can't watch faster than I think 1.5x without fake buffering happening about every five or ten seconds. For Ryan Hall Y'all, you can watch his live storm coverage videos at 2x, but his cohort, Andy, for some reason you can't watch his on 2x without the fake buffer happening. 

    But in this case, all you have to do is either press skip forward 5 seconds and back again immediately or back five and forward five immediately and it will resume playback at your desired speed. No buffer for another several seconds. And it does it at such a predictable rate most of the time that you can tell this is not a real buffer issue. If I can skip to any other point even one second later or near the end of the video and playback resumes without any trouble, and when it stops playing it shows the circular buffer indicator, then this is just a mechanism intentionally making it look like a buffer.  

    I was going to write a script to do this but under the weight of other priorities, it fell between the cracks. It would have required a lot of extra testing and stuff because I am not aware of fixes already on the internet for this. I wanted to write a script that could tell the video was buffering and automatically skip forward and back again or whatever so I don't have to tend to it constantly myself and waste more time and effort just to do something that should be easy-going. 

    But I realized Chrome had a couple of YouTube extensions that optimize it, so it has buttons or plays a certain way or whatever, adopts some behavior that the website itself does not already enable. I accidentally came across a JavaScript window in Enhancer for YouTube where you can insert any JavaScript code you want to tailor your experience the way you want for YouTube. I wish this was a thing with every service, just install a corresponding extension and here is a window to run your own JavaScript code so it runs client-side the way you want the service to run. 

    This is why we are using JavaScript I assume, because it runs client-side. This is less common these days but everything on the internet used to have to run client side and now I think most of the time if I am not mistaken, most website functionality is handled webserver-side. Including games. Like you process graphics and stuff, but the gameplay is handled server-side I think. But there are benefits to running things client-side, and this is one of them. Hence, why I wish you could just install an extension that works for this service or that one, and the JavaScript window lets yo manipulate it any way you choose to fit your preferences especially if it is client-side. 

    So I had already installed Enhancer for YouTube a few months back to deal with the resolution issue where YouTube automatically throttles back your resolution anytime the wind blows, and the extension didn't fix it. But I still liked features it offered so I kept it. Then I downloaded another extension called Improve YouTube which does maintain resolution, and I was about to get rid of Enhancer for YouTube when I discovered the JavaScript window and changed my mind. I immediately added code into it to act whenever a fake buffer happens. And I tested it for the first time a few days later. It isn't perfectly clean, sometimes it takes five seconds to respond, but the end result is the same, I don't have to touch it and the video keeps playing at least most of the time. The JavaScript code I entered was this:

        setInterval(() => {
            let video = document.querySelector('video');
            if (video && video.paused && !video.ended) {
                video.currentTime -= 5; // Skip back 5 seconds
                video.currentTime += 5; // Skip forward 5 seconds
            }
        }, 3000); // Check every 3 seconds

Just know if you use this the indentation does matter, the first and last lines are not indented, the second and third and sixth lines are indented further and the fourth and fifth is indented the farthest. I just add extra indentation to everything here so the code is clearly separate from my comments. Maybe I should comment out all my comments! Okay so, again, this wasn't played with too much, I just wrote it real quick and inserted it and didn't even have time to play with it. I only tested it a few days later. And it appears to work better than I expected. I am not a coding genius and expect my code to not work at least on the first several times out. But this appears to work on the first try even if it's not clean. If I had to change something, I would try to see if there was a way to optimize it so it acts faster or reacts at the same speed every time but these are things I don't even know if they can be affected by changing the code. I am just really happy at this time that it did work!

    Download the extension in Chrome and once in the extension control panel or whatever they call it, click CUSTOM SCRIPT > and enter the code in the window. Be sure you know what any code you enter into this window does because it could potentially compromise your security or something like that. 

This has been Truncat3d 00000000111100010100110______________end of line

2025-07-10 - BYU Wi‑Fi captive portal troubleshooting

  BYU Wi‑Fi Captive Portal Troubleshooting What happened I had used BYU Wi‑Fi just fine before, but at some point, the captive portal star...