lemmyverse: search lemmy communities from the command-line. Thanks to the data HTTP API from lemmyverse.net! This is not really as polished as I like but, hey, in the interest of having a lively Lemmy I thought I’d share anyway :)...
The admin of lemmyworld said it’ll take time to remove them, but I don’t know why (there seems to be the functionality in the API)
Indeed. Looks like it’s just a matter of a big for loop over each community ID, POST /community/delete with body community_id=1234. Maybe I’ll try to see if it’s possible to get some action on removing them by sending over some Python script or something that does the job. Quick count shows almost 14%(!) of all communities indexed by lemmyverse are those junk communities:
After a day or so, the curve flattens out. This probably explains why we keep seeing posts that are months old in “hot” - if not enough new material is being posted, after the first few pages of “hot”, posts that are 5 days old and 5 months old are essentially the same due to the exponential decay function that was chosen.
That page gives this equation:
<pre style="background-color:#ffffff;">
<span style="color:#323232;">Rank = ScaleFactor * log(Max(1, 3 + Score)) / (Time + 2)^Gravity
</span><span style="color:#323232;">
</span><span style="color:#323232;">Score = Upvotes - Downvotes
</span><span style="color:#323232;">Time = time since submission (in hours)
</span><span style="color:#323232;">Gravity = Decay gravity, 1.8 is default
</span>
My guess is that the “gravity” parameter is the issue at the moment. Something is needed to make the decay less steep, so that really old posts aren’t making it up to the top of the feed.
There might be some way of tuning the gravity parameter dynamically based on how much content is being submitted, perhaps aiming for something like “the average age of the first 200 posts should be 10 days” (I made those numbers up, but the basic idea would be that the time decay should be steeper when lots of content is submitted and less steep when content is infrequent?)
It seems to me that the issue might be that the function returns an integer. If the scaling factor is inadequately large, then floor() would return zero for tons of posts (any post where the equation inside floor() evaluates to less than one). All of those posts would have equivalent ranks. This could explain why we start seeing randomly sorted old posts after a certain score threshold. Maybe better not to round here or dramatically increase the scaling factor?
I’m not sure what the units of the post age would be in here, though. Probably hours based on the division by 3600? And is log() the natural log or base 10 by default?
In any case, something still must be going wrong. If I’m doing the math correctly, a post with a score of +25 should take approximately 203 hours (assuming log base 10) before it reaches a raw rank score of < 1 and gets floored to zero, joining all of the really old posts. So we should be seeing all posts from the last 8.5 days that had +25 scores before we see any of these really old posts… But that isn’t what’s happening.
Hi I am finding it extremely frustrating that the provided docker compose does not work. and documentation is non existent for docker pixelfed installation. Does the internal/external networking ever work? What file/folder permissions I have to set? Please help....
thanks for your reply. This is how it is defined in the docker compose file I used. AFAIK When using the internal network, the ports are exposed to an internal subnet and no port mapping is necessary.
Hello, I’m new to Lemmy and am trying to login to my account through an iOS app. This problem happens every time I try to log in using the correct details (copy and pasted from my password manager) on both Mlem and Memmy apps....
Simple question, difficult solution. I can’t work it out. I have a server at home with a site-to-site VPN to a server in the cloud. The server in the cloud has a public IP....
Is there any solution (program/Docker image) that will take a port, forward it to another host (or maybe another program listening on the host) that then modifies the traffic to contain the real source IP. The whole idea is that in the server logs I want to see people’s real IP addresses, not the server in the cloud private VPN IP.
Not that I’m aware of. Most methods require some kind of out-of-band way to send the client’s real IP to the server. e.g. X-Forwarded-For headers, Proxy Protocol, etc.
If your backend app supports proxy protocol, you may be able to use HAProxy in front on the VPS and use proxy protocol from there to the backend. Nginx may also support this for streams (I don’t recall if it does or not since I mainly use HAProxy for that).
Barring that, there is one more way, but it’s less clean.
You can use iptables on the VPS to do a prerouting DNAT port forward. The only catch to this is that the VPN endpoint that hosts the service must have its default gateway set to the VPN IP of the VPS, and you have to have a MASQUERADE rule so traffic from the VPN can route out of the VPS. I run two services in this configuration, and it works well.
Where eth0 is the internet-facing interface of your VPS.
Edit: One more catch to the port forward method. This forward happens before the traffic hits your firewall chain on the VPS, so you’d need to implement any firewalls on the backend server.
Forgot to ask: Is your server a VPN client to the VPS or a VPN server with the VPS as a client? In my config, the VPS is the VPN server.
Not sure about the netplan config (all my stuff is debian and uses oldschool /etc/network/interfaces), but you’d need logic like this:
Server is VPN client of the VPS:
<pre style="background-color:#ffffff;">
<span style="color:#323232;"> routes:
</span><span style="color:#323232;"> # Ensure your VPS is reachable via your default gateway
</span><span style="color:#323232;"> - to: <vps public ip>
</span><span style="color:#323232;"> via: <your local gateway>
</span><span style="color:#323232;"> # Route all other traffic via the VPS's VPN IP
</span><span style="color:#323232;"> - to: 0.0.0.0/0
</span><span style="color:#323232;"> via: <vps vpn ip>
</span>
You may also need to explicitly add a route to your local subnet via your eth0 IP/dev. If the VPS is a client to the server at home, then I’m not sure if this would work or not.
Sorry this is so vague. I have this setup for 2 services, and they’re both inside Docker with their own networks and routing tables; I don’t have to make any accommodations on the host.
I’ve no experience with Zerotier, but I use a combo of WG and Openvpn. I use OpenVPN inside the Docker containers since it’s easier to containerize than WG.
Inside the Docker container, I have the following logic:
supervisord starts openvpn along with the other services in the container (yeah, yeah, it’s not “the docker way” and I don’t care)
OpenVPN is configured with an “up” and “down” script
When OpenVPN completes the tunnel setup, it runs the up script which does the following:
<pre style="background-color:#ffffff;">
<span style="color:#323232;"># Get the current default route / Docker gateway IP
</span><span style="color:#323232;">export DOCKER_GW=$(ip route | grep default | cut -d' ' -f 3)
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Delete the default route so the VPN can replace it.
</span><span style="color:#323232;">ip route del default via $DOCKER_GW;
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Add a static route through the Docker gateway only for the VPN server IP address
</span><span style="color:#323232;">ip route add $VPN_SERVER_IP via $DOCKER_GW; true
</span><span style="color:#323232;">ip route add $LAN_SUBNET via $DOCKER_GW; true
</span><span style="color:#323232;">
</span>
LAN_SUBNET is my local network (e.g. 192.168.0.1/24) and VPN_SERVER_IP is the public IP of the VPS (1.2.3.4/32). I pass those in as environment variables via docker-compose.
The VPN server pushes the default routes to the client (0.0.0.0/1 via <VPS VPN IP> and 128.0.0.0/1 via <VPS VPN IP>
Again, sorry this is all generic, but since you’re using different mechanisms, you’ll need to adapt the basic logic.
Just to confirm, is the -o eth0 in the second command essentially the interface where all the traffic is coming in? I’ve setup a quick Wireguard VPN with Docker, setup the client so that it routes ALL traffic through the VPN. Doing something like curl ifconfig.me now shows the public IP of the VPS… this is good. But it seems like the iptables command aren’t working for me.
For context, LDAC is one of the few wireless audio codecs stamped Hi-Res by the Japan Audio Society and its encoder is open source since Android 8, so you can see just how long Windows is sleeping on this. I’m excited about the incoming next gen called LC3plus, my next pair is definitely gonna have that.
Are you thinking of the standby timeout? Cause I get static on my speakers on any and all distros when no audio is playing. It always happens after 5 seconds of silence. Kinda infuriating that I have to do this on EVERY SINGLE DAMN INSTALL.
permanent fix is to add the line:
options snd-hda-intel power_save=0
to the file /etc/modprobe.d/alsa-base.conf
For pipewire:
create folder /etc/wireplumber/main.lua.d/ if it does not exist
if you had to create it yourself just copy over the file from /usr/share/wireplumber/main.lua.d/50-alsa-config.lua
otherwise it probably is there already then just edit it
pretty much at the bottom there is a line that says “session.suspend-timout-seconds”
uncomment it and set its value to 0
then reboot
<pre style="background-color:#ffffff;">
<span style="color:#323232;">// Do not delete! Yes, it's not used anywhere in the code, but if it is removed
</span><span style="color:#323232;">// the application crashes and the error code is useless for debugging.
</span><span style="color:#323232;">let f = 'a';
</span>
“Xi Jinping Thought consists of a 14-point basic policy as follows:
<pre style="background-color:#ffffff;">
<span style="color:#323232;">Ensuring Communist Party of China leadership over all forms of work in China.
</span><span style="color:#323232;">The Communist Party of China should take a people-centric approach for the public interest.
</span><span style="color:#323232;">The continuation of "comprehensive deepening of reforms".
</span><span style="color:#323232;">Adopting new science-based ideas for "innovative, coordinated, green, open and shared development".
</span><span style="color:#323232;">Following "socialism with Chinese characteristics" with "people as the masters of the country".
</span><span style="color:#323232;">Governing China with the Rule of Law.
</span><span style="color:#323232;">"Practise socialist core values", including Marxism–Leninism and socialism with Chinese characteristics.
</span><span style="color:#323232;">"Improving people's livelihood and well-being is the primary goal of development".
</span><span style="color:#323232;">Coexist well with nature with "energy conservation and environmental protection" policies and "contribute to global ecological safety".
</span><span style="color:#323232;">Strengthen the national security of China.
</span><span style="color:#323232;">The Communist Party of China should have "absolute leadership over" China's People's Liberation Army.
</span><span style="color:#323232;">Promoting the one country, two systems system for Hong Kong and Macau with a future of "complete national reunification" and to follow the One-China principle and 1992 Consensus for Taiwan.
</span><span style="color:#323232;">Establish a common destiny between the Chinese people and other peoples around the world with a "peaceful international environment".
</span><span style="color:#323232;">Improve party discipline in the Communist Party of China
</span>
In economic matters, Xi Jinping thought highlights the historical importance of state-owned enterprises.”
I am currently trying to keep track of my config files in a repo to be able to get the configa back together easily if/when I change distro, but I am not sure if that’s the best way or if I should be using some tool to help me since I some programs keep preferences in other directories other then $HOME (at least I think so)....
No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.
It has a lot of gotchas and an unstable ecosystem.
A lot of basic stuff is confusing of weird. How do you loop over an object? There’s like five ways. How do you declare a function? There are two very different ways that behave differently, and the new one has like five variations in its syntax that can throw you.
Here’s an example of something that continues to bother me:
What do you think bar looks like? If you thought it had a key of “hello” and a value of “world”, that’s sensible but wrong. It has a key of “foo”. Object keys don’t need to be quoted in JavaScript. If you want the key to be a variable you have to write it like { [foo] : “world” }. Which looks like a list.
There’s a lot of this kind of stuff in the language. Small things that once you know you can work around, but are still weird, annoying, and prone to causing errors.
The standard library historically hasn’t been very good. This has lead to many libraries being maintained by the community. But the community is fickle, and the quality of libraries is not guaranteed.
The standard library was bad at some basic operations, so underscore was created. But then someone made lodash, and most people (but not everyone!) moved to it. But then the standard library caught up some more, so maybe you don’t need either? When you start working on a new-to-you project you don’t know what you’re going to get.
Dates were a mess so momentjs got big, but now that’s deprecated. Move to datefns, which has a completely different interface.
Node releases a new major version every six months. Every six months! Python has been on major version 3 for years and has no plans for a version 4, for comparison. The constant version releases is a potential source for headaches.
In my experience many libraries are kind of fast and loose with major releases, too. It can be a pain to keep up, especially if you have peer deps.
The debugger is kind of bad. Sometimes it will pause but you typically can’t like treat it like a repl. Python’s, for comparison, blows it out of the water.
Many things are async in JavaScript. Sometimes you don’t expect a particular call to be async or you forget, and you have a bad time. The async/await keywords were a godsend. The giant stack of “then…then…then…” was not fun. Combine with the weak debugger and you have an extra bad time. I bet there are a lot of console.log(“code is here”) debug calls out in the wild because of this.
For your actual front end view layer, react is the current hotness. But older projects are still out there with angular, backbone, probably some with just jQuery. React isn’t terrible but how long is it going to be king? What breaking changes are they going to put out in the next version? The ecosystem is unstable.
Also redux kind of sucks. Not a fan of global variables. I think the community has moved on from redux though? Again, the ecosystem is unstable.
In my experience there are many developers who only know JavaScript, and they want to use it for everything. It is the dungeons and dragons of languages. Much like how it is frustrating when your friends want to run a cyberpunk murder mystery in Dungeons and Dragons, it can be frustrating when your team wants to write everything, even your backend, in JavaScript.
We had browser tests at one job. They’re a very synchronous thing. Open the browser, load the page, enter name and password, wait for login. We had all of this written in python working fine, but people wanted to switch to a JavaScript toolset. Sorry, I mean they wanted to switch to JavaScript but there were three different browser testing tools the different teams wanted to use. Because the javascript ecosystem is like that. After a more candid talk with one of the guys I knew personally, he admitted it wasn’t because JavaScript was the best tool but rather he didn’t want to use python.
I can’t authoritatively say this is typical, but in my experience I’ve had a lot of resistance from JavaScript devs using other languages. Again, I think it’s like DND. DND is a unnecessarily complicated game full of exceptions and gotchas. If that’s what you learn first, you probably think everything is like that, and why would you want to go through that again? But of the popular languages/games, javascript/DND are exceptional for their weirdness.
In fact, thinking about it for more than a minute, my current team lead is a JavaScript main and he’s great. Super willing to learn other languages and has never been pushy. So it’s definitely not everyone.
The stack traces tend to be kind of bad. In production shit is probably minified so you might get “error on line 1, column 4737373”. In other contexts you may get a few hundred lines of node_modules to sift through before finding your actual code.
At least jest and (react) testing library aren’t bad. Mocha + chai were annoying. Enzyme is not great. Again, things change rapidly. You might join a company and find they’re still using mocha and enzyme, and switching never gets prioritized. If JavaScript made things better without breaking changes or swapping to an entirely new toolset it wouldn’t be a serious problem, but the standard mode seems to be “fuck it let’s make an entirely new tool”.
The lack of type hints isn’t great. You can use typescript but that’s a whole new set of stuff you have to set up. Python also doesn’t have types but they managed to add them as an option without making us switch to like TypeThon. But that’s not the JavaScript way. If you’re not making a breaking change are you really doing JavaScript?
I could go on, but my cat is getting up to some bullshit and I need to see what he’s screaming about. Probably not JavaScript.
tldr:
standard library kind of bad
ecosystem unstable and of variable quality
unpleasant personal experiences with JavaScript developers wanting to use it for everything
<pre style="background-color:#ffffff;">
<span style="color:#323232;">Lol I was listening and intently considering what you had to say until this
</span><span style="color:#323232;"> point.
</span>
Figured I’d ask to see if you know if this method is still working? I have mine setup very nearly identically to what you have here, and I have corrected my lemmy.hjson to have the correct hostname and password for the database. The only changes I have made thus far is to remove the HTTP redirection, and to change things like me cert resolver, the Lemmy version, and other small corrections.
However, all I am getting is a gateway timeout when I try to visit the url I have setup. Do you have any idea why this might be? I’ll provide my docker-compose below.
In one of the updates, I noticed in the traefik dashboard that traefik was forwarding to a different port. So I added the following label in my web labels:
lemmyverse: find communities from the command line (git.sr.ht)
lemmyverse: search lemmy communities from the command-line. Thanks to the data HTTP API from lemmyverse.net! This is not really as polished as I like but, hey, in the interest of having a lively Lemmy I thought I’d share anyway :)...
How does Lemmy decide what goes in the hot feed?
Title.
Anyone hosting pixelfed using docker?
Hi I am finding it extremely frustrating that the provided docker compose does not work. and documentation is non existent for docker pixelfed installation. Does the internal/external networking ever work? What file/folder permissions I have to set? Please help....
Does anyone know how to solve incorrect_login when logging into Lemmy?
Hello, I’m new to Lemmy and am trying to login to my account through an iOS app. This problem happens every time I try to log in using the correct details (copy and pasted from my password manager) on both Mlem and Memmy apps....
Proxy to TCP port with real IP
Simple question, difficult solution. I can’t work it out. I have a server at home with a site-to-site VPN to a server in the cloud. The server in the cloud has a public IP....
thank you Linux for giving a damn about Bluetooth headphones (feddit.de)
For context, LDAC is one of the few wireless audio codecs stamped Hi-Res by the Japan Audio Society and its encoder is open source since Android 8, so you can see just how long Windows is sleeping on this. I’m excited about the incoming next gen called LC3plus, my next pair is definitely gonna have that.
Alphabetically sorted months. But WHY? (lemmy.ml)
China mandates that AI must follow “core values of socialism” (www.theverge.com)
China has released new guidelines on generative AI services, limiting their public use while encouraging industrial development....
What's the most toxic game community you know of?
The most toxic communities I know of are the Genshin community, Payday 2, FFXIV and source games communities in general.
Distro hoppers, how do you manage your config files?
I am currently trying to keep track of my config files in a repo to be able to get the configa back together easily if/when I change distro, but I am not sure if that’s the best way or if I should be using some tool to help me since I some programs keep preferences in other directories other then $HOME (at least I think so)....
Programming Languages (lemmy.ml)
No offence
Every time you click on this link, it will send you to a random Web 1.0 website (wiby.me)
When you have to update the server (pawb.social)
Personally I prefer `throw new nullpointerexception` (pawb.social)
Hosting Lemmy with Traefik as a reverse proxy
cross-posted from: lmmy.tvdl.dev/post/259...