Greg's Computer Stuff!

Yeah back on Windows XP everything just kinda worked, but now on newer Windows nothing works!

2 Likes

Recently I got pissed at Youtube again not showing the Notifications for my Subscriptions despite ringing the Bell and everything, so I decided I will write something that does it for me.

First I grabbed all the Channel Page Links I could get (except for the 10 that this wont work for)

Then I added the argument for making an Archive of already downloaded Links to keep track of:

 --download-archive "~/Documents/Scripts/downloaded.txt"

And an Argument for stopping the Check after 24 Videos:

 --playlist-end 24

Now the Script will download the 24 most recent Videos from the Channel Page, but clearly I dont wanna download 24 of the videos I already watched, so I needed to be a bit tricky and changed this:

 -o "/data/Downloads/%(title)s.%(ext)s"

to this:

 -o "~/Documents/Scripts/dummy.txt"

And added an empty dummy.txt File to that Location, so now the 24 most recent Videos will be added to the List of Links it already downloaded, because youtube-dl thinks the File is already done.

Then I changed it back to the actual Location, since all Videos were marked as Downloaded now.

Now the Script, whenever I press the Macro Key on my Keyboard for it, will automatically download all new Videos regardless of what Youtube thinks I should be notified about, and that at the Resolution I want them to be (unlike what the Youtube Media Player often does).

But there was more, Videos that go at 240p get throttled by Youtube, which is ofcourse slowing down this entire Script. Adding this Argument fixed that though:

 --http-chunk-size 10M

Though one problem was left, there is Channels where I want 360p Videos for one Type of Content and 240p for another Type. Mainly in case of TeamFourStar, so I needed to use a Regex so the DnD and the Fan Art Streams were downloaded at a higher Resolution.

 --match-title "tfs.at.the|fan.art|fanart|inktober"

And then follow the 360p Regex Filtered Line with a 240p Unfiltered Line, which thanks to the Download Archive that keeps track of downloaded Videos will not repeat downloading the 360p Video.

youtube-dl "https://www.youtube.com/channel/UCyfG7-7lPhf6EIC6igUOfzw/videos" -if "best[height<=360]" -o "/data/Downloads/%(title)s.%(ext)s" --restrict-filenames --retries infinite --console-title --download-archive "~/Documents/Scripts/downloaded.txt" --playlist-end 24 --http-chunk-size 10M --match-title "tfs.at.the|fan.art|fanart|inktober"
youtube-dl "https://www.youtube.com/channel/UCyfG7-7lPhf6EIC6igUOfzw/videos" -if "best[height<=240]" -o "/data/Downloads/%(title)s.%(ext)s" --restrict-filenames --retries infinite --console-title --download-archive "~/Documents/Scripts/downloaded.txt" --playlist-end 24 --http-chunk-size 10M
3 Likes

So Youtube recently removed the 3gp Formats from almost all Videos, some ancient Videos still have it, but anything less than a year or two old doesn’t have it anymore afaik. This makes the 240p Option impossible to get without splicing Audio and Video together after downloading.

Ofcourse I do want to save on Bandwidth and Drive Space, so I decided to setup Values for that on most of the Channels.

-f "bestvideo[height<=240]+worstaudio/bestvideo[height<=360]+worstaudio/best[height<=240]/best[height<=360]"

This (if ffmpeg is installed, and only for Videos on Youtube) will download the 240p Video and the “worst” or actually smallest possible Audio Track and mix them into one small Video, as opposed to me being forced to use the 360p with “good” audio that is about twice as large or more in the end.

Ofcourse it has a fallback to the 360p Version in case things are broken.

1 Like

Which is pretty simple to do with ffmpeg if you want to go that route. :slight_smile:

1 Like

I already do, that’s what the script does. :stuck_out_tongue:

1 Like

You did not expect me to post anymore on this Thread did ya? Well I consider this the “random stuff about my non-Pi Computers”-Blog-Thingy so here I go!

When I decided to move my Network Switch one meter to the left and install Pi Hole onto my Pi 4B, I was curious on how well the Gigabit Networking works. Turned out, it did not. So I went to testing out all the Connections.

First I thought the Cisco Switch must be borken. Nope it works fine.
Then I thought maybe the PoE HAT on my Pi 4B reduces the data that can be transferred over Ethernet. Also Nope, that works just fine.
Then I actually used mii-tools to see how the connectivity runs through the Network and somehow my zbox ran at 100MBit/sec at half Duplex, despite having a Realtek Gigabit Network Card.
Turns out autonegotiate is somehow OFF, meaning Debian just defaults to this bad setting. But why is it OFF? It should be ON by default at normal circumstances. Something isn’t right.
But turning that ON does only work when I manually do it after logging in. Clearly running a sudo command on startup manually is a PITA. So why the fuck does it not work when I put it into my /etc/rc.local to run during boot regardless of who logs in?
Well guess what the Realtek Driver does when you log in. It renames eth0 and eth1 to enp2s0 and enp3s0. So my Boot Script (and probably the OS too) ofcourse doesn’t work, if it references those two instead of eth0 and eth1, meaning I need to take both names into account in the Script and now everything works at Gigabit Speeds, I think. I got it to like 400-500MBit/sec with VNC and KDE Connect combined, so I guess it actually works.

Here is the Script I am using in /etc/ in case anyone would ever need it to fix their Zotac zbox or other Realtek Network Cards.
rc.local (223 Bytes)
P.S. yes I know rc.local is NOT the way to properly run root stuff at startup, but the legacy still works for me, and is far easier to setup than a proper service and everything.

Also nice is that the Pi now actually uses PulseAudio and I can use the “paprefs” command to setup Networked Audio to my Main Computer, so the Pi actually emits Sounds over my Speakers. It is super easy to setup, due to spawning a GUI for it instead of requiring arbitrary parameters.
Just dont use it for HD Audio from a Pi, sure it only uses 2MBit/sec but it stutters for certain things. It did work fine when I used it for my slightly faster Laptop to stream Factorios Audio to my Speakers, and I did not notice any stuttering there.
And yes, everything on my Network has access to my Sharkoon SB1 Soundcard and therefore my Speakers. I by the way don’t run anything over Bluetooth or WiFi, everything is wired.

Did I also mention I hate flimsy DisplayPort Ports? Just a little jiggle on the Cable and everything fucks up the Widgets on my second Screen…

2 Likes

A proper service is a very short and simple text file that you drop in the right location then systemctl enable blah it. ^.^

1 Like

The problems I have with that are simple, whenever I looked up an answer to my question, all answers said “just register a service” WITHOUT TELLING HOW TO DO THAT PROPERLY. They only gave half the solution to registering a Service, or worse, a Solution for OLDER Systems, that doesn’t work for me.

This is why I chose the Solution of “just drop a technically deprecated File with all my Stuff into there, that no program would ever use nowadays, and everything is safe”

1 Like

Well for future reference, what you were trying to create was a oneshot service, I.E. it runs a command when triggered (which for you would b e when the, say, network service is loaded, or when you manually systemctl start blah it) then stops.

First google result seems decent:

Although making the bash script is useful to keep things separated well, it’s entirely unnecessary for note, the service itself can call whatever it wants without it so if you have something super simple then meh, lol. You can leave out things like the teardown (ExecStop line) if you don’t need it, etc… etc… Keep the RemainAfterExit=true line for oneshots so it thinks it worked. You’ll want to uncomment the line in the above example of #After=network.target to After=network.target to auto-trigger on the network load being done

This page is pretty descriptive if you want to know what lines do:
https://www.freedesktop.org/software/systemd/man/systemd.service.html

1 Like

I feel stupid now. Due to another Pi Zero related Project I am gonna write about once it is done, I had to share my Network over USB, so far so good.
There I noticed buried in my fucking Network Settings “100 MBit/sec Half Duplex” meaning the default Network Settings of the Version of Kubuntu that I was using (at the time at which I installed it), dictated this slower speed, and my now completely useless rc.local File overwrote them later in the cycle.
This is clearly fixed in later versions of Kubuntu as it works on my Pi 4B just fine. It was just human Error and a random Bug I guess…

Well, back to trying to make a Pi Zero into a USB Device, before I go buy the Board that gives it a Male USB A Plug for 5 Bux (and another Pi Zero W, because I dont want to waste the one with the soldered on GPIO Pins I bought last year).

1 Like

So reading my most recent post here, yeah the Pi Zero Project did not work out like i hoped it would (USB Storage + WiFi in one thing). I can do USB Storage, I can do WiFi, but i cant do both at the same time!

But now for the reason I am actually writing this Post! So ever had the Issue that Dropbox, iCloud, Google Drive and similar File Sharing Solutions behave increasingly bad towards the End User?

What if I told you, you can easily share Folders between People and/or your own Devices without even having a Server to host them on, and without making any sort of Account whatsoever? All that is needed is that both Devices are “online” at the same time, but it does not even have to be over the internet, it can also be just the local network!

I tried out Syncthing in various common configurations and so far it behaved really well and always made sure I dont just randomly lose Files, without spamming the ever loving crap out of every action that I take, in an attempt to scare me into staying with some paid corporate Service!

And it does not even need you to port-forward or anything, it just works, and does so on pretty much all operating Systems and Smartphones.

Here are some practical things you might want to know:

  1. Setup Syncthing to autostart with this being the command to launch it “syncthing -no-browser”, so it wont just pop up a Browser Window (with the Syncthing User Interface) every time you reboot your system. The User Interface also has a Setting for it somewhere.

  2. Just remove the Default Folder, you wont need it, you should just put a Folder where YOU want it to be located and declare that Folder as a brand new Location to sync.

  3. Once a Sync Location has been set up you CANNOT change its unique ID or the Folder Path anymore, if you want to change the Path you have to remember the unique ID and make a new Sync Location and paste that unique ID into it, and then remove the old Sync Location. It is a safety thing because changing the Path can mess with things.

  4. Syncthing does NOT follow Symlinks, but it does copy Symlinks as is (unless you are on Windows, where Symlinks are not supported by Syncthing). This is a really important safety Feature. But if you dont like that, you can always “reverse Symlink” something! (which means moving the real location of the linked Folder and symlinking the original location to the new one)

  5. If you install Syncthing using apt-get make sure you actually add their PPA because older Versions (and i mean like half a decade older) do not like linking up with newer Versions. Found that out when trying to have a shared Folder with someone.

It is working great and was really easy to set up, I primarily use it on my local Network and so far it has not eaten any of the metered Bandwidth from my ISP.

For example I have set it up to share my Music Folder in Send Only on my Main Machine, and then declared the PRE-EXISTING Music Folder on my GPD-WIN-2 as Receive Only for that Sync.
It detected all matching Files and it detected a bunch of not matching Files (I recently renamed the majority of my Music Files), but it KEPT the non-matching Files and just offered me a non-intrusive Button in the UI to Revert Local changes (aka delete the non-matching Files), and after hitting Confirm it just worked!

I cant believe that something this simple and obviously working, is fucked up so badly by companies trying to sell you synchronizing Folders!

I only got pointed out to this existing by @OvermindDL1 linking me this Post by an Apple User complaining about how fucked up Dropbox and iCloud are: Computers as I used to love them @ tonsky.me

1 Like

Is it only a single connector shared for both those tasks? Or what’s up? Can they be swapped back and forth enabled/disabled in software if they can both be connected?


Syncthing is awesome, I didn’t know greg didn’t already know about it or I would have introduced it sooner, lol.

Yeah, symlinks start to bring up issues like “what happens when a file is synched back on it, does that update what it points to or does it just replace the symlink, etc… etc…”, lots of issues to consider, especially with security (what if someone sends a symlink that points to your password database, and then reads that back?!). Better to do it as it is as it is safe!

Because their sync tool isn’t the product, you are, you are how they get money, so they encourage subscription subscription subscription, lol. FOSS tools only!

1 Like

eclisple is ancient… unlucky you can’t use intelliJ idea because it is just a better option

3 Likes

I could use IDEA but some of the things I have set up and gotten used to for Minecraft are kinda bound to eclipse. But hey everything else is gonna use IDEA, lol. Did not expect someone to reply to the oldest post in this Thread, I only renamed it. XD

2 Likes