From dc883900bbfa50b7963480fa5fb563112692fb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 15:09:58 +0100 Subject: [PATCH 1/7] Improve backup script --- zsh/.zshrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index e4364b5..5905353 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -90,12 +90,15 @@ function zvm_after_init() { # Use FZY instead of FZF for ctrl-t function find_files() { zle -I - PATHS=$(fd -H . /home/server/Workspace -t d -d 5) + PATHS="/home/server/.dotfiles/" + if [ -d ~/Workspace ]; then + PATHS="$PATHS\n$(fd -H . ~/Workspace -t d -d 5)" + fi if [ -d ~/Containers ]; then PATHS="$PATHS\n$(fd -H . ~/Containers -t d -d 2)" fi if [ -d /RAID/10/Shared\ Storage/ ]; then - PATHS="$PATHS\n/RAID/10/Shared Storage/Thomas" + PATHS="$PATHS\n/RAID/10/Shared Storage/" PATHS="$PATHS\n$(fd -H . /RAID/10/Shared\ Storage -t d -d 2)" fi if [ -d /RAID/10/Private\ Storage/Thomas ]; then From 8d2b40848e33e3c18fa6f4cc19a1e027cec8117b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 15:12:11 +0100 Subject: [PATCH 2/7] Use /home/user for dotfiles --- zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 5905353..a490ba0 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -90,7 +90,7 @@ function zvm_after_init() { # Use FZY instead of FZF for ctrl-t function find_files() { zle -I - PATHS="/home/server/.dotfiles/" + PATHS="$HOME/.dotfiles/" if [ -d ~/Workspace ]; then PATHS="$PATHS\n$(fd -H . ~/Workspace -t d -d 5)" fi From 9ac9bfc64a5c2474419055050e946343692a30e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 18:03:30 +0100 Subject: [PATCH 3/7] Add fzy to install --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index d790020..ecd0eba 100755 --- a/install.sh +++ b/install.sh @@ -65,7 +65,7 @@ fi ################################################# if $ZSH; then PROFILE=true - dependencies="fzf zsh curl zoxide" + dependencies="fzf zsh curl zoxide fzy" if [[ $OS == "NAME=\"Arch Linux\"" ]]; then $SUDO pacman -Sy --needed --noconfirm $dependencies zsh-autosuggestions echo "Please manually install yay" From 1dcd4d0aedf0fffd8cef98061965c04e60755140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 18:05:42 +0100 Subject: [PATCH 4/7] Add git config --- git/config | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 git/config diff --git a/git/config b/git/config new file mode 100644 index 0000000..e83f4f5 --- /dev/null +++ b/git/config @@ -0,0 +1,26 @@ +[user] + email = email@thomasave.be + name = Thomas Avé +[alias] + s = status + a = add +[color] + ui = auto +[core] + excludesfile = ~/.gitignore + editor = nvim +[diff] + noprefix = true +[pull] + rebase = false +[push] + autoSetupRemote = true +[init] + defaultBranch = master +[credential] + helper = store +[filter "lfs"] + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true + clean = git-lfs clean -- %f From 6a93710d8a8ae3cb571e0cbeecdeb8d109b1ef46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 18:22:12 +0100 Subject: [PATCH 5/7] Don't load micromamba when not installed --- zsh/.zshrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index a490ba0..0633800 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -161,8 +161,11 @@ export TERM="screen-256color" export PATH=$HOME/.local/bin:$PATH export GOPATH=/tmp/go -eval "$(micromamba shell hook --shell zsh)" -export MAMBA_ROOT_PREFIX="$HOME/.micromamba"; +if command -v micromamba &> /dev/null; then + eval "$(micromamba shell hook --shell zsh)" + export MAMBA_ROOT_PREFIX="$HOME/.micromamba"; +fi + autoload -Uz add-zsh-hook eval "$(zoxide init zsh --cmd j)" From 2305fe92d5efeb25aeac541a40efbb09ccc8fe11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 18:23:56 +0100 Subject: [PATCH 6/7] Add riva command --- nvim/lua/plugins/codegen.lua | 22 ++++++++++++++++++++++ zsh/.zshrc | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 nvim/lua/plugins/codegen.lua diff --git a/nvim/lua/plugins/codegen.lua b/nvim/lua/plugins/codegen.lua new file mode 100644 index 0000000..a8a565f --- /dev/null +++ b/nvim/lua/plugins/codegen.lua @@ -0,0 +1,22 @@ +return { + "David-Kunz/gen.nvim", + opts = { + model = "mistral", -- The default model to use. + host = "localhost", -- The host running the Ollama service. + port = "11434", -- The port on which the Ollama service is listening. + display_mode = "float", -- The display mode. Can be "float" or "split". + show_prompt = false, -- Shows the Prompt submitted to Ollama. + show_model = false, -- Displays which model you are using at the beginning of your chat session. + quit_map = "q", -- set keymap for quit + no_auto_close = false, -- Never closes the window automatically. + command = function(options) + return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/chat -d $body" + end, + -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). + -- This can also be a command string. + -- The executed command must return a JSON object with { response, context } + -- (context property is optional). + -- list_models = '', -- Retrieves a list of model names + debug = false -- Prints errors and the command which is run. + } +} diff --git a/zsh/.zshrc b/zsh/.zshrc index 0633800..6a1b2e7 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -186,6 +186,10 @@ function s() { ssh server@mallorea -t "cd \"$(pwd)\" ; zsh --login" } +function riva() { + ssh user@riva -t "cd \"$(pwd)\" ; zsh --login" +} + if [ "$SSH_CLIENT" ] then source_port=$(echo $SSH_CLIENT | awk '{ print $2 }') @@ -207,7 +211,6 @@ alias ll='ls -lhat' alias clip="xsel --clipboard" alias compress="tar --use-compress-program=lbzip2 -cvf" alias vim="nvim" -alias v="nvim" alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config" alias python=python3 From d702a9404d629a93ced2dd37ffbfad133f0aad2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 24 Mar 2024 21:18:29 +0100 Subject: [PATCH 7/7] Sun Mar 24 09:15:18 PM CET 2024 --- server/50-cloud-init.yaml | 31 +++++++++++++++++++++++++++++++ zsh/.zshrc | 17 ++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 server/50-cloud-init.yaml diff --git a/server/50-cloud-init.yaml b/server/50-cloud-init.yaml new file mode 100644 index 0000000..e156bc5 --- /dev/null +++ b/server/50-cloud-init.yaml @@ -0,0 +1,31 @@ +network: + version: 2 + renderer: networkd + + ethernets: + eno1: + match: + macaddress: 18:C0:4D:D9:D8:60 + dhcp4: false + dhcp6: false + accept-ra: no + enp4s0: + match: + macaddress: 00:E0:53:42:3D:31 + dhcp4: false + dhcp6: false + accept-ra: no + + bridges: + br0: + macaddress: D6:B6:23:46:3A:D4 + interfaces: [enp4s0] + addresses: [192.168.1.2/24] + ipv6-address-token: "::2" + dhcp6: false + dhcp4: false + nameservers: + addresses: [192.168.1.2, 1.1.1.1, 1.0.0.1] + routes: + - to: default + via: 192.168.1.1 diff --git a/zsh/.zshrc b/zsh/.zshrc index 6a1b2e7..eb412c8 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -90,20 +90,23 @@ function zvm_after_init() { # Use FZY instead of FZF for ctrl-t function find_files() { zle -I - PATHS="$HOME/.dotfiles/" + PATHS="" + if [ -d ~/.dotfiles]; then + PATHS="$PATHS\n$(fd -H . ~/.dotfiles -t d -d 5)" + fi if [ -d ~/Workspace ]; then PATHS="$PATHS\n$(fd -H . ~/Workspace -t d -d 5)" fi if [ -d ~/Containers ]; then PATHS="$PATHS\n$(fd -H . ~/Containers -t d -d 2)" fi - if [ -d /RAID/10/Shared\ Storage/ ]; then - PATHS="$PATHS\n/RAID/10/Shared Storage/" - PATHS="$PATHS\n$(fd -H . /RAID/10/Shared\ Storage -t d -d 2)" + if [ -d ~/Storage/Shared ]; then + PATHS="$PATHS\n~/Storage/Shared" + PATHS="$PATHS\n$(fd -H . ~/Storage/Shared -t d -d 2)" fi - if [ -d /RAID/10/Private\ Storage/Thomas ]; then - PATHS="$PATHS\n/RAID/10/Private Storage/Thomas" - PATHS="$PATHS\n$(fd -H . /RAID/10/Private\ Storage/Thomas -t d -d 1)" + if [ -d ~/Storage/Thomas ]; then + PATHS="$PATHS\n~/Storage/Thomas" + PATHS="$PATHS\n$(fd -H . ~/Storage/Thomas -t d -d 1)" fi BUFFER=cd "$(echo $PATHS | fzy -l 20)" zle accept-line