4 ms·
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.
by woodrowbarlow 9y ago
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.
- tacone 9y agoCould you post the code somewhere?
- woodrowbarlow 9y agosure, although my technique is a bit kuldgy. https://gist.github.com/woodrowbarlow/52b02ab27d0f8088891c3d6fb6a31edf https://gist.github.com/woodrowbarlow/52b02ab27d0f8088891c3d... look at `get_hash_color`.
- shocks 9y agoProduction prompts are red. Staging prompts are yellow. Development prompts are green.
- aidos 9y agoMine is exactly the same :-)
- woodrowbarlow 9y agoyeah, 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.
- khedoros1 9y agoIs 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?