local changes DEV

This commit is contained in:
Dobromir Popov
2024-04-08 12:36:16 +03:00
parent 56644db73f
commit dc2af0386d
10 changed files with 231 additions and 1 deletions

1
NOTES/useful commands.md Normal file
View File

@ -0,0 +1 @@
docker init

View File

@ -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

3
_ideas/project ideas.md Normal file
View File

@ -0,0 +1,3 @@
AI:
petals private farm aider - self improving assistant jw documents vector database embedding

2
ai-ollama.md Normal file
View File

@ -0,0 +1,2 @@
run llama code 7b in ollama"
ollama run codellama:7b-code

11
dev/docker deploy.md Normal file
View File

@ -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

54
dev/node react.md Normal file
View File

@ -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

View File

@ -0,0 +1,80 @@
<!-- Create a New Branch for Review: -->
git checkout -b review-branch
<!-- find latest hash's parent -->
oldest_commit_hash=$(git log --grep="GAT-4861" --reverse --format="%H" | head -1)
git checkout -b review-branch $oldest_commit_hash^
<!-- PS -->
$oldestCommitHash = git log --grep="GAT-4861" --reverse --format="%H" | Select-Object -First 1
git checkout -b review-branch $oldestCommitHash^
<!-- LINUIX Cherry-Pick Commits Based on Log Search -->
git log --grep="GAT-4861" --format="%H" | xargs -L1 git cherry-pick
<!-- //windows -->
git log --grep="GAT-4861" --format="%H" | ForEach-Object { git cherry-pick $_ }
<!-- forced -->
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
}
<!-- forced new oldest first -->
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
}
}
<!-- Cleanup -->
git checkout master # Replace 'main' with your default branch name if different
git branch -D review-branch
<!-- did not work as we need to store commit hashes before we checkout oldest hash -->
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
}
}
<!-- try ising patch
Create a Diff Patch for the Commits
This command finds the first and last commits with "GAT-4861" and generates a diff patch between these points.
tail -n 1 and head -n 1 are used to get the earliest and latest commit hashes respectively.
The ^ after the first commit hash indicates the parent of that commit.
The diff is saved in a file named changes.patch. -->
git diff $(git log --grep="GAT-4861" --format="%H" | tail -n 1)^ $(git log --grep="GAT-4861" --format="%H" | head -n 1) > changes.patch
<!-- WIN/PS -->
$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
<!-- Apply the Patch to a New Branch -->
# 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

10
linux/disk fscheck.md Normal file
View File

@ -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.

View File

@ -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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

39
python/population_plot.py Normal file
View File

@ -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()