• OwOarchist@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    I’ve enabled all the relevant permissions. I’ve disabled firewall protection. I’ve enabled file sharing on both sides. I’ve checked for connectivity to the other machine from the command line…

    Why is my shared folder still not accessible!??!

  • Scoopta@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    I may actually be the other way around. I’m probably better at networking than programming? Not sure, I love them both but do neither professionally.

  • partial_accumen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    If it helps, I’m from the other side of networking and infra. You could swap the labels and make the meme accurate for me.

    In the mid 1980s I learn the BASIC programming command GOTO and fell in love for a lifetime. If you look any anything I used to write in Ruby script or today in Python you’ll see my love affair with “if” “elfi” and “else” continues. My universe is nested “if” statements all the way down.

    • otacon239@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      Same here! I can put together a half-descent network in just a few hours, but even programming simple stuff on microcontrollers is a major endeavor. And the documentation is usually terrible or nonexistent. And the tutorials are usually barely able to cover basic questions. At least in the space of networking, there’s enough context clues in the UI that I can piece together the solution I need.

          • partial_accumen@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            12 days ago

            I remember one of the hardest transitions for me from scripting in Ruby to Python was the whitespace indent was larger by default in Python. With Python, I ran out of monitor width and would have to be constantly scrolling right and left when visually parsing the code because the nested loops were so deep.

    • Zos_Kia@jlai.lu
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      It was fashionable at a time to avoid ifs and other imperative structures, but I tend to like them. Functional is nice and all but I like my code to be smart in the way it works, not in the way it’s written. Nested ifs are readable, collapsible, and easy to make sense of at a glance, there’s often nothing wrong with using them.

    • db2@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      My universe is nested “if” statements all the way down

      Also known as AI 🤣

      • chicken@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        Early returns seems good, but personally I find code more confusing when things get arbitrarily separated out into functions, because to read it you have to keep scrolling back and forth between different parts of the page and either remembering where the other part is or typing a lot with ctrl-f, there’s more variables to hold results, and if the section of code to be separated into a function is picked just because of nesting depth reasons then it’s likely the function name isn’t going to describe what it does very clearly, leading to more scrolling and more having to keep track of things in your head.

        • MonkderVierte@lemmy.zip
          link
          fedilink
          arrow-up
          0
          ·
          12 days ago

          I’ve had this too. It was cured by being forced to work with Java and enhance a PHP-framework. Dear god, the php-framework.
          But it literally increased my mental “stack size”. My shell and python scripts also got better.

          Ah, and also keep the “do one thing and do it good” tenet also to functions.

          • chicken@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            0
            ·
            13 days ago

            How? I’m using vscodium. There are right click menus that bring you to function definitions and uses, but that isn’t necessarily faster than scrolling around and is still way more friction and more stuff you can’t see to hold in your short term memory.

            IDEs also have collapse/expand features which make nested or longer functions easier to navigate.

            • wols@lemmy.zip
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              In a decent IDE you can CTRL+click (or similar) on a function name to go to its definition. This is absolutely faster than scrolling, especially if you’ve got more than a couple dozen lines in the current file.

              When splitting functionality into smaller functions you would ideally not have to keep implementation details of other functions in short term memory.
              You only need to understand/remember the contents of the current function. Does it do what the name suggests? Cool, you’re done checking it.

              Of course, the “2 hard problems in computer science” meme exists for a reason - it’s not always straight forward to come up with good names. But in my experience, even when coming up with a fitting name is difficult, reducing nesting usually helps a lot with comprehension, mainly because it reduces scope and thereby the amount of information you need to hold in your head.
              The larger a function gets, the harder it is to check that it does what it’s supposed to.

              There is of course a balance to strike - trying to force every single function to be at most 3 lines is likely to make the code more difficult to understand and is, in my eyes, almost pathological. But a function that covers more than a screen is the other extreme that should be avoided when practical.

      • OpenStars@discuss.online
        link
        fedilink
        English
        arrow-up
        0
        ·
        12 days ago

        This seems geared more towards programming languages like C++, whereas in scripting such as BASH it seems to me like it absolutely would get to be a mess to have so many functions, particularly those called only once (either total for the execution of the entire program or within the context of being inside another function, so once per function).

        I am curious now what would Linus Torvalds say about that?

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      Thanks! I started with Wireshark, settled on tcpdump for a while and now I’m too busy learning electrical engineering to give any fucks at all. 🤣 Nah but seriously, tcpdump gave me lots of insight! :)

    • nymnympseudonym@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      Still doesn’t help with things like understanding routing and subnet masks and frame sizes and jfc how does any of this work

      • floquant@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        13 days ago

        Of course not, but I’ve found that seeing the protocols in action and looking at real headers can be very helpful in making them click. Understanding DHCP or ARP or mDNS or BGP or whatever is much easier by inspecting a pcap than it is by reading RFCs

    • ohshit604@lemmy.halstead.host
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      As someone who understands the concept of network but has never professionally entered the field, i assume this just dumps a TCP packet to be inspected, correct?

        • ohshit604@lemmy.halstead.host
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          Thank you for the affirmation, I got reverse proxies and certificates relatively down, however I am struggling to understand headers and their purposes, I know Mozilla has great documentation regarding headers but lately I’ve gotten lazy, haha.

      • floquant@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        Yes, but before I used it I assumed that its scope was pretty much limited to what you just mentioned. Instead it can operate on most protocols both above and below layer 4, and it is incredibly useful as a traffic capture tool to produce a .pcap on a remote headless machine which you can then load into Wireshark. The “dump” part is the interesting one, not the “tcp” ;)

  • uen3@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    That’s why I decided to build my first online multi-player game as an offline single-player game, and just figure out how to add the networking stuff when everything else is done- an architectural choice I definitely won’t come to regret later…

  • slacktoid@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    My confidence in disk management and partition tables is made of horse hair, single strand.

  • rockSlayer@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    I’ve been trying to remotely connect to a relational database of medical data. I’ve been smashing my head against a keyboard for days trying to get my fucking code to work. I can’t even connect to their db on their Jupyter Spark cluster

      • rockSlayer@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        It absolutely is. I’m dealing with genetic data, so I’m on their high security tier. Right now, the signs point to some poorly documented environment variables that aren’t sourced on startup for some reason

  • naught101@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    I was like this 5 years ago. Networking a lot is still effort for me, but it is just another learnable skill, and it has lots of benefits (depending on your aims, I guess)

    Edit: hah, just realised this is about connecting computers, not about talking to people…

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    12 days ago

    The problem with networking is debugging it. The worst is debugging iptables and nftables. Figuring out which chain they are going to is a massive hassle. How come we don’t have any graphical tools whatsoever for this work?

          • onlinepersona@programming.dev
            link
            fedilink
            English
            arrow-up
            0
            ·
            12 days ago

            Cisco Packet Tracer is a comprehensive networking simulation software tool for teaching and learning how to create network topologies and imitate modern computer networks.

            That’s for simulation. I don’t think it’s possible to analyse a running system to find trace packets as they go through the firewall.

            Cisco Packet Tracer is available for free to all Cisco Networking Academy instructors, students, and alumni. Sign up for our free Getting Started with Cisco Packet Tracer course to learn how to download, install, and get started.

            And it also requires a paid account to use.

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      12 days ago

      As for iptables, doesn’t -j tell you where the packets are going? Or do you mean what their destination addresses and ports are? For that, on Linux, I use ss or lsof. I have never used it myself, but doesn’t ufw have some GUI?

      • onlinepersona@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        12 days ago

        Reading the iptables dump is not for beginners. Far from it. A packet can go through all tables and chains or none. And allowing a packet in one chain then begs the questions which is the next table or chain. There are maybe 100 flags and nobody can memorise them all.

        Ufw just allows adding rules, ss doesn’t trace packages as they go through the firewall, it can show you open ports and established connections, but it can show you which tables and chains a packet went through. lsof is even more rudimentary than ss and literally means “list open files”. Since everything is a file in linux, that’s a lot of files. Again, no tracing.

        Somebody will say “just tcpdump”. Again, no that doesn’t trace which tables and chains a packet goes through. The entire firewall is a blackbox to tcpdump. At least to my knowledge. All it sees is which packets arrived and which were sent on the selected interfaces, and whether they was successful or not.

        Nothing I know of traces a packet through the firewall and presents in a TUI nor GUI. I know that it’s possible to make copies of packets and send then to custom chains that can log the chain and packet it came from. There might even be a way of generating a trace by adding a rule to a chain, which means adding it to every chain, but I’m not sure I’ve seen something do that.

        • pishadoot@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          11 days ago

          I’m struggling to think of a situation where you’d be trying to get to that level of granularity of how a single packet is flowing end-end. Can you give an example of why you want to do that?

          In all my years I’ve never needed to do that, which is probably pretty common, which I’d guess is why there isn’t an available solution for that.

        • printf("%s", name);@piefed.blahaj.zoneOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          12 days ago

          I digress. The documentation on iptables alone is an arduous read at best and requires dedication to get through and to understand. With that said, while you “cannot” (loosely said) follow any one singular packet from an iptables listing, using tcpdump will at least let you know wherefrom it connections originate and where they are terminating. Again, it is a hard read, not very beginner friendly, but I think it is also enough for the majority of threat models.

          Question: does the person that feels that reading and understand iptables listings and tcpdumps really need to know - through an easy to read/understand UI - what chains and tables any one specific packet has traversed? What scenario/threat model/situation would that be? I’m all for discussing and widening my point of view, so don’t hold back! 😊

          • onlinepersona@programming.dev
            link
            fedilink
            English
            arrow-up
            0
            ·
            12 days ago

            Regarding your question, I’ve had trouble multiple times with docker (and other software) that required trying to find out just where a packet was getting stuck. The worst thing is when you open a port in the container to 0.0.0.0, send a request to it (HTTP, telnet, or otherwise) from the host via the container’s IP and the packet doesn’t arrive. Then you have to run through the gamut of:

            • are the interfaces up?
            • is it the IP address that’s wrong?
            • is the the port wrong?
            • is the network mask correct?
            • is the gateway IP correct?
            • is the firewall somehow interfering?

            There might be other things I’m missing, but once I get to the firewall stage, most of the time I just give up, put the service into a VM and try accessing it from there - if I really really care. Otherwise, I drop it and move on.

            I did just find this Network address translation part 1 – packet tracing which allows tracing a packet through the firewall via xtables-monitor. It’s in my notes now, so if I run into the problem again, I might have a place to start next time.

            But still, that’s just on my machine. Once things happen on the network and there are routers and other things involved, it’s very difficult for me to debug.