• 0 Posts
  • 6 Comments
Joined 3 years ago
cake
Cake day: June 15th, 2023

help-circle

  • If you want a second attempt, this might help.

    To get USB devices working inside a container, you need to map the device into the container, which can be tricky—especially if you’re running rootless containers.

    If you’re on Linux and want to avoid complicated setups with user namespaces, groups, or messing with udev rules, the easiest way to start is by manually recreating the device node inside a folder you control (like where your config is stored) using mknod.

    For example, if your USB device is /dev/ttyUSB0:

    1. Run ls -l /dev/ttyUSB0 You should see output like: crw-rw---- 1 root dialout 188, 0 Jan 1 1970 /dev/ttyUSB0

    2. Note the major (188) and minor (0) numbers.

    3. Change directory to the folder where you want to create the “clone” device node, then run: sudo mknod -m 666 ttyUSB0 c 188 0 (Use the major/minor numbers from your device — they differ by device.) This will create a device readable and writeable by anyone on the system so perhaps consider changing the mode from 666 to 660 and/or chown the file afterwards to your user and group. As I said, this is HACKY and not a secure solution.

    You will now have a device file you can then pass into your container with the Docker/PODMAN option: –device /path/to/your/folder/ttyUSB0:/dev/ttyUSB0

    I realize this is a pretty hacky and insecure workaround—feel free to downvote or ignore if you want something cleaner. But it’s a quick way to get your USB device accessible inside the container to get started. Later on, you can look into proper handling with udev or other methods if security is important.

    If you use Windows, you are on your own unfortunately, I do not have experience with podman/docker in Windows environments.




  • Alright, let’s get into the nitty-gritty of Duckpower.

    First, let’s settle the “waddling vs. flying vs. swimming” debate. Horses aren’t big on flying, so we’re talking waddling power here. Until someone locates a Pegasus, we’re limited to the traditional land-bound horsepower. If you want swimming power, I guess you’d need to measure a seahorse?

    Now, here’s where it gets serious: according to the brilliant minds at Art of Engineering, we can calculate Duckpower using a clever formula. They took the mass of a duck, compared it to a horse, and ran it through Kleiber’s Law. The answer? One horsepower = 131.2 Duckpower. So, back to our math:

    3 horsepower = 3 x 131.2 Duckpower = 393.6 ducks waddling their hearts out.

    But wait! We probably don’t need all 393.6 ducks if we give them some solid shift schedules. Horses only get 3 HP so two can rest; following this logic, we’d only need around 100 well-rested ducks, provided they get naps and stay hydrated.

    So, let’s optimize our duck workforce with a shift schedule. Assuming we only need 100 ducks, here’s the plan:

    Duckpower Shift Schedule:

    Total Ducks: 100

    Working Ducks per Shift: 25

    Shift Duration: 2 hours on, 6 hours off (plenty of time for snacks and naps)

    In a day, we’d run 4 shifts like this:

    1. Shift 1: 25 ducks start strong at 8:00 AM, waddling with purpose.

    2. Shift 2: Fresh 25 ducks take over at 10:00 AM while Shift 1 ducks hit the ducky lounge for snacks and a nap.

    3. Shift 3: At 12:00 PM, another 25 ducks clock in to keep those wheels turning.

    4. Shift 4: Finally, at 2:00 PM, the last 25 ducks take over while the others catch up on R&R.

    With this cycle, each duck works only 2 hours out of every 8, staying energized, waddling at peak efficiency, and ready for action.

    TL;DR: 3 horsepower = 393.6 ducks waddling but if we set up a 4-shift system, we can pull this off with only 100 ducks working 2 hours each, plus snack breaks.


  • 3 horses = 3 horsepower, which translates to a whopping 393.6 Duckpower.

    Honestly, why are we still using horses as the standard here? Ducks are clearly the superior metric. So if you’re like me and prefer a more feathered approach, just remember:

    3 horses = 3 horsepower = 393.6 ducks You’re welcome.

    (PS: Just imagine 393.6 ducks handling 10Gb… now that’s efficiency.)


  • replying to myself here, but also, if this where supposed to work, which I doubt it will because it’s not feasible with tcpip, your second router would need to have the first router as gateway, but that is not possible when they are on the same subnet, and also your router will most likely not allow it because nat/routing will break, but if this was possible, devices behind your second router would not be able to connect to the devices before and vice versa, because since they have the same subnet, the traffic is considered local and not going through the router, and therefore the will not see each other as the NAT provides a separation between the networks…

    you cannot use a router as a switch without using routing and different subnets … so … you might want to reconsider your design


  • Might be conflicts due to several routers using the same subnet… could cause some interesting ARP issues for the switches, and also DHCP conflicts if something is wrongly cabled / configured.

    I would try disconnecting everything from after the first switch, connect a computer there to see if it works ok, then reconnect and test behind each step to see where it breaks instead of checking in the end where the problem could be agitated from a issue earlier in the network…

    also, if the router has a firewall/nat you will not be able to reach anything behind it, even if there are different subnets being used… to be able to reach devices behind a router, the network would need to be routed and not nat’ed as nat combines all network traffic into the IP of the router before sending the traffic away, so clients on the other side has no way of knowing who or where the traffic came from after the nat’ed router.

    I suggest you read up about this if you are not familiar with difference between NAT and routed traffic.

    anyway, this is just my theory, hope you find your problem and get it sorted :)

    (edit added part about nat)