Inspiration Number of two-digit numbers not containing the digit ‘8’.
Code The standalone class can’t be used with \caption. *{8}{c} means 8 c. >{\columncolor{cyan}}c gives the column color. It \usepackage[table]{xcolor}. \rowcolor{cyan} overrides the column colors. \cellcolor{white} overrides the above two commands. It has to be carried out one-by-one without any fancy package. \multicolumn{n}{<alignment>}{content} defines a multi-column cell. \multirow{n}{*}{content} defines a multi-row cell. It \usepackage{multirow}. It can’t contain \multicolumn. \cline{i-j} draws a horizontal line above the row from column i to column j.
[Read More]
Dvisvgm's Issue With Fill Pattern
Goal Generate SVG file for TikZ graphics.
Method TeX → PDF with PDFLaTeX PDF → SVG with dvisvgm -P filename Example: I generated a PGF plot from the source code on my personal template.
Problem When I applied this method to the following TeX code in my previous post, dvisvgm -P returns a blank SVG.
\documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=center,legend style={at={(0.7,0.7)},anchor=south west}] \addplot [domain=-3:3, thick, smooth, yellow] { 1/sqrt(2*pi)*exp(-x^2/2) }; \addlegendentry{$y = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}$}; \addplot [dashed, yellow] coordinates {(1.
[Read More]
First Experience with ASP.NET Core MVC & PostgreSQL
Goal To build an ASP.NET Core 5 MVC web app linked with a PostgreSQL.
Motivation SQL Server is proprietary. SQLite used in Microsoft’s ASP.NET Core 5 MVC tutorial isn’t made for web apps. MySQL doesn’t perform well with concurrent read-writes. It’s dual-licensed like GitLab. Some users find PostgreSQL cost-effective. Useful tutorials MS’s tutorial in item 2 above. Wes Doyle’s YouTube video goes through the steps MS’s tutorial for Razor Pages with EF Core migrations Steps Create a superuser in the database.
[Read More]
GIMP w'ont Start after Ubuntu Distro Upgrade
Problem After upgrading to Ubuntu 20.04 form 18.04, I wasn’t able to start GIMP 2.10. The message was in the same format as that in a related Ask Ubuntu question, except that the version numbers were greater.
I attempted installing the package gegl, which was irrelavant to the problem.
Analysis I found the answers mentioning the package libgegl helpful.
$ dpkg -l | grep gegl ii gegl 0.4.22-3 amd64 Generic Graphics Library Test Program ii libgegl-0.
[Read More]
Recover Mysql Root Password
Just a little linklog to a relevant page on How to Forge. Root privileges are needed.
Stop service: service mysql stop
Start MySQL server w/o password: mysqld_safe --skip-grant-tables &
Connect to CLI client as root: mysql -u root
Reset root password. Here’s the syntax for ≥v.5.7.6.
mysql> use mysql; mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpass"); mysql> flush privileges; mysql> quit Repeat step 1, or killall mysqld if it doesn’t work.
[Read More]
Pandoc LaTeX Mermaid on GitLab CI
Goal To provide an open-source alternative to the Docker image escalope/pandoc-mermaid-plantuml, whose Dockerfile isn’t available.
The rationale behind these difficult setup is simple: construct informative Mermaid diagram with intuitive Markdown syntax in an open-source and economic way.
This newly constructed Docker image is entirely on GitLab. No Docker Hub account is needed. For sample usage, consult .gitlab-ci.yml in my test project.
Difficulties issues raghur/mermaid-filter#51 and #52 issue gitlab-org/gitlab-runner#4566 Useful code/articles time-machine-project/requests-for-comments@470b0c5 Dockerfile Reduce Docker Image Sizes Using Alpine Best practices for building docker images with GitLab CI with the accompanying gist The code block in the highlighted comment in item 2 of the above section pandoc installation for Docker Sample Dockerfile for Alpine Linux in the troubleshooting of Puppeteer sc250024/docker-mermaid-cli@3c9ddb5 src/puppeteerConfigFile.
[Read More]
Network Interface Name Detection in Conky
Once-off Conky config for network graphs
When one changes connection type (say, from ethernet to Wi-Fi), the interface name changes (e.g. eth0 → wlan1). To avoid changing Conky config file all the time, here’s a little Lua function for finding the network interface name.
function findInterface() local handle = io.popen('ip a | grep "state UP" | cut -d: -f2 | tr -d " "') local result = handle:read('*a'):gsub('\n$','') handle:close() return result end ip a gives everything about connection info.
[Read More]
CPU Temperature Display in Conky
Background I’m using Conky for monitoring the system. After a system upgrade, the CPU temperatures were gone. Conky’s standard error showed the following.
Conky: can't open '/sys/class/hwmon/hwmon0/temp3_input': No such file or directory please check your device or remove this var from Conky... Source of message: https://bbs.archlinux.org/viewtopic.php?id=82231
An easy fix would be to adjust the following lines in .conkyrc according to the number N in /sys/class/hwmon/hwmonN containing the file temp3_input. (You may adjust the number 3 according to the number of CPU of your device.
[Read More]
Animated GIF Screenshots on Ubuntu
Background I’ve to take screenshots to demonstrate Conky’s visual output.
I’ve chosen Byzanz after reading this answer on Ask Ubuntu.
Peek is more user-friendly, but I prefer CLI’s precision. That’s feasible thanks to a comment mentioning xwininfo.
After typing xwininfo, click on the target window. Switching to adjacent workplace is possible.
$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window.
[Read More]
Right PATH to Linux
Roles of various config files
Background Updated $\LaTeX$ version From this $\TeX$-SE question about tlmgr, we see some advantages of installing $\TeX$Live directly from the official site:
avoid errors due to outdated version of $\TeX$Live supplied by the OS’s package manager easier to manage packages with tlmgr. enjoy the newer version of $\TeX$Live not yet available in your current GNU/Linux version. The installation took about 30 minutes and 5G in the disk. I’ve chosen a local installation as this didn’t require sudo privileges.
[Read More]