diff --git a/docs/ssh.md b/docs/ssh.md new file mode 100644 index 0000000..38844ff --- /dev/null +++ b/docs/ssh.md @@ -0,0 +1,73 @@ +# General + +SSH is a helper utensil to connnect to remote servers. +The basic syntax is +``` +ssh user@domain +``` +You can either log in using a password or an ssh key. +The second method is considered safer and more user friendly. +To initialize the ability to log in using an ssh key, you need a local ssh key-pair. +If you dont have one, generate one on your local machine using +``` +ssh-keygen -t rsa +``` +and following the instructions. +This generated a public and private key pair which are saved in `~/.ssh`. +To then enable the key based login, you have to make sure that `~/.ssh` exists on the server. +Change the permisions of this folder using `chmod 700 ~/.ssh`. +The next step is to make the `authorized_keys` file using +``` +touch ~/authorized_keys +chmod 600 ~/.ssh/authorized_keys +``` +Now open the `authorized_keys` and copy-paste the public key contents in to it. + +One can also use `ssh-copy-id user@domain` after generating the key-pair. + + + +## Add keys to Keychain + +If you added a passphrase to your key, you may be tired of typing it over and over again. +Add the following to your `~/.ssh/config`. + +``` +Host HOME + User root + HostName domain.example + IdentityFile ~/.ssh/id_rsa + AddKeysToAgent yes + UseKeychain yes +``` + +This saves the passphrase in the keychain for the current session. +It also allows you to specify which specific key to use and to use `ssh HOME` to connect to the server. + + +## Add keys for layered logins + +If you need to connect to an access server before connecting to the actual server you want to connect to, this can be automized by adding + +``` +IgnoreUnknown AddKeysToAgent,UseKeychain + +## All EXEMPLUM-COMPANY +Host EXEMP* + User username + IdentityFile ~/.ssh/id_rsa + AddKeysToAgent yes + UseKeychain yes + +## Access server +Host EXEMPaccess + HostName login.example.com + +## Working server +Host EXEMPwork + HostName work.example.com + proxycommand ssh -CW %h:%p EXEMPaccess ## access server + +``` +to your `~/.ssh/config`. +To connect to the working server, just type `ssh EXEMPwork`. diff --git a/docs/vimwiki.md b/docs/vimwiki.md index 93df216..38da504 100644 --- a/docs/vimwiki.md +++ b/docs/vimwiki.md @@ -143,4 +143,26 @@ To only convert the current page to Html, use `:Vimwiki2HTML` which converts all existing `.wiki` files in to Html files and links them against each other. To expand this capability to Markdown, you have to include certain wrapper scripts. - - TODO +This wrapper script takes several arguments +``` +1. force : [0/1] overwrite an existing file +2. syntax : the syntax chosen for this wiki +3. extension : the file extension for this wiki +4. output_dir : the full path of the output directory, i.e. ‘path_html’ +5. input_file : the full path of the wiki page +6. css_file : the full path of the css file for this wiki +7. template_path : the full path to the wiki’s templates +8. template_default : the default template name +9. template_ext : the extension of template files +10. root_path : a count of ../ for pages buried in subdirs if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then e %root_path% is replaced by ‘../../../’. +``` +With this you then can use `pandoc` or similar markdown parser to generate your html files. +The script used for this is found [here](https://mykb.dieminger.ch/snippets/wikihtml.sh). +To enable the custom script, change the `vimwiki_list` to: +``` +let g:vimwiki_list = [{"path": '/PATH/TO/DIRECTORY/vimwiki', +\ "path_html": '/PATH/TO/DIRECTORY/vimwiki/HTML, +\ "syntax": 'markdown', "ext": '.md', +\ "custom_wiki2html": '~/wikihtml.sh', +\ "force": 1, "auto_export": 1}] +``` diff --git a/index.md b/index.md index 5ee8336..54f554e 100644 --- a/index.md +++ b/index.md @@ -1,9 +1,15 @@ + +Install instructions, configuration methods and much more for the setup of an usefull operating system. +Happy to accept pull requests for new topics! + # Programs - [qutebrowser](docs/qutebrowser.md) + A highly customizable keyboard focused webbrowser using vim bindings - [vimwiki](docs/vimwiki.md) -- [weechat](docs/weechat.md) -- [ssh](ssh) + A wiki script for vim +- [weechat](docs/weechat.md) A TUI client for matrix +- [ssh](docs/ssh.md) ssh configuration # Admin