Re:GitLab Database Incident – Live Report
by m_fam_wa_k on Tuesday January 31, 2017 @08:09PM
(#13537184)
I like to color code my terminal. Production systems are always red. Dev are blue/green. Staging is yellow.
[ Parent
| on HN ]
Re:GitLab Database Incident – Live Report
by Perihelion on Tuesday January 31, 2017 @08:15PM
(#13537232)
All of my non-production machines have emojis in PS1 somewhere. It sounds ridiculous, but I know that if I see a cheeseburger or a burrito I'm not about to completely mess everything up. Silly terminal = silly data that I can obliterate.
Re:GitLab Database Incident – Live Report
by StavrosK on Tuesday January 31, 2017 @09:19PM
(#13537611)
I think I'd rather make the production systems stand out, and add the emojis there. My prompts have a red background, but emoji prompts just tickle me, somehow.
Re:GitLab Database Incident – Live Report
by kofejnik on Tuesday January 31, 2017 @08:24PM
(#13537294)
I've been color-coding my PS1 for years, but this is seriously brilliant, thanks!
Re:GitLab Database Incident – Live Report
by marcosdumay on Wednesday February 01, 2017 @08:26AM
(#13540515)
I got the idea of an emoji prompty that is happy or sad depending on the $? value from somebody here a few years ago.
I run it on any dev environment since then.
Re:GitLab Database Incident – Live Report
by scrame on Tuesday January 31, 2017 @11:41PM
(#13538306)
ha! I do the same thing with figlet and cowsay, it prints a big dragon saying "welcome to shell!", if I see that, then I know I'm on a box I own/have sudo/am me. it's a good visual reminder. I don't fuss with prompts much, but this is a pretty good idea!
Re:GitLab Database Incident – Live Report
by kevindong on Tuesday January 31, 2017 @08:53PM
(#13537471)
It seems Gitlab has noticed your comment.
Recovery item 3f currently says:
> Create issue to change terminal PS1 format/colours to make it clear whether you’re using production or staging (red production, yellow staging)
I use iterm2's "badging" to set a large text badge on the terminal of the name of the system as part of my SSH-into-ec2-systems alias:
i2-badge ()
{
printf "\e]1337;SetBadgeFormat=%s\a" $(echo -n "$1" | base64)
}
It's not quite as good as having a separate terminal theme, but then I haven't been able to use that feature properly. :(
Re:GitLab Database Incident – Live Report
by amatix on Wednesday February 01, 2017 @05:20AM
(#13539639)
This is a great idea! Documentation https://www.iterm2.com/documentation-badges.html -- supports emojis too fwiw
Re:GitLab Database Incident – Live Report
by ubercow on Tuesday January 31, 2017 @11:48PM
(#13538335)
Didn't know about this feature, gonna have to use this thanks!
Re:GitLab Database Incident – Live Report
by TimWolla on Tuesday January 31, 2017 @08:13PM
(#13537215)
In this case it looks like it has been a confusion between two different replicated Production databases. So this would not have helped.
Yep, good idea. The same thing has been suggested by team members http://imgur.com/a/TPt7O
Re:GitLab Database Incident – Live Report
by niftich on Tuesday January 31, 2017 @08:14PM
(#13537220)
I do this too, but in this case both machines were production, so this alone would not have sufficed. The system-default prompts on the other hand are universally garbage.
Re:GitLab Database Incident – Live Report
by NamTaf on Wednesday February 01, 2017 @02:10AM
(#13538961)
I have a user and a local admin account at work on our Windows SOE. I have made my PC's cmd.exe show green on black in large font, but intentionally did not change the local admin. When I run a command prompt in admin it's visible different. This is a great tip and it's caught me many times.
Re:GitLab Database Incident – Live Report
by nodesocket on Wednesday February 01, 2017 @03:38AM
(#13539307)
If using iterm you can set a "badge" text on a terminal window that shows up as an overlay. Super useful when you have lots of SSH sessions open to different servers.
Re:GitLab Database Incident – Live Report
by corecoder on Wednesday February 01, 2017 @06:15AM
(#13539828)
iterm badges have saved me many times.
Re:GitLab Database Incident – Live Report
by cabargas on Tuesday January 31, 2017 @08:16PM
(#13537238)
Is a really good idea, and is one of the improvements that are likely to be put in place as soon as possible. Its already listed on the document.
Re:GitLab Database Incident – Live Report
by karmicthreat on Tuesday January 31, 2017 @09:09PM
(#13537552)
I've done this exact thing my my servers. Also like GL I prepend PRODUCTION and STAGING on PS1.
I should probably make the PRODUCTION flash just in case.
Re:GitLab Database Incident – Live Report
by hobarrera on Tuesday January 31, 2017 @10:01PM
(#13537823)
We need a <blink> tag for our PS1.
Re:GitLab Database Incident – Live Report
by spydum on Tuesday January 31, 2017 @10:17PM
(#13537903)
Good news! Enable ANSI in your terminal and: ESC[5m
Re:GitLab Database Incident – Live Report
by eric_h on Friday February 03, 2017 @08:28AM
(#13559631)
You can do that - I actually tried it and everyone on my team agreed that it was bloody annoying, so I made it stop blinking (still red, though).
Not as serious, but I always set root terminals on my system to be this scary red.
Re:GitLab Database Incident – Live Report
by joshaidan on Tuesday January 31, 2017 @08:13PM
(#13537213)
How do you go about colour coding your terminal?
Re:GitLab Database Incident – Live Report
by TimWolla on Tuesday January 31, 2017 @08:16PM
(#13537234)
I assume he color coded the prompt. You can use ANSI color escape codes in there to e.g. color your hostname.
Here's a generator for Bash: http://bashrcgenerator.com/, the prompt's format string is stored in the $PS1 variable.
Re:GitLab Database Incident – Live Report
by simooooo on Wednesday February 01, 2017 @02:43AM
(#13539095)
My dev is yellow, staging orange, and live red
Re:GitLab Database Incident – Live Report
by tokenizerrr on Tuesday January 31, 2017 @08:14PM
(#13537221)
How exactly do you color code it?