Sunday, July 25, 2021

how I validate changes and deploy updates to derivationmap.net website

On my local server, I make changes to the local file and then validate using
cd ~/version_controlled/allofphysicsgraph/proofofconcept/v7_pickle_web_interface
docker-compose up --build --remove-orphans
Build time is 10 minutes when layers are not cached.

Check the result in a local web browser by visiting http://localhost If I'm happy with the content,
git add filename
git commit -m "a message"
git push
SSH to the DigitalOcean droplet VPS (virtual private server)
cd ~/proofofconcept/v7_pickle_web_interface
git pull
docker-compose up --build --force-recreate --remove-orphans --detach
Check the live page content at https://derivationmap.net/.

Sunday, July 11, 2021

roadmap for identifying mathematical variables in Latex documents

Context: I think there's a graph of mathematical expressions in Physics. That graph has math expressions as nodes and the nodes are related by inference rules. The graph spans textbooks and journal articles. The scope of this post is limited to the graph within one document. 

For determining consistency of mathematical content within one document, the first step is to identify mathematical variables and operators. In practice, variables commonly appear inline as $a$ or within an expression like

\begin{equation}
a = 2
\end{equation}

Another way variables appear in text is within \newcommand, like

\newcommand{\R}{\mathbb{R}}

or

\newcommand{\bb}[1]{\mathbb{#1}}
Other numerical systems have similar notations. 
The complex numbers \( \bb{C} \), the rational 
numbers \( \bb{Q} \) and the integer numbers \( \bb{Z} \).

source

For addressing the complexity of expanding newcommand macros, see https://stackoverflow.com/questions/1509799/how-to-replace-latex-macros-with-their-definitions-using-latex


Once variables and operators are identified, the next step would be to associate each symbol with the respective definition (e.g., wikipedia links) and dimensions (e.g., length, time, charge). 



Options

https://pypi.org/project/TexSoup/, https://texsoup.alvinwan.com/, https://github.com/alvinwan/TexSoup, https://stackoverflow.com/users/4855984/alvin-wan

https://pylatexenc.readthedocs.io/en/latest/latexwalker/, https://github.com/phfaist/pylatexenc/

Saturday, July 10, 2021

dhparam.pem necessary for nginix web server

This morning I was alerted by Wachete that the derivationmap.net website was unavailable. 

I logged into the digitalocean.com virtual private server (VPS) and used top to see that the container processes were running.

Normally the command I run to start the Docker containers is

docker-compose up --build --force-recreate --remove-orphans --detach

To troubleshoot, I ran

docker-compose up --build --force-recreate --remove-orphans

and the output was

Successfully built 0ffaac97e769
Successfully tagged v7_pickle_web_interface_nginx:latest
Recreating v7_pickle_web_interface_flask_1 ... done
Recreating v7_pickle_web_interface_nginx_1 ... done
Attaching to v7_pickle_web_interface_flask_1, v7_pickle_web_interface_nginx_1
nginx_1  | 2021/07/10 11:48:41 [emerg] 1#1: PEM_read_bio_DHparams("/certs/dhparam.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
nginx_1  | nginx: [emerg] PEM_read_bio_DHparams("/certs/dhparam.pem") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: DH PARAMETERS)
v7_pickle_web_interface_nginx_1 exited with code 1

The fix was to point nginix to the dhparam.pem file.

https://security.stackexchange.com/questions/94390/whats-the-purpose-of-dh-parameters