sga

joined 5 months ago
MODERATOR OF
[–] [email protected] 1 points 11 hours ago

WoW64 is a Windows subsystem for running 32-bit stuff on 64-bit Windows. You’re talking about Wine’s implementation of WoW64 - there’s the old one which needs 32-bit Linux libraries and the new one which doesn’t.

I do know about this. to be specific, wine team since 9.0 stablised using there newer wow64 stuff (iirc, this was one of the blockers to use wine on non x86-64 architechtures), and since then, there has been aur package to play around it. I used to only use it, but receently i wanted to download a game, and faced this bug. then I reverted back to normal arch package which is in multilib repo and depends on lib32-*. Now the main arch package is using the newer wow64 implementation.

I did hint at the the fact that I did not find much in logs. I have not checked the verbose logging (which shows each dll involved, each bit of memory read, etc), but with regular logging,


0130:fixme:win:WINNLSEnableIME hwnd 00010108 enable -1: stub!
0158:err:environ:init_peb starting L"C:\\users\\sg\\AppData\\Local\\Temp\\is-SE85P.tmp\\FlushFileCache.exe" in experimental wow64 mode
0158:fixme:ntdll:NtSetSystemInformation (0x00000015,0x40bb84,0x00000024) stub
0158:fixme:ntdll:NtSetSystemInformation (0x00000050,0x40bba8,0x00000004) stub
0170:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION

these are the only lines that come when actual installation starts. The installer stays stuck at at some percentage (varies depending on total game size, and size of compressed binaries)

I think it is related to freearc decompression, because at this point in installer, the various .bin files (the compressed files are named like fg-*.bin, where * is some number, they are FreeArc archive files) are decompressed when using older wine version, with this, they are just stuck. I can not C^c the proceess, I have to pkill all the running wine processes. There is something related to wine written in fitgirl faq, which also hints at replacing the dlls for this, but that does not work for me

[–] [email protected] 2 points 13 hours ago

it is not caching related, it happens for a game installer of size 100 mib, and i have plenty of ram (24 gb)

[–] [email protected] 4 points 14 hours ago

bottles uses its own version of wine (i think it is called something like soda) which is older and would probably still have lib32 stuff. I prefer distro packages.

 

For me, fitgirl installer does not work with wow64 (where you do not have to install 32 bit libraries). I had earlier also tried with wine-wow64 package from chaotic aur repo, and it did not used to work back then, and now arch linux has made the default wine package wow64 version. This has benefits (smaller package size, you can disable mulitlib repo, etc), but now installer does not work. It gets stuck as soon as any decompression is about to begin. And to me not much is clear. My guess is the freearc compression that fitgirl uses, its decompressor does nto work in wow64. Has anyone else tried for whom it works? Maybe I have to add a separate dll for this and create a override. Fitgirl faq does not mention it (probably since wow64 is still relatively new).

If this is not a right community for this, then sorry, I do not know of a better one. (wine team would not handle requests related to pirated installers, fitgirl or related communities in general do not do linux much, and of them, only a small fraction would be using wow64)

For testing purposes, You can grab almost any installer, I went and sorted by size (smallest first) and got it, and it does not work. (I am not going to provide link here for somewhat obvious reasons)

[–] [email protected] 1 points 15 hours ago

thank you my heart

[–] [email protected] 1 points 15 hours ago

ribs shall be mine

[–] [email protected] 5 points 1 day ago (2 children)

keep flying my kiddo

[–] [email protected] 5 points 1 day ago (2 children)

you never let me down. I have let you down by not being there with you when you were down

[–] [email protected] 8 points 1 day ago

miss you too my son

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago)

I do not think it is a good idea to prepare a vm image and install it as iso. it can be done afaik, but not a great idea. Assuming he (your dad) already has a ubuntu system (presumably some lts, i am asssuming something like 1604, 1804 or 2004) then it is easier to just upgrade the system. I know you said that he has forgotten to upgrade, so i would ask him to somehow send you a photo of what he has installed right now (can be hard, but maybe just asking what animal is present on the wallpaper (if he uses the default one that ubuntu uses) can help. even look of top bar or icons can help to get the age. Afaik, ubuntu upgrade paths are relatively stable, so once you know what version he uses currently, then you can install that version, and upgrade it to newest install on your system and record instructions. This would be long and tedious task. I do not use ubuntu, so i do not know what jumps can be taken (i know you can jump from 1 lts to another, something like 1804 to 2004, but can you jump 2 lts versions? some ubuntu forum or wiki post can help regarding this). Once you complete upgrades, you can record instructions and send them.

This can be a easier for following reasons -

  • he would not have to plug in usb and boot into installer mode - this can be hard if he does not know what key to press, or if he does not press it fast enough

  • you would still be using some standard installation, rather than your "custom" iso - not a big thing, but upgrades are more certain in a standard installation

  • ubuntu has snaps - I am not a big fan of snaps, but it is a good thing for likes of your dad, who would prefer to have there apps (like web browser) auto updated in background. Mint has flatpak, but by default stuff is installed as deb packages, upgrading them requires sudo password, which can be hard for your parent.

the virtual image is much larger than iso, because it is uncompressed. Isos are you compressed by something like squashfs, which prepares something like a tar or zip file, which is also mountable. Also your intial virtual file system allocated size might be larger (which would largely be empty, this would be "sparse" file). From my prior experience, you can sometimes have sparse file errors, which can cause errors at bootup, these can be benign, but may seem strange to your father.

Someone else mentioned, you can also possibly install it on a laptop, and then ship that to your father, or buy a prebuilt laptop with linux preinstalled. Nowadays, some big brands like hp/dell/lenovo also have options in there build configurators to select the operating systems, and there are also linux specific vendors (more expensive). But this option in general is expensive (because there is a laptop cost).

Also, where does your father live? If he lives somewhere maybe close to me or someone you know who can go and upgrade / install new system for him. This can be hard for logistaical reasons, or you may not be able to find someone trustworthy.

[–] [email protected] 8 points 2 days ago

posteo is what i am using. Upsides - reasonably cheap (12 euros per year), downsides - no custom domains

 

lemm.ee instance is shutting down of 30th june, so we would have to migrate to some other instance. form more information, please check [email protected]

27
submitted 3 weeks ago* (last edited 3 weeks ago) by [email protected] to c/[email protected]
 

For more context look at the following posts

Look up what "Uplifting" means - https://lemmy.world/post/30071584

also I made a post some time back - https://lemmy.world/post/28597945

For voting - I will not use the post upvotes and downvotes as the vote, and instead, vote on the comments which are highlighted (spoken as moderator, in case your ui does not show them differently, just sort the comments by oldest).

This will essentially remove the votes of people who did not bother reading this line (I have no problem with someone being busy, and one may not have time to read) but someone who just reads titles and moves on is not really even caring about what community a post came from, and may just treat it is a post from news community. This is inspired somewhat by someones comment of thee first linked post, where they said they upvoted stuff but did not pay attention to what community they belonged to (I am not hating on them, actually it is great of them to admit what they did, which in itself is not wrong).

 

Ask anything you would consider too vague or too stupid. It is not supposed to be very refined or thought through, it can as well be a string of random symbols, just tell us how to read them. Consider it a very serious questions community, where questions most definitely are not serious, or the other way round. WE APPRECIATE ABSURDISM. WE APPRECIATE CREATIVITY. WE THRIVE ON ANSWERING GENUINE CURIOSITY!

These could be questions which you think a 5 year or 10 year old would ask, but you are not 5/10 year old and you don't have anybody to ask.

Rules:

  • Standard Netiquette reference - TL;DR - just be civil

  • Lemmy Instance Guidelines - TL;DR - just be civil

  • Post format is simple - it should be a question. You can add additional context to your delight, for example, what do you expect the answer to be, or how do you think one should try to answer it. Questions can be any any language (preferably english) but do what you like, just tag the post appropriately (you can select language while creating post). NSFW is fine as well, but please tag appropriately.

  • Stupid in a general sense - Ideally questions should not be stupid because they use fancy words. For example, if someone asks - why do we not use ferritic steels in cold temperatures? This question is stupid to all metaallurgy people because almost all of them know of ductile to brittle transition. But how many of us are metallurgists? (or have taken some crystal structure courses). They can be niche, we are not against questions that only some of us understand, but if you think the questions are too specific, give us additional context. WE ARE WELL SERVING SERVERS!

  • Academic Integrity - try to answer questions just the best way you can. if you think a alphabet is good, just do it, if you think.

  • New Rules maybe added in future - to which all of you also agree to while creating any post. YOU MUST OBEY A CONTRACT INDEFINITELY. BY POSTING/COMMENTING, YOU ARE CONSIDERED TO BE AGREEING THIS CONTRACT. IF YOU FAIL TO UPHOLD TO THE CONTRACT, YOU SHALL SACRIFICE YOUR FIRST BORN CHILD OR BEAR THE CONSEQUENCES OF ENRAGING THE GODS WHO SHALL PUT A CURSE OPEN THOU (or the subsequent ones in case you already sacrificed one, we are accepting in that sense, we would not be cursing your lineage/subsequent lives and stuff. If you do not have kids, then have them. The kid should be born or Feb 29 of any year, and must be 32 years and 42 days old at the time of sacrifice. Please do remember to contact us for the birthday parties, we can bring the best food and entertainment (rated the 17th best party organiser, by my friends list of - best birthday organisers who were born on 29th feb). Also, most of the blessed servants of god (read moderators) are very kind, and can "pardon" your crimes, for appropriate gifts).

 

(Cross posting from [email protected] https://lemmings.world/post/25535229)

A brand new sentence is a sentence which we consider to have never been spoken or written, or thought of (at least the ones which are not recorded). And just swapping a noun with another noun (for example a name of a place or person) while may techinically be considered new sentence, it is not really matching the spirit of brand new sentence.

for the linguists, can you try to come up with a better estimate (better than just coming up (all the words)^(to the power average sentence length)). Maybe by using the description of using different forms of verbs (like we consider in NLP) (verbs which take DP, CP), then adding standard adjectives and finish with remaining grammar (sorry if I am getting it all wrong, it has been a while since I took my intro to linguistics class). Also, consider a morpheme less form. This exercise is for a more realistic guess.

 

A brand new sentence is a sentence which we consider to have never been spoken or written, or thought of (at least the ones which are not recorded). And just swapping a noun with another noun (for example a name of a place or person) while may techinically be considered new sentence, it is not really matching the spirit of brand new sentence.

for the linguists, can you try to come up with a better estimate (better than just coming up (all the words)^(to the power average sentence length)). Maybe by using the description of using different forms of verbs (like we consider in NLP) (verbs which take DP, CP), then adding standard adjectives and finish with remaining grammar (sorry if I am getting it all wrong, it has been a while since I took my intro to linguistics class). Also, consider a morpheme less form. This exercise is for a more realistic guess.

1
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Ask anything you would consider too vague or too stupid. It is not supposed to be very refined or thought through, it can as well be a string of random symbols, just tell us how to read them. Consider it a very serious questions community, where questions most definitely are not serious, or the other way round. WE APPRECIATE ABSURDISM. WE APPRECIATE CREATIVITY. WE THRIVE ON ANSWERING GENUINE CURIOSITY!

These could be questions which you think a 5 year or 10 year old would ask, but you are not 5/10 year old and you don't have anybody to ask.

Rules:

  • Standard Netiquette reference - TL;DR - just be civil

  • Lemmy Instance Guidelines - TL;DR - just be civil

  • Post format is simple - it should be a question. You can add additional context to your delight, for example, what do you expect the answer to be, or how do you think one should try to answer it. Questions can be any any language (preferably english) but do what you like, just tag the post appropriately (you can select language while creating post). NSFW is fine as well, but please tag appropriately.

  • Stupid in a general sense - Ideally questions should not be stupid because they use fancy words. For example, if someone asks - why do we not use ferritic steels in cold temperatures? This question is stupid to all metaallurgy people because almost all of them know of ductile to brittle transition. But how many of us are metallurgists? (or have taken some crystal structure courses). They can be niche, we are not against questions that only some of us understand, but if you think the questions are too specific, give us additional context. WE ARE WELL SERVING SERVERS!

  • Academic Integrity - try to answer questions just the best way you can. if you think a alphabet is good, just do it, if you think.

  • New Rules maybe added in future - to which all of you also agree to while creating any post. YOU MUST OBEY A CONTRACT INDEFINITELY. BY POSTING/COMMENTING, YOU ARE CONSIDERED TO BE AGREEING THIS CONTRACT. IF YOU FAIL TO UPHOLD TO THE CONTRACT, YOU SHALL SACRIFICE YOUR FIRST BORN CHILD OR BEAR THE CONSEQUENCES OF ENRAGING THE GODS WHO SHALL PUT A CURSE OPEN THOU (or the subsequent ones in case you already sacrificed one, we are accepting in that sense, we would not be cursing your lineage/subsequent lives and stuff. If you do not have kids, then have them. The kid should be born or Feb 29 of any year, and must be 32 years and 42 days old at the time of sacrifice. Please do remember to contact us for the birthday parties, we can bring the best food and entertainment (rated the 17th best party organiser, by my friends list of - best birthday organisers who were born on 29th feb). Also, most of the blessed servants of god (read moderators) are very kind, and can "pardon" your crimes, for appropriate gifts).

Answer Questions never been answered before (probably because they have never been asked)

-6
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Before beginning, I know this is not apprpriate question, and there may be better places to ask these questions. I also know that I as a mod am kinda abusing my powers 9not pinning the post, but still breaking the 1 important rule - to post a uplifting news, and this post is neither upliftiing nor a news. I also do not know how it is decided in other communities, I am a relatively new mod, so I do not know how to act in certain situations. But by the powers that have been vested to me by the gods (previous mods), I want to ask a lot of questions.

Also for the time being, lets say the world has 2 major groups, martians, and venusians, there are other minority groups too, but if funded govts can not bother to listen to them, how can i, a under paid corrupt mod do that. (/s just in case people do not get it).

What I am basically asking is, is please help me make a 'constitution' (for the galactic rulings, obviously) on how should I (or maybe others if they choose to accept it) moderate, certain galaxy.

More seriously, please help discuss democratically, what should be the rules. To you questions may seem to have obvious answers, they did to me too, but what was not obvious, that different people have different obvious things (mind blown /s). And you all will get a chance to be "immortalized" by getting your name in the constitution drafting committee.

  • What deserves a deletion of content (a comment or a post)?

-> my current understanding -> anything that breaks obvious rules. Lets say a martian, non sarcastically says - all venusianns are morons, illeterate wild animals who do not deserve to live. I would consider this as hate speech, and delete it. If someone posts something nsfw, but does not mark it appropriately, i should delete it. But what if someone posts something stupid - lets say someone thinks venusians have seven legs, when they actually have 4, and say, i want all 7 legged venusians to die. What should i do - should i upvote it, considering it is a attempt at humor, and support them, or delete it since they are still killing "hypothetical" venusians, or ignore them (that is what i have been doing right now for some reports)

  • what deserves a ban?

-> similar to prior, so not explaining any further. Sometime back, i had a discussion with another mod, that we should have a strike system - something like, post hate speech 3 times, or something alike, then we ban, because you were given ample chances to figure out that you are doing something wrong (there comments would still be deleted, they would still get the downvote beating, just not a instant ban)

these questions were general, and not community specific, but following are

there are going to be lots of situations, to which you have to vote yes or no, is it uplifting or not (you are welcome to write 20 para replies too, but atleast 1 letter is required, something like 1 y, 2 n)

  1. a female dog gave birth to ten little cubs

2a) cure to cancer has been found, and the researchers have patented it, and selling it for 1 million usd (for each patient) (and i know there is no 1 single cure to cancer, consider a hypothetical situation)

2b) cure to cancer has been found, and they make it free for all

3a) linux market share grows by 5 times, used by 30% of desktop users

3b) microsoft windows is now open source

3c) apple makes all their hardware designs open

Also, for the following part - any resemblence to reality is purely coincedental and unintended, i do not even live in mars or venus to know much about their politics. 4) (this question requires context) - We all know about the martian leader, he is currently leading everyone, some martians love him, others are ok with him, but he absolutely hates all venusians, and does not even acknowledge existence of saturnians, and calls them confused folk (because saturnians wear rings on them). He lies, he robs, he takes away the very last saved bite you keep while eating the food (the best bite™).

4a) the martian leader is defeated in a peaceful manner

4b) the martian leader has been taken down in a millitary coup

4c1) people march to martian leaders door, and he leaves under pressure

4c2) people march to martian leaders door, and he leaves after a bit of riot (a "few" people become "martyrs")

4d) the martian leader today opened amusement park

4e) the martian leader finds cure to cancer, and makes it free

4f1) martian leader is sad because his house has been a lot less "dusty" lately (he loves sand, because it coarse, rough, and gets everywhere)

4f2) martian leader is sad because his house has been a lot more "dusty" lately (he hates sand, because it coarse, rough, and gets everywhere)

4g) he is sad because his dog died

4f) he is sad because his business is making less profits.

I will not reveal my answers here, not to bias you people, but i would leave my general strategy in the spoilers section below

spoiler

To me something is upliftng, if i can tell it a youngling, a growing learning mind. Their brain is pure, maybe not ready to comprehend the vast world. To them, there are only simple rules - you see someone injured, you dress them. You see someone crying, ask why, if you can not help, ask someone else, and so on. This should be enough to get most questions answered from my perspective

 

Many people might already be knowing this, for example people who use custom keyboard layouts, or people using different keyboard layouts, other than US, which most manufacturers and operating system and desktop environmnets use as default.

Most of my applications use vi like bindings, so pressing shift + ; to get : was a bit annoying, and so i was trying to find a way to swap them, and while doing so, I added most of greek alphabet, makes my technical writing a bit more easier (instead of doing $alpha$, I can do alt + a to get $α$), If you use TeX, then you can use #XeTeX to enter unicode, I use Typst, so I can directly use them, and they are used appropriately in text and equation mode. This also is helpful if your notes system does not have some math mode rendering (like plain markdown, without any katex).

If you are multilingual, but don't write much in the other language, this approach works well, if you write comparable amount in both languages, then you should consider setting a keyboard shortcut in you DE/WM config to switch the keyboard layouts

The following procedure is linux specific (or maybe other posix systems too, if they use xkb to manage keyboard stuff (this also works on wayland)), but I am sure windows and macos will have something similar (though i have not bothered to check for it, sorry for that). This does not work as a daemon sitting in between, this is using the standard way to modiify keyboard layout.

You can start by making a file like the following, and you can start with /usr/share/X11/xkb/symbols/us (or the base language of your choice, for most european language layouts, base is /usr/share/X11/xkb/symbols/latin). You have to save it in the /usr/share/X11/xkb/symbols/ directory (in my case, my original file is in config dir, and I have symlinked it to /usr/share/X11/xkb/symbols/us-custom). For list of valid symbols (most of unicode, the thing we want is the correct names) please refer /usr/include/X11/keysymdef.h. You can choose what modifier you want to use with include "level3(ralt_switch)" - I am using right alt as the third modifier, so to get the third layer, I go alt + <key>, for 4th layer, mod3 + shift + <key>. Then you can set to use this custom symbol map in your DE/WM config, in my case I have added xkb_layout "us-custom" in my sway config (for input keyboard).

// parent system is US, with a lot of greek sybols appended, and some more
// ; -> :, : -> ; - mostly for vim modes (easier to do : now)
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
    name[Group1]= "English US - Custom"; 
    include "level3(ralt_switch)"

    key <TLDE> {[ grave, asciitilde ]};
    key <AE01> {[ 1, exclam, exclamdown ]};
    key <AE02> {[ 2, at ]};
    key <AE03> {[ 3, numbersign, Greek_pi ]};
    key <AE04> {[ 4, dollar, trademark ]};
    key <AE05> {[ 5, percent ]};
    key <AE06> {[ 6, asciicircum ]};
    key <AE07> {[ 7, ampersand ]};
    key <AE08> {[ 8, asterisk, Greek_PI ]};
    key <AE09> {[ 9, parenleft ]};
    key <AE10> {[ 0, parenright, degree, schwa ]};
    key <AE11> {[ minus, underscore ]};
    key <AE12> {[ equal, plus, plusminus ]};

    key <AD01> {[ q, Q ]};
    key <AD02> {[ w, W ]};
    key <AD03> {[ e, E, Greek_epsilon, eacute ]};
    key <AD04> {[ r, R, Greek_rho ]};
    key <AD05> {[ t, T, Greek_theta, Greek_tau ]};
    key <AD06> {[ y, Y ]};
    key <AD07> {[ u, U ]};
    key <AD08> {[ i, I, integral ]};
    key <AD09> {[ o, O, Greek_omega, Greek_OMEGA ]};
    key <AD10> {[ p, P, Greek_phi, Greek_psi ]};
    key <AD11> {[ bracketleft, braceleft ]};
    key <AD12> {[ bracketright, braceright ]};

    key <AC01> {[ a, A, Greek_alpha, ae ]};
    key <AC02> {[ s, S, Greek_sigma, Greek_SIGMA ]};
    key <AC03> {[ d, D, Greek_delta, Greek_DELTA ]};
    key <AC04> {[ f, F ]};
    key <AC05> {[ g, G, Greek_gamma, Greek_GAMMA ]};
    key <AC06> {[ h, H, Greek_eta ]};
    key <AC07> {[ j, J ]};
    key <AC08> {[ k, K, Greek_kappa ]};
    key <AC09> {[ l, L, Greek_lambda, Greek_LAMBDA ]};
    key <AC10> {[ colon, semicolon ]};
    key <AC11> {[ apostrophe, quotedbl ]};
    key <BKSL> {[ backslash, bar ]};

    key <AB01> {[ z, Z, Greek_zeta ]};
    key <AB02> {[ x, X, Greek_xi, Greek_XI ]};
    key <AB03> {[ c, C, Greek_chi ]};
    key <AB04> {[ v, V ]};
    key <AB05> {[ b, B, Greek_beta ]};
    key <AB06> {[ n, N, Greek_nu, ntilde ]};
    key <AB07> {[ m, M, mu ]};
    key <AB08> {[ comma, less ]};
    key <AB09> {[ period, greater ]};
    key <AB10> {[ slash, question, questiondown ]};
};

 

This may not be a appropriate post for this community, and is not strictly web development. It is browser related, specifically qutebrowser, but i don't think the behaviour is qutebrowser specific, it may be chromium specific though, but i don't know how to test on any other browser because i hardly know js. If this is not valid for this community, please do tell.

I was writing a way to redirect other lemmy instance links to my home instance. I am basically trying to write lemmyverse.link (it's working is explained in the following issue, but essentially we just ask the instance where we want to be redirected, if they have the post, if so, they return json, which will have post_id in that instance, and we can use that.

https://github.com/RikudouSage/lemmyverse.link/issues/14

I think I have implemented that somewhat successfully, and it works for all the instances that i have tried, except lemmy.world (why could it not be some tiny instance which i could ignore). For lemmy.world, browser ui shows as if it is loading. I checked dev tools, and we do get the redirection (see the post_id change below in the attched video, and when i click that, i get redirected to correct page). It shows a red errors, but i can not find how to find errors (none of tabs show any errors).

https://envs.sh/s/NhX_dHEZh52CD1MwcXXLwg/cSI.mkv

(the video show succesful redirection for some instance, and unsucceful redirection for other)

I hope someone who knows how to do this help, I could not find anything wrong, and hence am not able to even search for errors online.

code for anyone wanting to see it


import qutebrowser.api.interceptor
import re
import requests
import sys
def match(patterns, url):
    for pattern in patterns:
        if re.match(pattern, url):
            return True
    return False
with open('/home/sg/data/dev/program-data/lemmings_coookie_jwt', 'r') as f:
    cookie = f.read().strip()
def resolve_lemmings_object(query):
    url = "https://lemmings.world/api/v3/resolve_object"
    params = {"q": query}  # Pass the query as a parameter
    headers = { "Cookie": cookie}
    try:
        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()  # Raise HTTPError for bad responses (4xx or 5xx)
        return response.json()['post']['post']['id']
    except requests.exceptions.RequestException as e:
        print(f"Error: {e}")
        return None

def per_website_rules(request: qutebrowser.api.interceptor.Request):
	lemmy_patterns = [ r"crazypeople\.online", r"discuss\.online", r"discuss\.tchncs\.de", r"feddit\.nl", r"feddit\.org", r"feddit\.uk", r"jlai\.lu", r"lemm\.ee", r"lemmy\.blahaj\.zone", r"lemmy\.ca", r"lemmy\.cafe", r"lemmy\.dbzer0\.com", r"lemmy\.ml", r"lemmy\.one", r"lemmy\.run", r"lemmy\.selfhostcat\.com", r"lemmy\.wtf", r"lemmy\.zip", r"mander\.xyz", r"ponder\.cat", r"programming\.dev", r"sh\.itjust\.works", r"slrpnk\.net", r"sopuli\.xyz", r"toast\.ooo", r"lemmy\.world", r"spaffel\.social" ]
	post_pattern = [ r"^/post/.*$" ]
	if match(lemmy_patterns, request.request_url.host()) and match(post_pattern, request.request_url.path()):
		url = request.request_url.scheme() + "://" + request.request_url.host() + request.request_url.path()
		# post_id_in_my_prefered_instance = os.popen("lemmy-redirect " + url).read()
		post_id_in_my_prefered_instance = resolve_lemmings_object(url)
		request.request_url.setHost('lemmings.world')
		request.request_url.setPath('/post/' + str(post_id_in_my_prefered_instance))
		try:
			request.redirect(request.request_url)
		except:
			pass

view more: next ›