[Meme transcription:]

– Hey, why is the shell prompt on the production server red now?
– Earlier: me@prod:~$ docker container remove --force the-application

Protip: If you’re used to shutting down your computer via the CLI, make it a habit to use an alias like off.

This way you will never, ever turn off a remote server by accidentally using throwing poweroff at a residual SSH connection.

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    13 hours ago

    the fact that you can shell in from your local environment is more concerning than the fact that you killed prod.

    hope you aren’t supposed to hold any compliance requirements!

    funny story though, you’ll use this when you’re mentoring later and some dumbass noob will still do it.

  • Kidplayer_666@lemm.ee
    link
    fedilink
    arrow-up
    44
    ·
    20 hours ago

    Here we simply have a tool that on dangerous commands like power off or reboot asks for the host name of the machine in question. Didn’t stop me from accidentally rebooting a machine once, but no matter

  • bleistift2@sopuli.xyzOP
    link
    fedilink
    English
    arrow-up
    20
    ·
    edit-2
    20 hours ago

    If you’re using a descendant of Debian, you will find a line like this in your ~/.bashrc file:

    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
    

    The 32m part controls the color of the username. (\u). 1 is red, 2 is green (as seen in the user and host part, \u@\h), 3 (as seen for the directory, \w) is blue.

    You can use this to distinguish different hosts by color.

  • timbuck2themoon@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    13 hours ago

    Man it’s late here but I just don’t get it. Isn’t tmux enough to separate sessions then you just look before you run something like this?