From 4495cfafdb1a804de411315381547c3152b59b41 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 2 Dec 2024 20:41:32 -0600 Subject: [PATCH 01/16] Update game name --- invoke/{minetest => luanti}/tasks.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename invoke/{minetest => luanti}/tasks.py (100%) diff --git a/invoke/minetest/tasks.py b/invoke/luanti/tasks.py similarity index 100% rename from invoke/minetest/tasks.py rename to invoke/luanti/tasks.py -- 2.47.3 From 1c420628e8d270d7692e7086177eb5818e611f07 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Fri, 3 Jan 2025 09:57:14 -0600 Subject: [PATCH 02/16] Cleanup paths --- files/paths.ps1 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/files/paths.ps1 b/files/paths.ps1 index 9af41eb..84e694e 100644 --- a/files/paths.ps1 +++ b/files/paths.ps1 @@ -19,13 +19,8 @@ function Add-ToPath { if($IsWindows){ # Some Paths that are annoying to find/restore if the installer fails Add-ToPath "C:\Program Files\Git\cmd" # Version control is nice. - Add-ToPath "C:\Program Files\Microsoft VS Code\bin" -optional # One Editor to rule them all - Add-ToPath "C:\Program Files\Git\cmd" # Version control is nice. Add-ToPath "C:\ProgramData\chocolatey\bin" # Package management is nice. Add-ToPath "C:\Program Files (x86)\GnuWin32\bin" -optional # GNU Utils - i.e. rm - Add-ToPath "C:\bin\x16emu" -optional # X16 Emulator - Add-ToPath "$env:src\x16-demo\tools" -optional # x16 python tools - Add-ToPath "$env:src\flutter\bin" -optional # Flutter for Dart Add-ToPath "$env:src\bin" -optional # anything else I need Add-ToPath "$HOME\bin" -optional # anything else I need @@ -34,6 +29,7 @@ if($IsWindows){ Add-ToPath "$env:src\agenda" -optional # command line chart utility edthedev\chart Add-ToPath "$env:src\todolist" -optional # todo list utility edthedev\todolist + Add-ToPath "C:\ProgramData\mingw64\mingw64\bin" # for GCC for LazyVim } else { Add-ToPath "$env:src/bin" -optional # anything else I need @@ -48,7 +44,6 @@ else { } Add-ToPath "$HOME/go/bin" -optional # x16 python tools - # krew for K8S pluginsa - specifically vtrl Add-ToPath -optional "$HOME/.krew/bin" Add-ToPath -optional 'C:\Users\delaport\AppData\Roaming\Python\Python312\Scripts' -- 2.47.3 From bb2bdf021a4e7f79c7c2d9f8480c2f61ca24fa0f Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 10 Feb 2025 15:20:49 -0600 Subject: [PATCH 03/16] Add neovim journal config --- files/Microsoft.PowerShell_profile.ps1 | 1 + files/neovim/nvjournal.lua | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 files/neovim/nvjournal.lua diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index 76dfcf5..ae447fe 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -51,6 +51,7 @@ $maybe_mods | ForEach-Object { } } +$env:nvim_config = "$HOME\AppData\Local\nvim" # Load local source modules # Import-Module $env:src\powershell-scripts\modules\MarkdownGitHub.psm1 diff --git a/files/neovim/nvjournal.lua b/files/neovim/nvjournal.lua new file mode 100644 index 0000000..6107aef --- /dev/null +++ b/files/neovim/nvjournal.lua @@ -0,0 +1,20 @@ +local function new_note() + local month = os.date("%m") + local input = vim.fn.input("Topic: ") + local linput = string.lower(input) + local cleaned_input = string.gsub(linput, " ", "-") + local filename = "~/Box/Journal/" .. month .. "-" .. cleaned_input .. ".md" + if #linput == 0 then + filename = "~/Box/Journal/" + end + vim.cmd("edit " .. filename) +end + +local function setup() + vim.api.nvim_create_user_command("Note", new_note, {}) +end + +return { + setup = setup, + new_note = new_note, +} -- 2.47.3 From 0e26a1e81d904c0ae41d12d8f61ed02fc7dc279b Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 10 Feb 2025 15:43:35 -0600 Subject: [PATCH 04/16] Add init.lua for NeoVim --- files/neovim/init.lua | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 files/neovim/init.lua diff --git a/files/neovim/init.lua b/files/neovim/init.lua new file mode 100644 index 0000000..42997b3 --- /dev/null +++ b/files/neovim/init.lua @@ -0,0 +1,49 @@ +local nvjournal = require("plugins.nvjournal") +nvjournal.setup() + +vim.print("Setup Vundle") + +-- Ensure Vundle is installed +local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/Vundle.vim' +if vim.fn.empty(vim.fn.glob(install_path)) > 0 then + vim.fn.system({'git', 'clone', 'https://github.com/VundleVim/Vundle.vim.git', install_path}) +end + +-- Initialize Vundle +vim.cmd [[ + set nocompatible " Be iMproved, required + filetype off " Required + + " Set the runtime path to include Vundle and initialize + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + + " Let Vundle manage Vundle, required + Plugin 'VundleVim/Vundle.vim' + + " Add plugins here + " For example, to add vim-fugitive: + " Plugin 'tpope/vim-fugitive' + Plugin 'vim-pandoc/vim-pandoc-syntax' + + call vundle#end() " Required + filetype plugin indent on " Required + + augroup pandoc_syntax + au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc + augroup END + + + let g:pandoc#syntax#conceal#use = 0 + +]] + + +-- vim.print("what?") +vim.opt.number = true +vim.g.mapleader = ' ' + +vim.api.nvim_set_keymap("n", "j", ":Note", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "d", ":Notedaily", { noremap = true, silent = true }) + + -- 2.47.3 From daa13e331dcc0807b9c680d0bfe37abeafcfe005 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 10 Feb 2025 15:45:06 -0600 Subject: [PATCH 05/16] Remove old init.lua --- files/init.lua | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 files/init.lua diff --git a/files/init.lua b/files/init.lua deleted file mode 100644 index 5448144..0000000 --- a/files/init.lua +++ /dev/null @@ -1,10 +0,0 @@ -local Plug = vim.fn['plug#'] - -vim.call('plug#begin') - -Plug 'tpope/vim-sensible' --- Plug 'pprovost/vim-ps1' --- Plug 'vim-airline/vim-airline' --- Plug 'sheerun/vim-polyglot' - -vim.call('plug#end') -- 2.47.3 From e9296d27e256eb009f7963438b238666a3a78e0d Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 19 Feb 2025 10:33:27 -0600 Subject: [PATCH 06/16] Add functions for quick journal access --- files/Microsoft.PowerShell_profile.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index ae447fe..e39aab2 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -15,6 +15,23 @@ Set-Alias code codium # Prefer Codium # Dashboard New-Alias dash Show-MyDashboard # from dash.psm1 New-Alias today Get-JournalAgenda +function journal { + param( + [switch]$limited = $false, + [switch]$shared = $false + ) + $path = "$HOME\Box\Journal" + if($limited) { + $path = "$HOME\Box\SecDevLimited" + } + if($shared) { + $path = "$HOME\Box\Privacy & Cybersecurity\Cybersecurity Development" + } + nvim $path +} +function dotfiles { + nvim "$HOME\dotfiles" +} # Vi New-Alias vi nvim -- 2.47.3 From cba7535866e98219c5eb42539194f94170328a8e Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 19 Feb 2025 16:23:16 -0600 Subject: [PATCH 07/16] Add function to quickly find journal files --- files/Microsoft.PowerShell_profile.ps1 | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index e39aab2..7aef53d 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -29,10 +29,49 @@ function journal { } nvim $path } + function dotfiles { nvim "$HOME\dotfiles" } +function open { + param ( + [string]$searchText + ) + $directories = @( + "$HOME\Box\Journal", + "$HOME\Box\SecDevLimited", + "$HOME\Box\Privacy & Cybersecurity\Cybersecurity Development" + ) + + $totalFiles = 0 + $processedFiles = 0 + + foreach ($directory in $directories) { + if (Test-Path $directory) { + $totalFiles += (Get-ChildItem -Path $directory -Recurse -File).Count + } else { + Write-Host "Directory '$directory' does not exist." + } + } + + $resultFiles = @() + $textFileExtensions = @(".txt", ".log", ".csv", ".json", ".xml", ".md") + foreach ($directory in $directories) { + Get-ChildItem -Path $directory -Recurse -File | Where-Object { $textFileExtensions -contains $_.Extension } | ForEach-Object { + $fileContent = Get-Content -Path $_.FullName -Raw + + if ($fileContent -match $searchText) { + $resultFiles += $_.FullName + } + $processedFiles++ + Write-Progress -Activity "Searching Files" -Status "$processedFiles / $totalFiles files processed" -PercentComplete (($processedFiles / $totalFiles) * 100) + } + } + nvim $resultFiles +} + + # Vi New-Alias vi nvim New-Alias vim nvim -- 2.47.3 From e52815e42c4468a3e40f2f91e008df80c07d8bac Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 09:12:33 -0600 Subject: [PATCH 08/16] Update backup checker --- setup/checkback.sh | 4 ++++ {files => util}/check_backups.sh | 0 2 files changed, 4 insertions(+) create mode 100644 setup/checkback.sh rename {files => util}/check_backups.sh (100%) diff --git a/setup/checkback.sh b/setup/checkback.sh new file mode 100644 index 0000000..8ea5120 --- /dev/null +++ b/setup/checkback.sh @@ -0,0 +1,4 @@ + +flatpak install golang + +go install github.com/edthedev/checkback@latest diff --git a/files/check_backups.sh b/util/check_backups.sh similarity index 100% rename from files/check_backups.sh rename to util/check_backups.sh -- 2.47.3 From 9b97c57c8eb0100f8ec99da23840baf7edb5bc8c Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 09:13:27 -0600 Subject: [PATCH 09/16] Go language path --- files/bashrc | 4 ++++ files/profile | 1 + 2 files changed, 5 insertions(+) diff --git a/files/bashrc b/files/bashrc index 68ecdf9..df99cf6 100644 --- a/files/bashrc +++ b/files/bashrc @@ -130,3 +130,7 @@ export PATH="$HOME/bin:$PATH" export PATH="$HOME/bin/platform-tools:$PATH" export LUANTI_DATA="$HOME/.var/app/net.minetest.Minetest/.minetest" export LUANTI_RUN="flatpak run net.minetest.Minetest" + +# GoLang +export GOROOT=/home/edward/.go +export PATH=$GOROOT/bin:$PATH diff --git a/files/profile b/files/profile index d49af64..050b3ee 100644 --- a/files/profile +++ b/files/profile @@ -27,3 +27,4 @@ if [ -d "$HOME/.local/bin" ] ; then fi export PATH="$HOME/bin/platform-tools:$PATH" +export PATH="$HOME/.go/bin:$PATH" -- 2.47.3 From ae1d7b42ae01935d598cce60a9061b297082677d Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 09:13:57 -0600 Subject: [PATCH 10/16] Update a path --- invoke/luanti/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoke/luanti/tasks.py b/invoke/luanti/tasks.py index 3c39102..45d340f 100644 --- a/invoke/luanti/tasks.py +++ b/invoke/luanti/tasks.py @@ -9,6 +9,7 @@ root = f"{flat_pak_root}/.minetest" mod_dir = f"{root}/mods" easy_dir = f"{home}/minetest/" run_mt = f"flatpak run net.minetest.Minetest" +world_dir = f"{root}/worlds" # flatpak link_to = f"{home}/.var/app/net.minetest.Minetest/.minetest" @@ -132,4 +133,3 @@ def logs(c, lines=20): '''Output some logs''' c.run(f"tail -n {lines} {root}/debug.txt") - -- 2.47.3 From 460bb82e89e92ed35e25bc3c975b65a093f903c7 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 15:50:20 -0600 Subject: [PATCH 11/16] Add backup process reminder --- util/backup_luanti.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 util/backup_luanti.sh diff --git a/util/backup_luanti.sh b/util/backup_luanti.sh new file mode 100644 index 0000000..64daf87 --- /dev/null +++ b/util/backup_luanti.sh @@ -0,0 +1,2 @@ +cd ~/ansible/luanti +./do_luanti.sh backup.sh -- 2.47.3 From 6a73cb14fdf7013e6cf3ffbb731d66d8704cdd7b Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 16:13:35 -0600 Subject: [PATCH 12/16] Add db file verification --- util/backup_luanti.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/backup_luanti.sh b/util/backup_luanti.sh index 64daf87..e0c8f92 100644 --- a/util/backup_luanti.sh +++ b/util/backup_luanti.sh @@ -1,2 +1,4 @@ cd ~/ansible/luanti ./do_luanti.sh backup.sh +echo "Checking Database file..." +./check_db.sh -- 2.47.3 From cb66b60ad781b9863e08bce03e82ec8739bdc077 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 16:34:05 -0600 Subject: [PATCH 13/16] Add reminder --- util/backup_luanti.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/util/backup_luanti.sh b/util/backup_luanti.sh index e0c8f92..c01ebd3 100644 --- a/util/backup_luanti.sh +++ b/util/backup_luanti.sh @@ -2,3 +2,4 @@ cd ~/ansible/luanti ./do_luanti.sh backup.sh echo "Checking Database file..." ./check_db.sh +echo "Reminder: Verify backup to NAS" -- 2.47.3 From f455e0756a49f91d16426eb2b0073bfc2f01013c Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 24 Feb 2025 18:35:11 -0600 Subject: [PATCH 14/16] Add reminder --- util/backup_luanti.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/backup_luanti.sh b/util/backup_luanti.sh index c01ebd3..3517529 100644 --- a/util/backup_luanti.sh +++ b/util/backup_luanti.sh @@ -2,4 +2,6 @@ cd ~/ansible/luanti ./do_luanti.sh backup.sh echo "Checking Database file..." ./check_db.sh -echo "Reminder: Verify backup to NAS" +echo "Reminder: Verify backup to NAS." +echo "Reminder: Restart the server." + -- 2.47.3 From e9d2b2222afe40023b25223d74ee0a9e3baee4e8 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Thu, 6 Mar 2025 08:45:03 -0600 Subject: [PATCH 15/16] Add backup reminder --- invoke/luanti/tasks.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/invoke/luanti/tasks.py b/invoke/luanti/tasks.py index 45d340f..14636ad 100644 --- a/invoke/luanti/tasks.py +++ b/invoke/luanti/tasks.py @@ -10,6 +10,7 @@ mod_dir = f"{root}/mods" easy_dir = f"{home}/minetest/" run_mt = f"flatpak run net.minetest.Minetest" world_dir = f"{root}/worlds" +scripts = f"{home}/ansible/luanti" # flatpak link_to = f"{home}/.var/app/net.minetest.Minetest/.minetest" @@ -133,3 +134,17 @@ def logs(c, lines=20): '''Output some logs''' c.run(f"tail -n {lines} {root}/debug.txt") +@task +def backup(c): + stopped = input("Is the server stopped?") + if(stopped != 'y'): + print("so go stop the server...") + exit() + print("okay...backing up.") + c.run(f"{scripts}/do_luanti.sh {scripts}/backup.sh") + c.run(f"{scripts}/check_db.sh") + +@task +def checkdb(c): + c.run(f"{scripts}/check_db.sh") + -- 2.47.3 From 022db9d681251142195157eb61c1ed71bd402cd8 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Fri, 14 Mar 2025 16:00:44 -0500 Subject: [PATCH 16/16] Add dotfiles to journal util --- files/Microsoft.PowerShell_profile.ps1 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index 7aef53d..0f20883 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -17,17 +17,20 @@ New-Alias dash Show-MyDashboard # from dash.psm1 New-Alias today Get-JournalAgenda function journal { param( + [ValidateSet('limited','shared','journal', 'dotfiles')] + [string]$key, [switch]$limited = $false, - [switch]$shared = $false + [switch]$shared = $false, + [switch]$dotfiles = $false ) $path = "$HOME\Box\Journal" - if($limited) { - $path = "$HOME\Box\SecDevLimited" + switch($key){ + 'limited' { $path = "$HOME\Box\SecDevLimited" } + 'shared' { $path = "$HOME\Box\Privacy & Cybersecurity\Cybersecurity Development" } + 'journal' { $path = "$HOME\Box\Journal" } + 'dotfiles' { $path = "$HOME\dotfiles" } } - if($shared) { - $path = "$HOME\Box\Privacy & Cybersecurity\Cybersecurity Development" - } - nvim $path + cd $path; nvim $path } function dotfiles { -- 2.47.3