• 1 Post
  • 104 Comments
Joined 8 months ago
cake
Cake day: June 23rd, 2024

help-circle







  • Your client must have downloaded entire chunks, including parts of adjacent files to those you wanted. I think most clients will discard them but it’s possible they are stored somewhere hidden to enable seeding them again. Pretty much every client will tell you something like “66 chunks (have 11)” and/or progress on a per-file basis, from which you can deduce which of these behaviors is used. Badly written ones will make a file as big as the previous episode to the one you want and fill it with zeros so that the few MiB are physically in the right spot. Obviously, that fills your drive with junk unless compression is enabled at filesystem level.

    It’s always better to seed something even if it’s not an entire file. Peers are usually upload-bandwidth-limited so being another person providing just a few chunks helps download speeds. Unless you meddle with their progress files, torrent clients will not announce (offer for download) chunks they cannot reassemble. Only people who have 100% of the data are listed as “seeders” in the swarm.


  • I’m willing to take the risk. It’s like saying “your web browser supports WebGL”. Unless you’re on Opera Mini or something text-based or ancient, we can assume it’s true.

    How does changing an extension break verification? It’s just a rename again. I have successfully changed an extension using qBittorrent before and the check passed again. Via its web interface, even!

    And no client hashes filenames because they just aren’t what is hashed. I think even TUI ones have internal support for different filenames even if they don’t have a rename function because you can reach limits of your filesystem (path length, character support etc.)



  • You’re wrong, partially. Stand by while I illustrate.

    Neither file names nor extensions are included in content hashes.

    Let’s first see how a torrent file is created, using quick-and-dirty bitmaps I just drew. File sizes will be in whole MiB (1 MiB = 1 pixel width) for convenience.

    So you have a file tree you wanna share.

    The client will arrange the files in some order. I think you can create a valid torrent file with any ordering but let’s just assume it’s by path, alphabetical. (We are supposing each file is a whole number of MiB, in reality it can be any whole number of B)

    Now file contents are concatenated.

    Then split into 14MiB chunks (in practice 2, 4, 8 or 16MiB but I forgot to account for border while drawing lol) and zero-padded (grey) to fill the last chunk.

    v2 .torrent files can be aligned (where large files always start at chunk border) but this is not allowed/encouraged in most trackers due to hit-and-miss support by clients.

    Now a hash is calculated for each chunk, creating a hash map. I’ll assume you know what hashing is.

    The file list, hash map, tracker info and other data I didn’t bother drawing gets packed into the .torrent file. On private trackers, each user will send a unique user ID as a parameter of the announce URL so that transfers can be tracked and users get credited for seeding.

    Any modern torrent client will let you change the names of files on your drive, provided you tell it the new filename so it can keep track of which files described in the .torrent file correspond to which files on your filesystem (therefore the recommended way is to rename within the client). Then it will be able to reconstruct the chunks so it can send them as other people request them while you seed.

    Theoretically, you should be able to also change the directory structure but I don’t know a GUI client that will let you. Maybe you can try symlinks or path traversal shenanigans like /../S01E01.mkv to un-folder the seasons for example.
    Others in the swarm will never know what new file names you used or about other files on your system. They only request and offer the contents of chunks, and will only accept them if the chunk resolves to the known hash.

    For example, someone willing to download just “S02/E01_Sit.mkv” from you will request chunks 72 to 84. Your torrent client will pull the first 7 MiB of chunk 72 from the end of “Season 1/S01E03.mkv” and the other 7 MiB from the beginning of “Season 2/S02E01.mkv”. The recipient will get all 14 MiB from you, check that the hash matches and discard the first 7 MiB, saving the last 7 MiB into “S02/E01_Sit.mkv” followed by the contents of chunks 73 through 83 and the first 13 MiB of chunk 84. I could draw the request-transfer-check-save process with my graphics but it’s been done before and I need to sleep so no more pics.

    Note that in the example above, the file Cover.jpg went missing. Its chunk will therefore not be reconstructible (in practice, the first 2 MiB that can’t be read from disk will be interpreted as all zeros and the hash will not match) and will not be advertised as available while seeding. (In fact, the user will still be listed as “leeching” in the swarm because they don’t offer all chunks for download.) It doesn’t matter that 12/14 MiB of the first chunk is available - other users will not accept incomplete chunks because they don’t match the hash and that means they have been altered, possibly maliciously. As a result, if this user is the only remaining peer in the swarm and then someone joins to download the files, they will never be able to get anything from the first chunk and their copy of “S01/E01_Lorem.mkv” will be incomplete (clients will either make the first 12 MiB of the file all zeros, creating a completely unplayable MKV file, or store the good parts in a .part file and wait for the first chunk forever - the latter can be more frustrating because if the LAST few MiB are missing in otherwise good video files they don’t appear even though they would be almost fully playable with the first approach). However, the torrent can “heal” if a seeder appears in the swarm and provides the a correct copy of the first chunk and the missing “Cover.jpg” file is restored (unless it’s set to “Do Not Download”).

    Edit: if you’re the user who deleted “Cover.jpg” (please don’t be) your client will probably detect it on restart or when reannouncing and alert you with a red row in the table and you have to take manual action to re-enable announcing for the torrent. Your options are:

    • If someone else has all of the first chunk, you will be able to redownload it and have the torrent complete again.
    • Set the file (and the next one) to “Do Not Download”, recheck and just accept that you will never seed the first chunk again.
    • Find the file on your filesystem, DDL site etc., put it where the torrent client expects it (or you can use the internal Rename tool if the path is the same except filename) and recheck the torrent to see if the file is indeed correct.

    Do you now understand why file-chunk alignment I spoke about above is critical if people keep losing files like NFOs?

    What is correct is that you cannot edit the filenames in the torrent file (even though torrent editors exist) because then its hash (known as “infohash”) would be different and the tracker would not recognize it. You’d need to reupload it but it would be likely detected as duplicate. You’ll only encounter infohashes in magnet links: they are used by the magnet link handler to verify that the torrent the server responded with is the one you wanted.


  • Renames are OK in pretty much all clients.

    • Open .torrent file
    • Select correct destination directory
    • Add Paused
    • Right-click each file/directory in the “Content” tab and rename
    • Recheck to make sure all files are found by the client and their contents have not changed; select “Do not Download” for missing or incomplete files, the correct chunks will still be seeded
    • Start seeding

    You can also use a torrent file editor to get the file names right before importing into a client. Useful for batch operations. HOWEVER, the info hash will be different so it won’t be recognized by the tracker. You can upload such file to your own tracker, though.




  • What’s an “inui battery”? Do you mean the INIU B5 powerbank?

    Powerbanks can be used directly as USB UPS devices if their output is enabled while charging but most devices you would power with them already have “UPS” functionality (built-in battery). By “disassembling them” you mean using their raw cells? That gets you 3.7 Wh per dollar but I recommend going for the similarly priced raw LiFePO4 cells unless you want to lug them around, getting you great longetivity and cycle life. You need a BMS anyway if you put them in series, I recommend a 4S or 8S config to avoid dealing with large currents and lossy step-up conversion. They can save you quite a bit of money if you charge them daily with solar power. Professional solutions are available, whether they are worth it depends on how much you trust your skills.

    What UPS would you put the cells in, anyway? Don’t use one with a lossy and costly mains inverter unless you’re powering something that really needs mains. You can find many that have ATX outputs, or if you’re adventurous some ATX supplies can be run from 12V DC (exact!) supplied into the 12V rail and 5V into the 5Vsb rail because they use an inverter and buck converters to create all the other voltages from 12V. These can be identified by counting the mains transformers and windings of the main transformer. Don’t backfeed 12V while it’s powered from mains. You can use the internals from a cheap car USB adapter (they work from 9 to 30 volts) for 5Vsb from your 4S-8S cell configuration, but the cell-voltage-to-12V supply will have to be a beast - still smaller than the mains inverter you’d need.



  • The triangle is an opamp. Its output (right) is the difference of inputs (left) (plus some small offset due to manufacturing tolerances) multiplied by a large number (million or more), capped to more or less the voltage of its power rails. In most uses, there is a feedback so the output influences inputs to equalize them, effectively creating an amplifier whose voltage amplification is set by rhe strength of the feedback. Without a feedback, the opamp’s output will be either GND or Vcc depending on the which input’s voltage is higher. An opamp in this configuration os known as the comparator. Basically, it flips based on whether the photodiode is generating voltage, and I think that allows for higher frequencies than a traditional phototransistor. In reality, a very large resistor (megaohms or gigaohms) is added so that the voltage on the diode actually goes below zero when no light is incoming but it was omitted from the diagram.

    The rectangle looks a bit like a European-style potentiometer but it isn’t. Maybe a resistive divider?

    Maybe two outputs because DIP-6 packages are uncommon and they went for the standard.


  • ChaoticNeutralCzech@feddit.orgtoMemes@sopuli.xyzbased on a true story
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 months ago

    There are actually B, C and D formats with the same properties, just scaled up or down slightly if you need something in between, for example B4 is basically A3.5, C4 is A3.75 and D4 is A4.25 if you plug it into the power-of-2 formula. (Later, C and D were removed because very few people used the quarter-steps.)


  • Yes, and many are very old. Like 1920-ish old. So they slightly update them and invalidate those that become public domain. They are systematically milking standards for money and making it harder to enter industries legitimately. Maybe more money-burning start-ups and their investors would care about standards if the red tape wasn’t behind a paywall. Now they just wing it and hope to IPO before their violations cause loss of life a public image problem.