From bd85acf6a408674bcdcb5116963fe4fea2247280 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 20 Nov 2018 20:21:29 +0200 Subject: Simplyfy restore arguments --- README.html | 253 ++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 170 insertions(+), 83 deletions(-) (limited to 'README.html') diff --git a/README.html b/README.html index 6c38c37..215584d 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -232,36 +232,37 @@ for the JavaScript code in this tag.

Table of Contents

-
-

ck

-
+
+

ck

+

The Config Keeper

@@ -332,9 +333,9 @@ You can even export all ck data with the export action. This

-
-

Technicalities

-
+
+

Technicalities

+

Upon adding a config to ck, it moves it to the specified folder and adds a symbolic link back where it came from (ln -s). @@ -347,9 +348,9 @@ majority should).

-
-

Download

-
+
+

Download

+

Go ahead and download ck and give it a try. It comes with a help sub-command that explains any inquires you might have. @@ -367,13 +368,13 @@ You can also read the manpage down below.

-
-

build it

+
+

build it

-
-

requirements

-
+
+

requirements

+
  • cmake
  • sqlite3-dev
  • @@ -382,9 +383,9 @@ You can also read the manpage down below.
-
-

make && install

-
+
+

make && install

+

Use -DCMAKE_INSTALL_PREFIX when running cmake to change the install path.

@@ -394,7 +395,7 @@ Use -DCMAKE_INSTALL_PREFIX when running cmake to change the install # make a build directory and enter it > mkdir ~/ck_build; cd ~/ck_build; # run cmake -> cmake ~/code/ck +> cmake ~/code/ck # run make > make # install it @@ -407,16 +408,16 @@ Use -DCMAKE_INSTALL_PREFIX when running cmake to change the install
-
-

for devs

-
+
+

for devs

+

Please be kind to each other.

-
-

CMake options

-
+
+

CMake options

+

cmake accepts the following options:

@@ -437,9 +438,9 @@ To use any one of them append it after the cmake command like so:
-
-

compiler

-
+
+

compiler

+

Pick your favorite

@@ -469,9 +470,9 @@ Pick your favorite
-
-

tests

-
+
+

tests

+

The testing "suite" is a bash script that runs regression and unit tests. Regression tests are under the tests/ directory @@ -480,9 +481,9 @@ under unit/ directory and test the code.

-
-

run tests

-
+
+

run tests

+

First make sure you build ck with the -DCK_TESTS=1 option. Then go to the build directory and type: @@ -505,9 +506,9 @@ This will match any test scrits with add in their name.

-
-

test suite

-
+
+

test suite

+
$ ./test-ck -h
 ck test suite
@@ -527,17 +528,17 @@ flags:
 
-
-

ck configuration

-
+
+

ck configuration

+

See the manpage below.

-
-

Usage

+
+

Usage

ck's goal is to assist with the configuration file management. @@ -547,9 +548,9 @@ ck's goal is to assist with the configuration file management. This section is an example usage.

-
-

Initialize

-
+
+

Initialize

+
cd ~
 # make the directories for the configs
@@ -562,9 +563,9 @@ $ ck init configs/vc configs/sec
 
-
-

Add configs

-
+
+

Add configs

+
# add emacs configs
 ## primary config
@@ -592,9 +593,9 @@ $ sudo ck -c /home/ckuser add ssh /etc/ssh/sshd_config -s
 
-
-

Using the ck actions

-
+
+

Using the ck actions

+
# list the configs in a treelike structure with basename only
 $ ck list tree -b
@@ -633,9 +634,9 @@ $ ck delete emacs
 $ ck del emacs init.el
 
 # restore all links (on a new instalation)
-$ ck restore all
+$ ck restore --all
 # restore a program's links
-$ ck r -p emacs
+$ ck r emacs
 
 # get help for an action
 $ ck h add
@@ -644,13 +645,99 @@ $ ck --help e
 
+ +
+

Copying configs to a different linux system

+
+

+Using the method described below one can use ck +to copy the configs to a different linux system. +In this example we assume we have the ck instance we created +above and we want to copy some configs to our new VPS. +

+ +

+We will also assume that the VPS' username is different +that the one on our desktop (ckuser in our example). +

+
+ +
    +
  • Start at the desktop by exporting the ck files
    +
    +
    +
    you@desktop -> ck export
    +
    +
    +
    +
  • + +
  • Copy the resulting tar file to the server
    +
    +
    +
    you@desktop -> scp ck.tar.gz ckuser@server:/home/ckuser
    +
    +
    +
    +
  • + +
  • Now we ssh to the server
    +
    +
    +
    you@desktop -> ssh ckuser@server
    +
    +
    +
    +
  • + +
  • Start by untaring the archive & installing ck
    +
    +
    +
    ckuser@server -> tar zxf ck.tar.gz
    +
    +
    +
    +
  • + +
  • Move the version_control_dir and secer_dir to where you want them to be
  • +
  • Move the ckrc and ckdb files where you want ck config home to be
  • +
  • Edit ckrc and change the home_dir to /home/ckuser
  • +
  • Also change secret_dir and version_control_dir to where you placed them before
  • +
  • Make sure ck will find your config by default by setting the $CK_CONFIG environment variable
    +
    +

    +Edit bashrc to make this permanent. +

    +
    +
    ckuser@server -> export CK_CONFIG=/where/you/have/ckrc/and/ckdb
    +
    +
    + +

    +Note, you might not have to use this if you use one of the default config locations. +ck will first check $XDG_CONFIG_HOME/ck and then $HOME/.ck so using either one of these will do. +

    +
    +
  • +
  • Remove any existing conflicting configs
  • +
  • Restore your configs
    +
    +
    +
    ckuser@server -> ck restore zsh
    +ckuser@server -> ck restore emacs
    +
    +
    +
    +
  • +
+
-
-

manpage

+
+

manpage

- + @@ -882,7 +969,7 @@ manage configuration across the system

-

restore −p PROGRAM_NAME

+

restore PROGRAM_NAME

@@ -895,7 +982,7 @@ manage configuration across the system

-

restore all

+

restore −−all

@@ -1700,11 +1787,11 @@ USAGE

ck

- + -

restore −p PROGRAM_NAME

- +

restore PROGRAM_NAME

+ @@ -1713,11 +1800,11 @@ USAGE

ck

- + -

restore all

- +

restore −−all

+ @@ -1746,7 +1833,7 @@ USAGE

-

all

+

--all

@@ -1756,8 +1843,8 @@ USAGE

EXAMPLES

-
$ ck restore all
-$ ck restore -p emacs
+
$ ck restore --all
+$ ck restore emacs

GET HELP @@ -1936,7 +2023,7 @@ flags: @CMAKE_C_FLAGS@

-

Created: 2018-11-20 Tue 13:48

+

Created: 2018-11-20 Tue 20:21

Validate

-- cgit v1.2.3