2

If I have settings that I like to use on a linux machine that I've never been on before, how do I set them up quickly?

I already have a .vimrc, and tmux, is there a way to cart these things around easily when I jump onto a new machine?

And if the software for the config files isn't already installed, assuming I have access to install it, is there a tool that will do that as well as load my config files?

  • What if the new system doesn't have vim or tmux installed? – Jeff Schaller Jun 9 '16 at 2:30
  • That's always a possibility, but they're pretty common when working with *nix – leeand00 Jun 9 '16 at 3:00
  • Can't one get around that with ansible? – leeand00 Jun 9 '16 at 9:49
  • Depends on the permissions you have on the new system and whether your goal is to install software or just personal config files. The A's so far address the config files. – Jeff Schaller Jun 9 '16 at 9:51
  • 2
    I would suggest editing your Q to narrow the scope to a particular list of software that you want to have along with you andwhether your goal is to install that software system-wide for all users or just for yourself. – Jeff Schaller Jun 9 '16 at 10:03
3

tar

There is a plethora of possibilities on how to perform this. A common way that i saw people using since a long time ago was to build a script that just tar's all their configuration; then they just download the tar file and unpack. It could involve a file called myconf with a content like:

.vimrc
.bashrc
.profile
.xinitrc
.vifm
.xmonad

Then you run

tar -czvf myconf.tgz -T myconf

Download on the other machine and unpack.

The issue with this approach has always been completeness of the files. For example: you worked on machine A and there you created your .vimrc, next you worked on machine B (to which you copied your configuration) and updated .vimrc. When you got back to machine A you needed to copy the configuration from machine B. A mess resulted once dozens of machines were involved.


nfs

I saw NFS mounts used for this purpose as well. Either by holding the entire /home directories or by holding the configuration files to which users made soft links.

The NFS mount works much better than taring and copying things but has its own problems: If you need to work on machines on which you do not have root access, mounting is not an option. Moreover, creating NFS mounts over the internet might prove to be slow.


github (or bitbucket, or gitlab)

This one is my favourite. Since the raise of free and easily available source code repositories people kept finding new ways to use VCSs. You can use a code versioning system as a holder for configuration files.

Build a repository holding your configuration scripts and git clone (or hg, or svn, whatever you like the most) on the machines you use. You can commit and push back to the repository when you update your configuration and sync it on the other machines when you switch to them.

On the other hand, this option does not come without its own set of issues:

  • Do not create a source repository directly in your home directory, several VCSs do not like to have source trees inside other source trees. Create an extra directory in your home to hold the repository (a good name for it might be myconf or rc), and soft link the files you need (e.g. ln -s rc/.vimrc ~/.vimrc).

  • Never submit API keys or other data that should be private into a public source repository. Github sends you an email warning if you push something that looks like an API key, which probably is a good measure of how often it happens on github repositories.

| improve this answer | |
  • 1
    +1 for the git method. Been using it for a couple of years and works really nicely across multiple operating systems. – forquare Jun 9 '16 at 5:44
1

My suggestion would be to have your configurations on a flash drive, remote server, or remote repository (GitHub is always nice). That way it is a quick plug in, scp, or git away from being where you need it.

Another option is to carry a persistent bootable flash drive with you. Your settings and configurations will be one boot away when hardware is around.

Other than that, there is no way to have your custom settings available on a machine you have never been on before. You have to move them there yourself.

| improve this answer | |
0

Long term I'd recommend looking into setting up your own dotfiles directory that you keep under version control and backup to GitLab/BitBucket/GitHub. That way its as simple as cloning from repo on a new machine.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.