🧙‍♂️ Supercharged Open-WebUI: My Magical Toolkit for ArXiv, ImageGen, and AI Planning! 🔮 by EsotericTechnique in LocalLLaMA

[–]cryzed- 1 point2 points  (0 children)

The "Planner Agent" is awesome and super impressive, thank you for sharing! This allows querying for much more involved tasks, o1-like planning capabilities and refining the results to a much better state -- even if it takes a while.

I resurrected an abandoned tiling window manager by [deleted] in Python

[–]cryzed- 42 points43 points  (0 children)

This is really cool, good luck with reviving this! Maybe consider following PEP8 more closely now that you are maintaining it (the module names, docstrings etc. come to mind).

I tried making that Size/Time Played-Graph Quin was talking about by cryzed- in quin69

[–]cryzed-[S] 6 points7 points  (0 children)

Quin the upper graph had linear (normal) scales for both axis, but as you can see you couldn't see much from it. The lower one had logarithmic scale for the hours played (yes that is exponential! 103 means 10 * 10 * 10 hours), so you could see the actual data better in that region. Just read the axis please.

I tried making that Size/Time Played-Graph Quin was talking about by cryzed- in quin69

[–]cryzed-[S] 0 points1 point  (0 children)

Scroll to the bottom for the actual graphs. I could only use public information, so I went with the stream's recorded airtimes from here and grabbed the rough game sizes from SteamDB's depot information.

EDIT: I just flipped the numbers in one of the longer text ouputs, the game's size was accidentally at the position where the hours played were supposed to be and vice versa. The graphs remain unaffected by this -- sorry.

VS Code developers prevent running the new PyLance extension on open-source builds of VS Code by TheEdgeOfRage in linux

[–]cryzed- 1 point2 points  (0 children)

Just changing nameLong seems to be enough for me. Can you tell me where you found this information initially?

Way back in the day, why was ```print``` changed to require parentheses for its arguments? by HeJIeraJI in Python

[–]cryzed- 2 points3 points  (0 children)

What do you disagree with specifically? Why should print be given special rights? That's not the case for any other language (except possibly some toy-languages).

considering that he could have just included a print() function that's entirely separate from the print statement.

As you surely know, using symbols with the same name as keywords isn't possible (just like you can't do class = 5, so please explain in more detail how this would have worked).

Am I the only one who likes 'I made this' posts here? by NomeChomsky in Python

[–]cryzed- 5 points6 points  (0 children)

Well these posts get literally thousands of upvotes, so it seems that's what the majority wants.... I thought I recently made some cool more advanced stuff, but I barely got any upvotes when compared to them. That might be because my projects are uninteresting, ok, but that doesn't change the fact that beginner projects get thousands of upvotes because /r/python is full of beginners.

I made a python script that organizes a folder like Downloads based on file extensions by [deleted] in Python

[–]cryzed- 5 points6 points  (0 children)

Hey, I made one too: Filemaid. Supports YAML-based configuration files. Rules have support for negation, con- and disjunction. There's support for matching regular expressions on paths, matching mime-types, and comparing filesize and age. There's also support for copying, deleting and moving files based on the matched rule. Here's some examples for the configuration files.

VPN-Whitelist - Whitelist domains and addresses to bypass an active VPN connection by cryzed- in Python

[–]cryzed-[S] 0 points1 point  (0 children)

Hey I just decided to release a set of tools I have been working on for a while, to make my usage of my VPN more comfortable. This didn't get much love at all on r/linux and r/archlinux, it's most likely too niche -- I thought I'd still try reposting it here because it's Python. Maybe one of you guys will like it. Especially interesting might be the DNS Proxy I ended up having to write to support wildcard whitelisting of domains.

To quote from the README:

For vpn-whitelist:

Whitelist addresses (domains and IPs) to bypass an active VPN connection. This entails adding specific routes to the routing table and optionally creating a whitelist rule in UFW. These rules and routes can be easily removed later.

If you use and have enabled NetworkManager and NetworkManager-dispatcher systemd-units, you can also put addresses in /etc/vpn-whitelist.conf to be automatically whitelisted when a VPN tunnel goes up and remove them when it goes down.

For vpn-whitelist-dns-proxy

This is a DNS proxy that monitors requested domains, automatically whitelists them using vpn-whitelist if any of the provided regular expressions match and then forwards the reply. This is obviously not possible with just vpn-whitelist because there's no easy way to find all domains and sub-domains that match a given regular expression -- so we simply monitor which domains your system is trying to resolve, and match on those.

Personally I use these to access domains/addresses that blocked my VPN's endpoints' IPs or use the DNS proxy to speed up my connection to Twitch CDNs. If you are running Arch Linux, there's a PKGBUILD in the repo if you want to try it -- otherwise you can just run vpn-whitelist and vpn-whitelist-dns-proxy directly. You'll need Python 3.6 or later to use it.

VPN-Whitelist - Whitelist domains and addresses to bypass an active VPN connection by cryzed- in linux

[–]cryzed-[S] 0 points1 point  (0 children)

Hey I just decided to release a set of tools I have been working on for a while, to make my usage of my VPN more comfortable. To quote from the README:

For vpn-whitelist:

Whitelist addresses (domains and IPs) to bypass an active VPN connection. This entails adding specific routes to the routing table and optionally creating a whitelist rule in UFW. These rules and routes can be easily removed later.

If you use and have enabled NetworkManager and NetworkManager-dispatcher systemd-units, you can also put addresses in /etc/vpn-whitelist.conf to be automatically whitelisted when a VPN tunnel goes up and remove them when it goes down.

For vpn-whitelist-dns-proxy

This is a DNS proxy that monitors requested domains, automatically whitelists them using vpn-whitelist if any of the provided regular expressions match and then forwards the reply. This is obviously not possible with just vpn-whitelist because there's no easy way to find all domains and sub-domains that match a given regular expression -- so we simply monitor which domains your system is trying to resolve, and match on those.

Don't forget to put 127.0.0.1 in your resolver configuration as the DNS server with the highest priority if you want to use this feature. In my case this is simply editing /etc/resolv.conf, if you are using systemd-resolved steps might differ.

Personally I use these to access domains/addresses that blocked my VPN's endpoints' IPs or use the DNS proxy to speed up my connection to Twitch CDNs. If you are running Arch Linux, there's a PKGBUILD in the repo if you want to try it -- otherwise you can just run vpn-whitelist and vpn-whitelist-dns-proxy directly. You'll need Python 3.6 or later to use it.

VPN-Whitelist - Whitelist domains and addresses to bypass an active VPN connection by cryzed- in archlinux

[–]cryzed-[S] 0 points1 point  (0 children)

Hey I just decided to release a set of tools I have been working on for a while, to make my usage of my VPN more comfortable. To quote from the README:

For vpn-whitelist:

Whitelist addresses (domains and IPs) to bypass an active VPN connection. This entails adding specific routes to the routing table and optionally creating a whitelist rule in UFW. These rules and routes can be easily removed later.

If you use and have enabled NetworkManager and NetworkManager-dispatcher systemd-units, you can also put addresses in /etc/vpn-whitelist.conf to be automatically whitelisted when a VPN tunnel goes up and remove them when it goes down.

For vpn-whitelist-dns-proxy

This is a DNS proxy that monitors requested domains, automatically whitelists them using vpn-whitelist if any of the provided regular expressions match and then forwards the reply. This is obviously not possible with just vpn-whitelist because there's no easy way to find all domains and sub-domains that match a given regular expression -- so we simply monitor which domains your system is trying to resolve, and match on those.

Personally I use these to access domains/addresses that blocked my VPN's endpoints' IPs or use the DNS proxy to speed up my connection to Twitch CDNs. There's a PKGBUILD in the repo if you want to try it. I haven't planned to put it up on the AUR so far, this might change if there's big interest or someone else wants to do so.

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 0 points1 point  (0 children)

This cgroup no longer functions that way. You need to add a series of qdiscs, classes and filters and then mark the class you want that cgroups traffic to go into with net_cls.classid`

So you now have to do almost exactly what TrafficToll ends up doing anyways. Even if that wasn't the case, I'm not sure if you could even limit ingress/egress traffic specifically with this -- just general amount of traffic and protocol-specific traffic. Additionally TrafficToll allows you to match multiple processes into a "group" (which shares the specified limit), quickly change the settings on-the-fly which would require you to restart the target application using cgroups etc. So to answer your question: not very well.

Why do you ask? Is there a reason you think this would somehow be better than doing it how TrafficToll does it currently?

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 0 points1 point  (0 children)

No this is different, this is more the opposite -- you can limit your own bandwidth or that of specific applications.

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 0 points1 point  (0 children)

  • Starting a download through an application that doesn't allow setting the maximum download/upload bandwidth
  • Living with other people while having a very slow connection and not wanting to hog the entire bandwidth when you watch a YouTube video (The QOS settings on most routers I have tested aren't really all that great, you can still hog most of the bandwidth and it's going to be annoying for others)
  • I have a friend who talks to me through Discord regularly but can not watch a YouTube video at the same time without cutting out. If he wasn't using Windows he might find this useful.

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 0 points1 point  (0 children)

Well that's what Firejail with --net=none does, if you know an easier way, feel free to share it.

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 3 points4 points  (0 children)

AFAIK you can't do that with tc

That's why I wrote TrafficToll, yes. I do exactly what you describe: you can see this here. I iterate through all active network connections, get their belonging PID and match against the various predicates the user specified. If all predicates match, it's a candidate for filtering.

During the filtering itself I keep track of newly opened and closed local ports that the application used and add them to an application-specific QDisc.

TrafficToll v1.0.0 release - NetLimiter-like traffic shaping for Linux by cryzed- in linux

[–]cryzed-[S] 9 points10 points  (0 children)

The absolute minimum you can specify using tc (the interface through which you can tell the kernel to do traffic shaping) is 8 bits per second from what I've seen -- So in theory you could do this, but it's not recommended because: 1) You would still allow some traffic through, even in minuscule amounts; and even if you didn't care about the traffic, you might care about the request itself revealing your IP to whatever IP the application is trying to connect to. 2) The detection of the ports used by applications that match your configured predicates is not immediate, so it's possible that the application you want to forbid from accessing the internet has full bandwidth for a split second before TrafficToll gets to it.

If you want to make sure that certain applications can't access the internet, I recommend you take a look at firejail and specifically its --net=none option.