Serving React from Django

Summary Serving in Steps ref Install Babel, Transpiler npm install --save-dev @babel/core # install presets and plugins for react npm install --save-dev @babel/preset-env @babel/preset-react Create .babelrc file in the react root dir To use the installed presets and plugins # automatic is added to avoid react not found error "presets": [ "@babel/preset-env", ["@babel/preset-react", "runtime": "automatic"] ] install, Webpack Note: while following the tutorial webpack-bundle-tracker version 1....

2 min · Jaaved Khan

Serving React from Django

w :ID: 2b2b8f53-03a9-416a-9a63-9cd7199690b2 Summary Serving in Steps ref Install Babel, Transpiler npm install --save-dev @babel/core # install presets and plugins for react npm install --save-dev @babel/preset-env @babel/preset-react Create .babelrc file in the react root dir To use the installed presets and plugins # automatic is added to avoid react not found error "presets": [ "@babel/preset-env", ["@babel/preset-react", "runtime": "automatic"] ] install, Webpack Note: while following the tutorial webpack-bundle-tracker version 1....

2 min · Jaaved Khan

postgres

Change default port change the `port` in `/etc/postgresql/14/main/postgresql.conf` Change data directory location To avoid storage problem I followed this tutorial. # /etc/postgresql/14/main/postgresql.conf # data_directory = '/var/lib/postgresql/14/main' # use data in another directory data_directory = '/mnt/0d08b147-6cb2-4978-b2a0-b78f2786f72d/data/postgresql/14/main'

1 min · Jaaved Khan

Roam-ref protocol debugging

It seems to work on my PC without the “tricks” I am writing in the new chapter. Two things worth checking: Have started Emacs Server? – e.g. M-x server-start Have loaded org-protocol and org-roam-protocol? – e.g. M-x load-library Alternative to M-x, you can put this in your config. (server-start) (require 'org-protocol) (require 'org-roam-protocol) image 1432×1286 55.9 KB

1 min · Jaaved Khan

python - Tkinter using memory when updating image; how do I stop the memory usage? - Stack Overflow

At the moment you are making a new Label every 10 seconds and covering up (not deleting) the older ones. You need to make the Label once, and update the Label, not create a new one every time. from tkinter import * from PIL import ImageTk, Image root= Tk() plant_stat_panel = Label(root) plant_stat_panel.grid(row = 5,column = 0, columnspan=2, sticky = W ) def img_updater(): plant_stat_img = ImageTk.PhotoImage(Image.open("/home/pi/wateringsys/html/temp.png"))#/home/pi/html/ plant_stat_panel.config(image = plant_stat_img) plant_stat_panel....

1 min · Jaaved Khan

Selecting a CMS for KFUPM

Summary Selecting and using a CMS to provide CMS services to KFUPM clients has a become a challenge. Reason why some candidates failed? Although it has really good benefits, using it to create and delivery CMS sites is turned out to be a challenging and quite involved tasks. Especially because of the KFUPM team’s skill set. Recent software upgrade, 3.1.12, of Crafter CMS is not supporting Debian OS. Other candidates that were considered It is ....

2 min · Jaaved Khan

second thought

this is my second thought. I will be linking more thoughts here as we go. Adding more notes.

1 min · Jaaved Khan

requests library

:ID: 31274871-1e89-4fc5-8015-6c2fce728333 Summary module to do HTTP communication. Setting custom SSL certificate position ease box interval due front 2.5 0 0 2021-09-29T17:07:02Z When using the directly https://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification using verify=False requests.get('https://requestb.in', verify=False) verify=path/to/ca/bundle or directory that contains CA files requests.get('https://requestb.in', verify="path/to/ca/bundle") REQUESTS_CA_BUNDLE env variable export REQUESTS_CA_BUNDLE=/path/to/ca/bundle When requests is used by third party package or dependencies ref ref2...

1 min · Jaaved Khan

RabbitMQ

Summary position ease box interval due front 2.5 0 0 2021-10-05T12:27:09Z https://www.rabbitmq.com/ RabbitMQ is the most widely deployed open source message broker.

1 min · Jaaved Khan

Pytorch

Summary ref Why PyTorch? NumPy-like arrays on GPU’s Dynamic computational graphs It’s Pythonic! Compuatiation graph is created dynamically as new statements are added to th code. e.g.: Details NumPy to PyTorch Since NumPy and PyTorch are really similar, is there a method to change NumPy array to PyTorch array and vice versa? Yes! a = np.ones(5) #From NumPy to Torch b = torch....

1 min · Jaaved Khan