From 27645f5e6b1a1b09d4b4435a61137db0c49cbaa9 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 16 Dec 2023 21:36:53 +0000 Subject: [PATCH 01/10] population plot 10% --- python/population_plot.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 python/population_plot.py diff --git a/python/population_plot.py b/python/population_plot.py new file mode 100644 index 0000000..1fe3bee --- /dev/null +++ b/python/population_plot.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Initial population +population = 1_000_000 +death_rate = 0.10 +years = np.arange(0, 1001, 100) # 0 to 1000 years in 100-year intervals + +# Calculate population after each 100-year interval +population_values = [population] +for year in years[1:]: + population -= death_rate * population + population_values.append(population) + +# Create the graph +plt.figure(figsize=(8, 6)) +plt.plot(years, population_values, marker='o', linestyle='-', color='b') +plt.xlabel('Years') +plt.ylabel('Population') +plt.title('Population Projection') +plt.grid(True) +plt.show() From 88becd9fe0e7cb72e6ec128302ce30b12b06aa89 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 16 Dec 2023 21:43:00 +0000 Subject: [PATCH 02/10] 4000 to 1k --- python/population_plot.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/python/population_plot.py b/python/population_plot.py index 1fe3bee..17a8719 100644 --- a/python/population_plot.py +++ b/python/population_plot.py @@ -4,19 +4,26 @@ import numpy as np # Initial population population = 1_000_000 death_rate = 0.10 -years = np.arange(0, 1001, 100) # 0 to 1000 years in 100-year intervals +years = np.arange(4000, 10001, 500) # 4000 to 10000 years in 500-year intervals -# Calculate population after each 100-year interval -population_values = [population] -for year in years[1:]: - population -= death_rate * population +# Calculate population after each 500-year interval +population_values = [] +for year in years: + # Apply the death rate for each 500-year period (5 times for each interval) + for _ in range(5): + population -= death_rate * population population_values.append(population) -# Create the graph +# Create the graph with labels for each data point plt.figure(figsize=(8, 6)) plt.plot(years, population_values, marker='o', linestyle='-', color='b') plt.xlabel('Years') plt.ylabel('Population') -plt.title('Population Projection') +plt.title('Population Projection from Year 4000') + +# Adding labels to the data points +for i, txt in enumerate(population_values): + plt.annotate(f"{int(txt):,}", (years[i], population_values[i]), textcoords="offset points", xytext=(0,10), ha='center') + plt.grid(True) plt.show() From d684d0a6b52004e2584ca7e04cc4d0343ebd38e1 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 16 Dec 2023 21:45:17 +0000 Subject: [PATCH 03/10] add plot range --- python/population_plot.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/python/population_plot.py b/python/population_plot.py index 17a8719..482514d 100644 --- a/python/population_plot.py +++ b/python/population_plot.py @@ -1,25 +1,35 @@ import matplotlib.pyplot as plt import numpy as np -# Initial population -population = 1_000_000 +# Initial population at year 1 +initial_population = 1_000_000 death_rate = 0.10 -years = np.arange(4000, 10001, 500) # 4000 to 10000 years in 500-year intervals -# Calculate population after each 500-year interval +# Start and stop years for the graph +start_year = 4000 +stop_year = 10000 +interval = 500 # Interval for plotting data points + +# Calculate the population at the start of the start_year +current_population = initial_population +for _ in range(start_year // 100): # Dividing by 100 as the death rate is applied every 100 years + current_population -= death_rate * current_population + +# Now calculate and plot the population from start_year to stop_year +years = np.arange(start_year, stop_year + 1, interval) population_values = [] for year in years: - # Apply the death rate for each 500-year period (5 times for each interval) - for _ in range(5): - population -= death_rate * population - population_values.append(population) + # Apply the death rate for each interval (interval/100 times for each period) + for _ in range(interval // 100): + current_population -= death_rate * current_population + population_values.append(current_population) # Create the graph with labels for each data point plt.figure(figsize=(8, 6)) plt.plot(years, population_values, marker='o', linestyle='-', color='b') plt.xlabel('Years') plt.ylabel('Population') -plt.title('Population Projection from Year 4000') +plt.title(f'Population Projection from Year {start_year} to {stop_year}') # Adding labels to the data points for i, txt in enumerate(population_values): From 201512ef3a60b4450dcb51d73ab99d62c162907a Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 16 Dec 2023 22:35:28 +0000 Subject: [PATCH 04/10] fix range and --- python/population_plot.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/python/population_plot.py b/python/population_plot.py index 482514d..c101633 100644 --- a/python/population_plot.py +++ b/python/population_plot.py @@ -1,7 +1,7 @@ import matplotlib.pyplot as plt import numpy as np -# Initial population at year 1 +# Initial population at year 0 initial_population = 1_000_000 death_rate = 0.10 @@ -10,30 +10,30 @@ start_year = 4000 stop_year = 10000 interval = 500 # Interval for plotting data points -# Calculate the population at the start of the start_year +# Initialize population calculations current_population = initial_population -for _ in range(start_year // 100): # Dividing by 100 as the death rate is applied every 100 years - current_population -= death_rate * current_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 -# Now calculate and plot the population from start_year to stop_year -years = np.arange(start_year, stop_year + 1, interval) -population_values = [] -for year in years: - # Apply the death rate for each interval (interval/100 times for each period) - for _ in range(interval // 100): - current_population -= death_rate * current_population +# 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(years, population_values, marker='o', linestyle='-', color='b') +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(population_values): - plt.annotate(f"{int(txt):,}", (years[i], population_values[i]), textcoords="offset points", xytext=(0,10), ha='center') +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() From ba5e73f0271a4b81f247d5f931083d750dc01a42 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Wed, 17 Jan 2024 18:19:35 +0200 Subject: [PATCH 05/10] added home router configure --- NOTES/useful commands.md | 1 + _CONFIGS/home router config.md | 30 ++++++++++++++++++++++++++++++ linux/disk fscheck.md | 10 ++++++++++ 3 files changed, 41 insertions(+) create mode 100644 NOTES/useful commands.md create mode 100644 _CONFIGS/home router config.md create mode 100644 linux/disk fscheck.md 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/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 From 19538749c57c882e83a64addaa996b283af7d326 Mon Sep 17 00:00:00 2001 From: popov Date: Mon, 22 Jan 2024 08:41:35 +0000 Subject: [PATCH 06/10] added portainer reset passwd info --- linux/docker install.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux/docker install.md b/linux/docker install.md index 98765c1..c3eb7dd 100644 --- a/linux/docker install.md +++ b/linux/docker install.md @@ -9,6 +9,11 @@ sudo apt-get install docker-ce # add portainer docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /mnt/storage/docker_volumes/portainer_data:/data portainer/portainer-ce +# change portainer admin password +docker stop portainer +docker pull portainer/helper-reset-password +docker run --rm -v /mnt/storage/docker_volumes/portainer_data:/data portainer/helper-reset-password + # start sudo systemctl start docker From 96335ad501cdf1a34bb300bde494280da3362cfa Mon Sep 17 00:00:00 2001 From: popov Date: Mon, 22 Jan 2024 09:10:23 +0000 Subject: [PATCH 07/10] added docker cmd --- linux/docker install.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/docker install.md b/linux/docker install.md index c3eb7dd..0a8d7c6 100644 --- a/linux/docker install.md +++ b/linux/docker install.md @@ -22,3 +22,7 @@ sudo systemctl enable docker # build image sudo docker build -t your-image-name . + +# attach to container +docker exec -it potainer /bin/sh + From cffa6a40bb36d04d7360194cd39965257888c404 Mon Sep 17 00:00:00 2001 From: popov Date: Fri, 2 Feb 2024 14:32:26 +0000 Subject: [PATCH 08/10] added ai notes --- ai-ollama.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ai-ollama.md 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 From a52364878c5c49a4783b4c1182dae4442c5d2f08 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Wed, 21 Feb 2024 18:21:57 +0200 Subject: [PATCH 09/10] notes --- linux/docker install.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/docker install.md b/linux/docker install.md index 98765c1..3cc8cee 100644 --- a/linux/docker install.md +++ b/linux/docker install.md @@ -1,5 +1,7 @@ # install sudo apt-get update +sudo apt update +sudo apt install gnupg sudo apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" From 4402fef237d3732a1c02c800e8d3721c86d5f29f Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Wed, 6 Mar 2024 11:26:01 +0200 Subject: [PATCH 10/10] misc scripts --- dev/docker deploy.md | 11 +++++++++ dev/node react.md | 54 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 dev/docker deploy.md create mode 100644 dev/node react.md 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