Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> use a CSS manipulator such that my prod console is in a bright-freaking-red Chrome window with a red background. Blue for test, green for dev

Ha, I do the same thing. I learned about this from a previous job I had where prod/test webapps were functionally similar but had obnoxious coloring in the header. Very effective.



Visual indications are so great, aren't they? I do it with terminals, too; prod servers get obnoxious red-background prompts. (Root terms on all my machines look different from unprivileged ones, too.)


Wow, I can't remember the last time I ran a shell directly on a prod machine. The very thought feels so dirty now.


When you inherit your environment and are whipping it into shape, shit happens.


Whether it's shell literally, or "shell" as in, the window from which you ultimately perform shell-like things, there's still a place you perform these tasks and knowing when you are in simulation or actual is an important state to track.


How do you know what's really going on on those machines and in their respective environments assuming they are geographically distinct?


Any advice/tutorials on how to set this up? Ideally I'd like just that ssh session to change the text to red for prod boxes but then go back to my normal iTerm theme after exit...


In the .bashrc/.zshrc of the remote machine add this:

    echo '\033]11;#440000\007'
On the local machine add this to reset the terminal color:

    ssh () {/usr/bin/ssh "$@"; echo '\033]11;#000000\007'}


You can muck around with your bashrc, if you use that shell.


Hmm good idea. I haven't had any issue with it but it's trivial to change background colors. Probably not a bad idea. Thanks for the tip!


Any links to how to do this? My google-fu seems to be failing me. I'm assuming you somehow set things up so it automatically detects the page / content (based on the environment name or instance tags??) and changes the background?


Easy way to do this in e.g. Rails:

  <body style="foo bar baz env-#{Rails.environment}">
Then use CSS like you would normally on body.env-production, body.env-development, etc.


You meant class, not style. But great tip though:

      <body class="foo bar baz env-#{Rails.environment}">


One way to do this is to look at the "awsc-login-display-name-account" div, which contains your account ID. You can then alter the look of the page (perhaps making the top header bright red) depending on which account ID is in use.

Could make a nice Chrome extension...


You can use an extension like Greasemonkey, with a simple script which will extract aws account id and will apply some css based on it.


I log into different Chrome profiles that style the same pages differently. Dumb and easy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: