pcdshub / shared-dotfiles

Shared configuration useful for PCDS engineers: "dot" files such as ~/.bashrc or .ssh/config
https://github.com/pcdshub/shared-dotfiles/blob/master/helpme.md
3 stars 11 forks source link

shared-dotfiles

Shared configuration useful for PCDS engineers: "dot" files such as bash configuration (.bashrc) and SSH configuration (.ssh/config).

What is provided here?

On-site and off-site

Some configuration is broken up into "on-site" versus "off-site" here.

  1. The off-site configuration is meant for your laptop or machine you use at home to connect to the PCDS network by way of SSH, OpenVPN, or similar. It works well on SLAC WiFi, too, so you don't need to switch back and forth.
  2. The on-site configuration is meant to be used on PCDS machines like pslogin and psbuild-rhel7. You have a shared home storage space on these machines, so you will only need to install it once.

Use case: macOS/Linux machine at home/on-site

The off-site configuration is tailored for your use case.

See here for full setup instructions.

Use case: Windows machine at home/on-site

Whether you use Windows at home or on-site, you should consider using our pre-configured MobaXterm distribution.

How to use these

Trial run

You can try parts of these settings without installing anything by doing the following:

# Start off on psbuild-rhel7
$ ssh psbuild-rhel7

# Go to your home directory
$ cd

# In your home directory, clone the dotfiles
$ git clone git@github.com:pcdshub/shared-dotfiles dotfiles

# Run the "try me" script which enables access to the bash configuration
# provided by this repository:
$ ./try_me.sh

Please note that this only applies to the bash and vim configuration and not the SSH, git, and other provided configurations here.

If you like the experience provided by these scripts, use the following to source the shared-dotfiles in your current bash configuration:

# Source the 'bash_all.sh' script from shared-dotfiles
$ echo 'source $HOME/dotfiles/on_site/bash_all.sh' >> $HOME/.bashrc

Forking

Advanced users may want to start their own dotfiles repository based on this one. We recommend that you version control your dotfiles.

  1. Fork pcdshub/shared-dotfiles to your-user/shared-dotfiles
  2. $ ssh psbuild-rhel7
    $ cd   # <-- work in your home directory
    $ git clone git@github.com:your-user/shared-dotfiles dotfiles
  3. Either use the sourcing method above or refer to .bashrc directly:
    # Use the dotfiles bashrc as your .bashrc
    $ ln -s dotfiles/bashrc .bashrc

Keeping up-to-date with upstream changes will be your responsibility. You may need to rebase or merge with shared-dotfiles as your configuration gets customized.

Install shared-dotfiles as-is

These dotfiles can be used as your entire configuration, if you are not picky about customizations.

Note that this method includes all customizations provided here: from the bash scripts to vim configuration, and the rest.

To link the scripts and configuration files provided and use them every time when you login:

$ ssh psbuild-rhel7
$ cd
# In your home directory, clone the dotfiles:
$ git clone git@github.com:pcdshub/shared-dotfiles dotfiles
$ cd dotfiles
$ bash use_dotfiles.sh

Please note that the script will not overwrite existing files. You will need to manually move (or less preferably, remove) existing configuration files that are from shared-dotfiles.

You will only need to do this once.

Post-installation

"On-site" configuration

If you've installed or are working in a shared-dotfiles "trial mode", consider typing helpme to view the packaged helpme.md for a reminder on how to navigate directories, find IOCs, and recall what important directories there are.

SSH configuration

SSH configurations for on-site versus off-site usage exist.

The use_dotfiles.sh script assumes an on-site configuration for now, so it's recommended to run it on psbuild-rhel7 or similar.

Issues / suggestions?

Please feel free to open an issue!

It's the author's opinion that this is a useful thing for the group to collaborate on, and contributions/suggestions from the group can only make it better.