[–] 5 points 1 year ago

Well the "one address" bit sure :) but given the scale supported by CGNAT systems today, I don't think being able to support an entire country behind a single cluster is that far off. At which point the difficulty becomes "is the 100.64.0.0/10 block big enough"? Or maybe they're using DS-lite for the hauling from private network to the NAT.

  • source
  • parent
  • context
  • [–] 4 points 1 year ago

    While exploring solutions, I use f or ffto mean “follow-up/to-squash” and a to mean logically separate. Sometimes other (additional) short abbreviations to know where to move, squash, and edit the changes to.

    I recently discovered git commit --fixup=abcd1234: it will make a new commit with a message of fixup! <message from abcd1234>. (It's the only special thing that flag does: a specially formatted commit message, which you can craft yourself if you remember the spelling of the fixup! marker.)

    When you later rebase, git rebase --interactive --autosquash will automatically mark that commit to be a fixup of abcd1234.

    magit for emacs has shortcut for creating a fixup commit selecting the previous commit, I'm sure other interfaces do too.

    I guess my commit descriptions get better with project lifetime

    I've found that too, which I think is because as the project matures, you're more likely to make fixes or contained features, as opposed to regular "change everything" as you explore the design in a young project.

  • source
  • parent
  • context
  • [–] 20 points 1 year ago (2 children)

    As @shane@feddit.nl says, you can use the same public port for many different destination address, vendors may call it something like "port overloading".

    More importantly, you can install a large pool of public address on your CGNAT. For instance if you install a /20 pool, work with a 100 users / public address multiplexing, you can have 400,000 users on that CGNAT. 100 users / address is a comfortable ratio that will not affect most users. 1000 users / address would be pushing it, but I'm sure some ISP will try it.

    If you search for "CGNAT datasheet" for products you can deploy today, the first couple of results:

  • source
  • parent
  • context
  • [–] 18 points 1 year ago* (last edited 1 year ago)

    This is the behaviour of inet_aton, which ping uses to translate ASCII representations of IPv4 addresses to a 32 bit number. Its manpage: https://man7.org/linux/man-pages/man3/inet_aton.3.html

    It recognizes the usual quad decimal notation of course, but also addresses of the form a.b.c or a.b, or in this instance, a, with is taken to be a 32bit number.

    Each part can also be written in hex or octal, with the right prefix, such that 10.012.0x800a is as valid form for 10.10.128.10.

    Not all software use inet _aton to translate ASCII addresses. inet_pton for instance (which understands both v4 and v6) doesn't

  • source
  • parent
  • context
  • [–] 9 points 1 year ago* (2 children)

    Inside the lambda expression you can have a comprehension to unpack the keys list to get the same sort of uplet as your "manual" example, like this:

    >>> items = [{"core_name": "a", "label": "b"},{"core_name": "c", "label": "d"}, ]
    >>> keys = ["core_name", "label"]
    
    >>> tuple(items[0][k] for k in keys)
    ('a', 'b')
    
    >>> sorted(items, key=lambda d: tuple(d[k] for k in keys))
    [{'core_name': 'a', 'label': 'b'}, {'core_name': 'c', 'label': 'd'}]
    
  • source
  • A crate for puppy (programming.dev)
     

    I made a crate for puppy! He keeps outgrowing the ones we bought, so I made a large one out of his playpen panels that should be big enough until he's fully grown.

    The floor is a sheet of plywood. I put vinyl wrap on it for waterproofing (turns out it's too fragile, by the time I made the rest I made a couple of tears).

    For the top, I made a lip out of PSE wood (I think 25mm), to give more rigidity and allow fitting a hinged top.

    Cabin hooks for the door, but they turned out to be too loose, so I added a Brenton bolt.

    Puppy likes it, so overall a success!

    Progress pictures :

    The host of the crate:

     

    Hi,

    Weekend before last (ie Sunday 24th) I applied tung oil to plywood (simply described as "12mm hardwood plywood" by the DIY shop). One week and a bit later, it looks dry to the eye, there is no shiny spot, the wood has a warmer colour, but if I run my fingers on the surface I get a tiny amount of oil.

    I applied the oil by pouring a small amount on the surface of the wood then rubbing with an old rag, leaving no pool of oil.

    Sunday (the day before yesterday ) I used kitchen towels to try to dry it off. The towels picked up a tiny bit of oil, but evidently not everything.

    Is tung oil that slow to dry? Should I wait another week? Can I do something to help the process along? (Sanding or steel wool? Too aggressive for the thin veneer of plywood? Rub with a small amount of white spirit? )

    I'm making a crate for Puppy who has outgrown two crates already, I picked the oil that was advertised as food & toy safe without realising how difficult it'd be to apply. In fact that's my most ambitious project to date, I'm really a beginner.

    Puppy tax: Proud puppy on a trunk

     

    Hi,

    I have to interface with systems that use iso-8859-x encoding (not by choice...), and I'm surprised that the following doesn't throw an error:

    >>> str(bytes(range(256)), encoding="iso-8859-1", errors="strict")
    '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
    

    Bytes in the 0x80—0x9f range are not valid iso-8859-1, and I was expecting the above to raise a DecodeError of some sort; instead it looks like those are passed through.

    I'm perfectly happy with this behaviour, I would like to make sure I can depend on it. Can I take an arbitrary byte buffer, decode as ISO-8859-1, and never get any error? Is it guaranteed to be lossless ?

    view more: next ›