Manage Your Configs with vcsh
Now that your file's being tracked by the git repository inside vcsh, let's commit it by running the following git-like command:
bill@test:~$ git commit -m 'Initial Commit' master (root-commit) bc84953 Initial Commit Committer: Bill Childers firstname.lastname@example.org 1 file changed, 2 insertions(+) create mode 100644 .vimrc
Now for the really cool part. Just like standard git, you can push your files to a remote repository. This lets you make them available to other machines with one command. Let's do that now. First, you'll add the remote server. (I assume you already have a server set up and have the proper accounts configured. You'll also need a bare git repo on that server.) For example:
bill@test:~$ git remote add origin git@gitserver:vim.git
Next, push your files to that remote server:
bill@test:~$ git push -u origin master Counting objects: 3, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 272 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@gitserver:vim.git * new branch master -> master Branch master set up to track remote branch master from origin. bill@test:~$ exit
exit line at the end. This exits the
"vcsh fake git repo". Now
your .vimrc file is checked in and copied to a remote server! If there are
other programs for which you'd like to check in configurations, like mutt, you
simply can create a new repo by running
vcsh init mutt, and then run through
the process all over again, but this time, check your files into the mutt
Move Your Configuration to Another Machine
To sync your configuration to another machine, you just need to install vcsh, git and mr, and then run a similar process as the steps above, except you'll do a git pull from your server, rather than a push. This is because you don't have the .vimrc file you want locally, and you want to get it from your remote git repository.
The commands to do this are:
bill@test2:~$ sudo apt-get install vcsh git mr bill@test2:~$ vcsh enter vim bill@test2:~$ git remote add origin git@gitserver:vim.git bill@test2:~$ git pull -u origin master From gitserver:vim * branch master -> FETCH_HEAD bill@test2:~$ exit
Now you've got your checked-in .vimrc file on your second host! This process works, but it's a little clunky, and it can become unwieldy when you start spawning multiple repositories. Luckily, there's a tool for this, and it's called mr.
Wrapping It All Up with mr
If you plan on using multiple repositories with vcsh (and you should—I'm
tracking 13 repositories at the moment), getting a configuration set up
for mr is essential. What mr brings to the table is a way to manage all the
repositories you're tracking with vcsh. It allows you to enable and
disable repositories simply by adjusting one symlink per repository, and it
also gives you the ability to update all your repos simply by running one
Perhaps the best way to get started using mr is to clone the repo that the vcsh author provides. This is done with the following command:
bill@test2:~$ vcsh clone ↪git://github.com/RichiH/vcsh_mr_template.git mr Initialized empty Git repository in ↪/home/bill/.config/vcsh/repo.d/mr.git/ remote: Counting objects: 19, done. remote: Compressing objects: 100% (14/14), done. remote: Total 19 (delta 1), reused 15 (delta 0) Unpacking objects: 100% (19/19), done. From git://github.com/RichiH/vcsh_mr_template * new branch master -> origin/master
Bill Childers is the Virtual Editor for Linux Journal. No one really knows what that means.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- BitTorrent Inc.'s Sync
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- New Container Image Standard Promises More Portable Apps
- The Humble Hacker?
- The Death of RoboVM
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- ACI Worldwide's UP Retail Payments
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide