this post was submitted on 29 Jun 2025
482 points (98.4% liked)

Linux Gaming

19758 readers
414 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

No memes/shitposts/low-effort posts, please.

Resources

WWW:

Discord:

IRC:

Matrix:

Telegram:

founded 2 years ago
MODERATORS
 

Today, I switched the last of my Windows machines to Linux: my gaming PC. I've been using Linux on servers for many years but was a bit apprehensive for gaming.

Turns out it just... works. Just installed steam and turned proton on, have zero performance or other issues. I'm using Ubuntu 25.04 for the 6.14 kernels NT emulation performance tweaks. Aside from there not being a catalyst driver for it and so I can't undervolt my card everything is great.

you are viewing a single comment's thread
view the rest of the comments
[–] daggermoon@lemmy.world 1 points 3 days ago* (last edited 3 days ago) (1 children)

Fair enough, I misunderstood your argument. I appreciate your demonstration. Any chance you'd be willing to share your script? I have a few ideas on how to play with it.

Edit: I forgot, I actually had a HDD fail on me, luckily I was able to recover some of the data. Many .flac files on it were completely corrupted and unreadable past a certain point. The .aiff files I had were perfectly readable. I suspect they were at least partially corrupted. Luckily, I was able to re download all of the affected files. So, no data was actually lost.

[–] squaresinger@lemmy.world 2 points 3 days ago* (last edited 3 days ago) (1 children)
import sys
import random

inFilePath = sys.argv[1]
outFilePath = sys.argv[2]
damagePercentage = float(sys.argv[3])

with open(inFilePath, "rb") as f:
    d = f.read()

damageTotalCount = int(len(d) * damagePercentage / 100)

print("Damaging "+str(damageTotalCount)+" bytes.")

dList = [ x.to_bytes(1) for x in d ]

for i in range(damageTotalCount):
    pos = random.randint(2000,len(d)-2)
    dList[pos] = random.randint(0,255).to_bytes(1)
    if (i%1000 == 0):
        print(str(i)+"/"+str(damageTotalCount))

d = b"".join(dList)

with open(outFilePath, "wb") as f:
    f.write(d)

If you run it, the first argument is the input file, the second one is the output file and the third is the percentage of corrupted bytes to inject.

I did spare the first 2000 bytes in the file to get clear of the file header (corruption on a BMP file header can still cause the whole image to be illegible, and this demonstration was about uncompressed vs compressed data, not about resilience of file headers).

I also just noticed when pasting the script that I don't check for double-corrupting the same bytes. At lower damage rates that's not an issue, but for the 95% example, it's actually 61.3% actual corruption.

[–] daggermoon@lemmy.world 2 points 3 days ago (1 children)

Thanks, I'll make good use of it. I gotta to learn to write scripts like this.

[–] squaresinger@lemmy.world 1 points 1 day ago

It does take practice, but once you know how to do it it becomes easy. That was like 5 minutes of work.