0

I have an idea about knowledge base application.

Now, I have script kbase.sh, and I have many knowledge informations/examples about os (working with files, folders, os administration, etc) in text files named like this,

java.kb
kbase.sh
letsencrypt.kb
lvm.kb

and so on.

In file, first line is commented (used as keywords), after this is example of commands, ended with blank line and then start next comment (next kbase information). Example of kbase (bash.kb) file here,

## bash, folders, gzip multiple folders to multiple files
for dir in *; do base=$(basename "$dir"); tar zcvf "${base}.tar.gz"   "$dir"; done

## bash, files, rename multiple files
for f in *.jpg; do mv "$f" "$(echo "$f" | sed s/IMG/VACATION/)"; done

## bash, if, check if folder is mounted
if mount | grep /home/hosek/test > /dev/null; then
echo "yay"
else
echo "nay"
fi

and so on.

Now it is working with combination of autocomplete and bash commands, for example if I wanna know how to rename multiple files, just do this in terminal.

kba<TAB> <TAB><TAB> (cat all *.kb files and grep all commented lines)

kbase.sh bash<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash,')

kbase.sh bash fil<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash, file,' or '## bash, files,')

kbase.sh bash files ren<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash, files,' && 'ren')

kbase.sh bash files ren<ENTER> (cat all *.kb files and grep all commented lines with '## bash, files,' && 'ren', and write all lines started '##' until '##')

It shows me all lines from first comment '## bash, files, rename ...' to next founded comment/line with '##'.

For example, this command

kbase.sh bash files ren<ENTER>

shows me all matches (grep, from ## to ##), so it display this

## bash, files, rename multiple files
for f in *.jpg; do mv "$f" "$(echo "$f" | sed s/IMG/VACATION/)"; done

So this is quite nice for fast searching. But it is not very practical, when I am in terminal and I have to go to another terminal, and do kbase.sh blablabla etc.

Could be very nice if exist some similar application, but for X (especially XFCE), where could I search and edit very similar way, for example window with search input and whisperer (for example same mechanism with cat and grep), and then show me results (in same way as kbase.sh script).

Is there any very simple application like this? Or is there better way to work with knowledge base (chronic googling is not very practical)?

If not, I wanna make application for this. Where can I start? C++?

Or best solution is do this as webpage in php and ajax?

Thank you very much for your time and ideas.

BR, Stan.

0

Consider applications like Zim (https://zim-wiki.org/), cherrytree (https://www.giuspen.com/cherrytree/) or Foswiki (https://foswiki.org/). These allow information to be structured similarly to the way you have done it now, with topics in different pages, an outline structure for hierarchical organization, and (in a couple of cases) direct wiki links from page to page.

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.