From 2da989e2660ce4e696256ef41b9a4ba622980e90 Mon Sep 17 00:00:00 2001 From: thek4n Date: Sun, 14 Nov 2021 22:47:49 +0300 Subject: [PATCH] doc --- .subbash/export | 4 +++- .subbash/functions | 11 +++++++++++ .subbash/prompt | 2 +- README.md | 26 ++++++++------------------ doc/tips.md | 18 ++++++++++++++++++ git_setup.sh | 8 ++++++++ setup.sh | 0 7 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 doc/tips.md create mode 100644 git_setup.sh mode change 100644 => 100755 setup.sh diff --git a/.subbash/export b/.subbash/export index d9f8137..bc35a30 100644 --- a/.subbash/export +++ b/.subbash/export @@ -1,4 +1,6 @@ -export EDITOR=vim + + +export EDITOR="/usr/bin/env vim" export HISTSIZE=10000 export HISTFILESIZE=10000 diff --git a/.subbash/functions b/.subbash/functions index 036a810..d29d738 100644 --- a/.subbash/functions +++ b/.subbash/functions @@ -91,3 +91,14 @@ extract () { mcd () { mkdir -p "$1" && cd "$1" || return } + + +# Syntax-highlight JSON strings or files +# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json` +json() { + if [ -t 0 ]; then # argument + python -m json.tool <<< "$*" | pygmentize -l javascript + else # pipe + python -m json.tool | pygmentize -l javascript + fi +} diff --git a/.subbash/prompt b/.subbash/prompt index 128d148..43060a6 100644 --- a/.subbash/prompt +++ b/.subbash/prompt @@ -84,7 +84,7 @@ __prompt_command() { TERMINAL_NAME=${0%%/*} TERMINAL_NAME="\[\e]2;${TERMINAL_NAME^^}\a\]" - if [ $EXIT != 0 ]; then + if [ "$EXIT" != 0 ]; then PS1="$TERMINAL_NAME\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n\[$(tput sc; rightprompt $EXIT; tput rc)\]$prompt_color└─$close_color$info_color$end_symbol$close_color " else PS1="$TERMINAL_NAME\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n$prompt_color└─$close_color$info_color$end_symbol$close_color " diff --git a/README.md b/README.md index 4c41875..d6db6aa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

dotfiles

+

Kan`s dotfiles

@@ -13,7 +13,7 @@ ## Content * [Project description](#chapter-0) * [Installation](#chapter-1) -* [Tips](#chapter-2) +* [Docs](#chapter-2) @@ -35,25 +35,15 @@ dotfiles/setup.sh . ~/.bashrc ``` - -## Tips +## Docs +* [Tips](doc/tips.md) +* [Cron](doc/cron.md) +* [GPG](doc/gpg.md) +* [SSH](doc/ssh.md) +* [Vim](doc/vim.md) -```$RANDOM``` - Return random 0-32767\ -```\command``` - Without using alias - - - -### Autostart -* create ```/etc/systemd/system/.service``` -```bash -sudo vim /etc/systemd/system/.service # create custom service -sudo systemctl daemon-reload -sudo systemctl start .service # start custom service -sudo systemctl status .service # check status -sudo systemctl enable .service # autostart custom service -``` diff --git a/doc/tips.md b/doc/tips.md new file mode 100644 index 0000000..8aa15a4 --- /dev/null +++ b/doc/tips.md @@ -0,0 +1,18 @@ + +## Tips + + +```$RANDOM``` - Return random 0-32767\ +```\command``` - Without using alias + + + +### Autostart +* create ```/etc/systemd/system/service.service``` +```bash +sudo vim /etc/systemd/system/service.service # create custom service +sudo systemctl daemon-reload +sudo systemctl start service.service # start custom service +sudo systemctl status service.service # check status +sudo systemctl enable service.service # autostart custom service +``` diff --git a/git_setup.sh b/git_setup.sh new file mode 100644 index 0000000..cbe1879 --- /dev/null +++ b/git_setup.sh @@ -0,0 +1,8 @@ +echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): " +read -r full_name + +echo "Type in your email address (the one used for your GitHub account): " +read -r email + +git config --global user.email "$email" +git config --global user.name "$full_name" \ No newline at end of file diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755