News for hackers. Stuff that matters.
Re:Times I've Messed Up as a Developer by woodrowbarlow on Tuesday October 10, 2017 @03:04PM (#15444427)
my go-to .bashrc hashes the hostname into a color and prints the prompt in that color. it has saved me from making a dumb mistake a few times.
Re:Times I've Messed Up as a Developer by shocks on Tuesday October 10, 2017 @03:38PM (#15444732)
Production prompts are red.

Staging prompts are yellow.

Development prompts are green.

Re:Times I've Messed Up as a Developer by woodrowbarlow on Tuesday October 10, 2017 @03:43PM (#15444777)
yeah, that'd be great. but our staging units (i don't deal with production units) come and go so often that keeping a list of hostnames became unrealistic.
Re:Times I've Messed Up as a Developer by khedoros1 on Tuesday October 10, 2017 @03:58PM (#15444873)
Is there something in your dev process that would actually require you to implement it with a list of hostnames, rather than just putting the "staging" version of .bashrc onto the staging machines, and the "dev" version onto dev machines?
Re:Times I've Messed Up as a Developer by aidos on Tuesday October 10, 2017 @06:19PM (#15445797)
Mine is exactly the same :-)
Re:Times I've Messed Up as a Developer by tacone on Tuesday October 10, 2017 @03:20PM (#15444574)
Could you post the code somewhere?
Re:Times I've Messed Up as a Developer by woodrowbarlow on Tuesday October 10, 2017 @03:39PM (#15444736)
sure, although my technique is a bit kuldgy.

https://gist.github.com/woodrowbarlow/52b02ab27d0f8088891c3d...

look at `get_hash_color`.