<commit_before>System Configuration Management
========
	Usage: osconf [options] node file

	System Configuration Management

	Options:
	  --version             show program's version number and exit
	  -h, --help            show this help message and exit
	  -d, --daemon          run as daemon
	  -g, --get             get config from remote
	  -p, --put             put config to remote

	  Configuration Management:
		--list              show module message
		-e                  default editor is vim
		--edit=nano         choose from vi, vim, nano

	  Repositories Management:
		--init=directory    init local repositories
		--clone=http://domain/project.git
							clone git repositories
		--pull              pull config from remote repositories
		--push              push config to remote repositories
		--add=/path/to/file
							add file to repositories
		--status            show status
		--commit=message    commit to local repositories
		--log               show log

	  Homepage: http://netkiller.github.io	Author: Neo <<EMAIL>>

Init repo
-----
	$ osconf --init=/tmp/test

Clone repo
-----
	$ osconf --clone=/tmp/test
	$ osconf --clone=https://github.com/oscm/shell.git
	
get config from remote
-----
	# get directory
	$ osconf -g root@192.168.6.10 /etc/nginx/
	
	# get a file
	$ osconf -g root@192.168.6.10 /etc/passwd
	
put config to remote
-----
	$ osconf -g root@192.168.6.10 /etc/nginx/nginx.conf
	<commit_msg>update doc/osconf.md<commit_after>System Configuration Management
========
	Usage: osconf [options] node file

	System Configuration Management

	Options:
	  --version             show program's version number and exit
	  -h, --help            show this help message and exit
	  -d, --daemon          run as daemon
	  -g, --get             get config from remote
	  -p, --put             put config to remote

	  Configuration Management:
		--list              show nodes message
		-e                  default editor is vim
		--edit=nano         choose from vi, vim, nano

	  Repositories Management:
		--init=directory    init local repositories
		--clone=http://domain/project.git
							clone git repositories
		--pull              pull config from remote repositories
		--push              push config to remote repositories
		--add=/path/to/file
							add file to repositories
		--status            show status
		--commit=message    commit to local repositories
		--log               show log

	  Homepage: http://netkiller.github.io	Author: Neo <<EMAIL>>

Init repo
-----
	$ osconf --init=/path/to/system

Clone repo
-----
	$ osconf --clone=/path/to/system
	$ osconf --clone=https://github.com/oscm/shell.git
	
Get config from remote
-----
	# get directory
	$ osconf -g root@192.168.6.10 /etc/nginx/
	
	# get a file
	$ osconf -g root@192.168.6.10 /etc/passwd
	
Put config to remote
-----
	$ osconf -p root@192.168.6.10 /etc/nginx/nginx.conf

Edit config
-----
	$ osconf -e root@192.168.6.10 /etc/nginx/nginx/conf.d/default.conf

	
Configure
-----

	$ cat /srv/devops/etc/os.ini
	[main]
	logfile=~/log/osconf.log
	logdir=~/log
	repositories=~/.osconf
	backup=~/.backup
	suffix=''

	[www.example.com]
	user=www
	file.iptable=/etc/sysconfig/iptables
	[news.example.com]
	host=www@news.example.com
	
	
Example
-----

### Initialization

	# install key file to remote host.
	
	# ssh-keygen
	Generating public/private rsa key pair.
	Enter file in which to save the key (/root/.ssh/id_rsa): 
	Enter passphrase (empty for no passphrase): 
	Enter same passphrase again: 
	Your identification has been saved in /root/.ssh/id_rsa.
	Your public key has been saved in /root/.ssh/id_rsa.pub.
	The key fingerprint is:
	fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b:9d:a7:2d:66:ad:01:ca:2a root@localhost.localdomain
	The key's randomart image is:
	+--[ RSA 2048]----+
	|                 |
	|                 |
	|      .          |
	|       o + .     |
	|      . S o .    |
	|     . B X =     |
	|      + o O o    |
	|  E  .   o +     |
	|   ..     .      |
	+-----------------+

	$ ssh-copy-id root@host

	$ osconf --init=system
	Initialized empty Git repository in /opt/www/system/.git/
	-

### Edit file os.ini
	
	[main]
	repositories=~/system
	
### Get some of config file.

	$ osconf -g root@192.168.6.10 /etc/nginx/
	
### Edit config file.
	$ osconf -e www@192.168.127.12 /etc/nginx/nginx/conf.d/default.conf
	
### Put file to remote host.

	$ osconf -p www@192.168.127.12 /etc/nginx/nginx/conf.d/default.conf
	
	
{'fraction_non_alphanumeric': 0.12829763246899661, 'fraction_numerical': 0.02818489289740699, 'mean_word_length': 1.9771812080536912, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 12, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2521594', 'n_tokens_mistral': 1651, 'n_tokens_neox': 1429, 'n_words': 410}