From dc2af0386d0d306d0c9bda593ffac9d4444d24d3 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Mon, 8 Apr 2024 12:36:16 +0300 Subject: [PATCH] local changes DEV --- NOTES/useful commands.md | 1 + _CONFIGS/home router config.md | 30 +++++++++++ _ideas/project ideas.md | 3 ++ ai-ollama.md | 2 + dev/docker deploy.md | 11 ++++ dev/node react.md | 54 +++++++++++++++++++ git/git combine multiple commits.md | 80 +++++++++++++++++++++++++++++ linux/disk fscheck.md | 10 ++++ linux/setup aider.md | 2 +- python/population_plot.py | 39 ++++++++++++++ 10 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 NOTES/useful commands.md create mode 100644 _CONFIGS/home router config.md create mode 100644 _ideas/project ideas.md create mode 100644 ai-ollama.md create mode 100644 dev/docker deploy.md create mode 100644 dev/node react.md create mode 100644 git/git combine multiple commits.md create mode 100644 linux/disk fscheck.md create mode 100644 python/population_plot.py diff --git a/NOTES/useful commands.md b/NOTES/useful commands.md new file mode 100644 index 0000000..17c3908 --- /dev/null +++ b/NOTES/useful commands.md @@ -0,0 +1 @@ +docker init \ No newline at end of file diff --git a/_CONFIGS/home router config.md b/_CONFIGS/home router config.md new file mode 100644 index 0000000..ab9b763 --- /dev/null +++ b/_CONFIGS/home router config.md @@ -0,0 +1,30 @@ +192.168.0.1 + popov %TGBnhy6= WPA2 AES + popov5G %TGBnhy6= auto auto + popov-guest wpa-psk aes 12345678 + -TP-Archer C6 Zelenakravapasetrev@ (original PIN:35390466, MAC: D8-07-B6-17-03-AE) + https://94.156.137.3:8444 + http://94.156.137.3:1024 +WAN: 192.168.100.3 DNS 20.101.62.76/1.1.1.3 +DHCP: 92.168.0.100-249 DNS 192.168.0.10/20.101.62.76 +RESERVATIONS: +C4-65-16-9A-E4-CD +192.168.0.11 +E8-65-D4-33-06-D0 +192.168.0.4 +10-FE-ED-B7-3E-D1 +192.168.0.3 +34-64-A9-D1-84-75 +192.168.0.10 +68-5D-43-A8-07-46 +192.168.0.20 +2C-56-DC-F0-14-80 +192.168.0.9 +B4-2E-99-3A-99-CB +192.168.0.2 +60-6D-C7-5E-63-29 +192.168.0.15 +30-85-A9-23-1D-F6 +192.168.0.13 +A4-CF-12-F5-22-8D +192.168.0.18 \ No newline at end of file diff --git a/_ideas/project ideas.md b/_ideas/project ideas.md new file mode 100644 index 0000000..686b6e1 --- /dev/null +++ b/_ideas/project ideas.md @@ -0,0 +1,3 @@ +AI: + +petals private farm aider - self improving assistant jw documents vector database embedding \ No newline at end of file diff --git a/ai-ollama.md b/ai-ollama.md new file mode 100644 index 0000000..223fb75 --- /dev/null +++ b/ai-ollama.md @@ -0,0 +1,2 @@ +run llama code 7b in ollama" +ollama run codellama:7b-code \ No newline at end of file diff --git a/dev/docker deploy.md b/dev/docker deploy.md new file mode 100644 index 0000000..ed37045 --- /dev/null +++ b/dev/docker deploy.md @@ -0,0 +1,11 @@ +# Step 1: Build the Docker Image +docker build -t my-next-app . +# Step 2: Save the Docker Image +docker save my-next-app > my-next-app.tar +# Step 3: Transfer the Image to the Production Server +scp my-next-app.tar user@your-server-ip:/path/to/directory +# Step 4: Load the Image on the Production Server +ssh user@your-server-ip +docker load < my-next-app.tar +# Step 5: Run the Docker Container +docker run -d -p 80:3000 my-next-app \ No newline at end of file diff --git a/dev/node react.md b/dev/node react.md new file mode 100644 index 0000000..0c7c994 --- /dev/null +++ b/dev/node react.md @@ -0,0 +1,54 @@ +copy + +# npm remove excessive package dependencies +# 1.Use Dependency Analysis Tools +npm install -g depcheck +depcheck +# or +npm install -g npm-check +npm-check + +# 2.Bundle Size Analysis: +npm install --save-dev webpack-bundle-analyzer +# edit webpack to push BundleAnalyzerPlugin to config.plugins +# run #> ANALYZE=true npm run build + +npm uninstall yargs-parser + +yargs-parser +Unused dependencies +* @date-io/date-fns +* @mui/icons-material +* @react-pdf/renderer +* docx +* docx-templates +* docxtemplater +* excel4node +* fs +* gapi +* gapi-script +* html-to-docx +* module-alias +* node-excel-export +* nodemailer-smtp-transport +* prisma-binding +* react-cookies +* react-file-reader +* react-hook-form +* react-router-dom +* react-table +* sqlite3 +* xml-js +Unused devDependencies +* @types/react-table +* autoprefixer +* postcss +* typescript +Missing dependencies +* @fullcalendar/core: ./styles/calendar.scss +* @fullcalendar/daygrid: ./styles/calendar.scss +* @fullcalendar/timegrid: ./styles/calendar.scss +* google-auth-library: ./src/helpers/calendar.js +* open: ./src/helpers/calendar.js +* pages: ./pages/dash.tsx +* src: ./pages/cart/publishers/import.tsx \ No newline at end of file diff --git a/git/git combine multiple commits.md b/git/git combine multiple commits.md new file mode 100644 index 0000000..66cbffc --- /dev/null +++ b/git/git combine multiple commits.md @@ -0,0 +1,80 @@ + +git checkout -b review-branch + + +oldest_commit_hash=$(git log --grep="GAT-4861" --reverse --format="%H" | head -1) +git checkout -b review-branch $oldest_commit_hash^ + + +$oldestCommitHash = git log --grep="GAT-4861" --reverse --format="%H" | Select-Object -First 1 +git checkout -b review-branch $oldestCommitHash^ + + + +git log --grep="GAT-4861" --format="%H" | xargs -L1 git cherry-pick + +git log --grep="GAT-4861" --format="%H" | ForEach-Object { git cherry-pick $_ } + +git log --grep="GAT-4861" --format="%H" | ForEach-Object { + git cherry-pick $_ --strategy-option theirs +} +git log --reverse --grep="GAT-4861" --format="%H" | ForEach-Object { + git cherry-pick $_ --strategy-option theirs +} + +git log master --reverse --grep="GAT-4861" --format="%H" | ForEach-Object { + git cherry-pick $_ --strategy-option theirs --no-commit + if ($LASTEXITCODE -ne 0) { + Write-Host "Conflict encountered. Skipping commit $_" + git reset --merge + } +} + + +git checkout master # Replace 'main' with your default branch name if different +git branch -D review-branch + + + + +git checkout master # Replace 'main' with your default branch name if different +git branch -D review-branch + +$oldestCommitHash = git log --grep="GAT-4861" --reverse --format="%H" | Select-Object -First 1 +git checkout -b review-branch $oldestCommitHash^ + +git log master --reverse --grep="GAT-4861" --format="%H" | ForEach-Object { + git cherry-pick $_ --strategy-option theirs --no-commit + if ($LASTEXITCODE -ne 0) { + Write-Host "Conflict encountered. Skipping commit $_" + git reset --merge + } +} + + + + +git diff $(git log --grep="GAT-4861" --format="%H" | tail -n 1)^ $(git log --grep="GAT-4861" --format="%H" | head -n 1) > changes.patch + + +$firstCommit = git log --grep="GAT-4861" --reverse --format="%H" | Select-Object -First 1 +$lastCommit = git log --grep="GAT-4861" --format="%H" | Select-Object -First 1 +git diff $firstCommit^ $lastCommit > changes.patch + + + + +# Checkout to the parent of the earliest "GAT-4861" commit +$earliestCommitHash = git log --grep="GAT-4861" --reverse --format="%H" | Select-Object -First 1 +git checkout -b review-branch $earliestCommitHash^ + +# Apply the patch +git apply changes.patch + + + diff --git a/linux/disk fscheck.md b/linux/disk fscheck.md new file mode 100644 index 0000000..9737928 --- /dev/null +++ b/linux/disk fscheck.md @@ -0,0 +1,10 @@ +sudo umount /mnt/mmc + +sudo fsck.vfat -a /dev/sdX1 +sudo fsck.ext4 -cDfty -C 0 /dev/sdX1 +-a: Automatically repair errors. +-c: Check for bad blocks. +-D: Optimize directories when possible. +-f: Force a check, even if the filesystem appears clean. +-t: Print timing stats (optional). +-C 0: Display progress information. \ No newline at end of file diff --git a/linux/setup aider.md b/linux/setup aider.md index 44aae3b..203f39f 100644 --- a/linux/setup aider.md +++ b/linux/setup aider.md @@ -21,5 +21,5 @@ export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin/ctags export OPENAI_API_KEY=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 aider -3 --no-auto-commits -# dev-bro GPT4 +# !!!!! dev-bro GPT4 export OPENAI_API_KEY=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 \ No newline at end of file diff --git a/python/population_plot.py b/python/population_plot.py new file mode 100644 index 0000000..c101633 --- /dev/null +++ b/python/population_plot.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Initial population at year 0 +initial_population = 1_000_000 +death_rate = 0.10 + +# Start and stop years for the graph +start_year = 4000 +stop_year = 10000 +interval = 500 # Interval for plotting data points + +# Initialize population calculations +current_population = initial_population +population_values = [initial_population] # Include initial population as the first data point +years = np.arange(0, stop_year + 1, 100) # Calculate every 100 years + +# Apply the death rate for each 100-year period +for year in years[1:]: + current_population -= death_rate * current_population + population_values.append(current_population) + +# Filter the years and population values for the graph +graph_years = np.arange(start_year, stop_year + 1, interval) +graph_population_values = [population for year, population in zip(years, population_values) if year >= start_year and year in graph_years] + +# Create the graph with labels for each data point +plt.figure(figsize=(8, 6)) +plt.plot(graph_years, graph_population_values, marker='o', linestyle='-', color='b') +plt.xlabel('Years') +plt.ylabel('Population') +plt.title(f'Population Projection from Year {start_year} to {stop_year}') + +# Adding labels to the data points +for i, txt in enumerate(graph_population_values): + plt.annotate(f"{int(txt):,}", (graph_years[i], graph_population_values[i]), textcoords="offset points", xytext=(0,10), ha='center') + +plt.grid(True) +plt.show()