Saturday, November 16, 2013

Unix shell environment pro tip:

Something I'm doing now that I have just way to many machine on different networks...

 1) Setup a Dropbox or Google Drive account (probably dropbox since google drive isn't well supported in other unixes at the moment)
 2) Make directory called something like myprofile
 3) Initialize Git repositories (using git --bare):
   a) shell_profile
   b) vim (or emacs)
   c) ssh
 4) clone respective repositories into ~/.{profile,vim,ssh}
 5) Setup gitignore for private files (for example your ssh private key)
 6) Install your ssh_config, custom shell functions/aliases/prompts, vim syntax files, et cetera into respective directories and git add & push files
 7) write a function into custom profile (bash) to iterate to through git commits for shell workflow files call it something like sync_profile; remember to call this when you edit files or hook it your logout
 8) write a simple shell script in your remote drive (dropbox) that automates the directory cloning process

Now, when you get a new shell account/virtual-machine et cetera all you have to do get your "unified shell environment" is:
 a) Install/Mount dropbox
 b) run ~/Dropbox/

Upside is that if you screw up a config file, or something you also get all the benefits of version control via git.