So I’m working on a server from home.

I do a cat /sys/class/net/eth0/operstate and it says unknown despite the interface being obviously up, since I’m SSH’ing into the box.

I try to explicitely set the interface up to force the status to say up with ip link set eth0 up. No joy, still unknown.

Hmm… maybe I should bring it down and back up.

So I do ip link set eth0 down and… I drive 15 miles to work to do the corresponding ip link set eth0 up

50 years using Unix and I’m still doing this… 😥

  • plumbercraic@lemmy.sdf.org
    link
    fedilink
    arrow-up
    13
    ·
    5 天前

    Did this once on a router in a datacenter that was a flight away. Have remembered to set the reboot in future command since. As I typed the fatal command I remember part of my brain screaming not to hit enter as my finger approached the keyboard. 🤦‍♂️

    • ExtremeDullard@lemmy.sdf.orgOP
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      5 天前

      Have remembered to set the reboot in future command since

      That’s not a bad idea actually. I’ll have to reuse that one. Thanks!

      • SayCyberOnceMore@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        4 天前

        This.

        Do it. This saved my life on more than one occasion.

        You’ll think “nah, it’ll be fine” and then at 11pm when your brain’s fried on vending machine coffee you’ll be glad that you did it… 3 times over…

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    7
    ·
    5 天前

    Remember what Bruce Lee said:

    I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.

  • apt_install_coffee@lemmy.ml
    link
    fedilink
    arrow-up
    9
    ·
    4 天前

    A few months ago I accidentally dd’d ~3GiB to the beginning of one of the drives in a 4 drive array… That was fun to rebuild.

      • apt_install_coffee@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        3 天前

        I wish.

        It was a bcachefs array with data replicas being a mix of 1,2 & 4 depending on what was most important, but thankfully I had the foresight to set metadata to be mirrored for all 4 drives.

        I didn’t get the good fortune of only having to do a resilver, but all I really had to do was fsck to remove references to non-existent nodes until the system would mount read-only, then back it up and rebuild it.

        NixOS did save my bacon re: being able to get back to work on the same system by morning.

    • Like 3 weeks ago on my (testing) server I accidentally DD’d a Linux ISO to the first drive in my storage array (I had some kind of jank manual “LVM” bullshit I set up with odd mountpoints to act as a NAS, do not recommend), no Timeshift, no Btrfs snapshot. It gave me the kick in the pants I needed to stop trying to use a macbook air with 6 external hard drives as a server though. Also gave me the kick in the pants I needed to stop using volatile naming conventions in my fstab.

  • InnerScientist@lemmy.world
    link
    fedilink
    arrow-up
    41
    ·
    5 天前

    I have a failsafe service for one of my servers, it pings the router and if it hasn’t reached it once for an entire hour then it will reboot the server.

    This won’t save me from all mistakes but it will prevent firewall, link state, routing and a few other issues when I’m not present.

  • Float@startrek.website
    link
    fedilink
    English
    arrow-up
    24
    ·
    5 天前

    Every network engineer must lock themselves out of a node at some point, it is a rite of passage.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    4 天前

    Lol I’ve locked myself out of so many random cloud and remote instances like this that now I always make a sleep chain or a kill timer with tmux/screen.

    Usually like:

    ./risky_dumb_script.sh ; sleep 30 ; ./undo.sh

    Or

    ./risky_dumb.script.sh

    Which starts with a 30 second sleep, and:

    (tmux) sleep 300 ; kill PID

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    11
    ·
    4 天前

    At $DAYJOB, we’re currently setting up basically a way to bridge an interface over the internet, so it transports everything that enters on an interface across the aether. Well, and you already guessed it, I accidentally configured it for eth0 and couldn’t SSH in anymore.

    Where it becomes fun, is that I actually was at work. I was setting it up on two raspis, which were connected to a router, everything placed right next to me. So, I figured, I’d just hook up another Ethernet cable, pick out the IP from the router’s management interface and SSH in that way.
    Except I couldn’t reach the management interface anymore. Nothing in that network would respond.

    Eventually, I saw that the router’s activity lights were blinking like Christmas decoration. I’m guessing, I had built a loop and therefore something akin to a broadcast storm was overloading the router. Thankfully, the solution was then relatively straightforward, in that I had to unplug one of the raspis, SSH in via the second port, nuke our configuration and then repeat for the other raspi.

  • twinnie@feddit.uk
    link
    fedilink
    arrow-up
    103
    ·
    5 天前

    I knew a guy who did this and had to fly to Germany to fix it because he didn’t want to admit what he’d done.

    • catloaf@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      19
      ·
      5 天前

      Or use some kind of molly guard. Or have an OOB management channel.

      You’d think you’d learn from your mistakes after one or two of them, not fifty years’ worth…

        • DasFaultier@sh.itjust.works
          link
          fedilink
          arrow-up
          22
          ·
          5 天前

          after hours

          I’ve configured PAM to not let me login remotely after hours, because I just know that someday I’ll want to fix “just this tiny thing” and I’ll break production because I’m too tired. I clearly need protection from myself, and this is one slice in Dr.Reasons’s Swiss cheese model.

          Don’t let the people drag you down, this happens to all of us.

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        10
        ·
        5 天前

        You’d think you’d learn from your mistakes

        Yes, that what you’d think. And then you’ll sit with a blank terminal once again when you did some trivial mistake yet again.

        A friend of mine developed a habit (working on a decent sized ISP 20+ years ago) to set up a scheduled reboot for everything in 30 minutes no matter what you’re going to do. The hardware back then (I think it was mostly cisco) had a ‘running conrfig’ and ‘stored config’ which were two separate instances. Log in, set up scheduled reboot, do whatever you’re planning to do and if you mess up and lock yourself out the system will restore to previous config in a while and then you can avoid the previous mistake. Rinse and repeat.

        And, personally, I think that’s the one of the best ways to differentiate actual professionals from ‘move fast and break things’ group. Once you’ve locked yourself out of the system literally half way across the globe too many times you’ll eventually learn to think about the next step and failovers. I’m not that much of a network guy, but I have shot myself in the foot enough that whenever there’s dd, mkfs or something similar on the root shell I automatically pause for a second to confirm the command before hitting enter.

        And while you gain experience you also know how to avoid the pitfalls, the more important part (at least for myself) is to think ahead. The constant mindset of thinking about processes, connectivity, what you can actually do if you fuck up and so on becomes a part of your workflow. Accidents will happen, no matter how much experience you have. The really good admins just know that something will go wrong at some point in the process and build stuff to guarantee that when you fuck things up you still have availability to fix it instead of calling someone 6 timezones away in the middle of the night to clean up your mess.

  • markstos@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    4 天前

    I was scared to move the cloud for this reason. I was used to running to the server room and the KVM if things went south. If that was frozen, usually unplugging the server physically from the switch would get it calm down.

    Now Amazon supports a direct console interface like KVM and you can virtually unplug virtual servers from their virtual servers too.