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]
Conky  Lua 

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]
Conky  CPU  Linux 

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]
Linux 

Package Versioning for Julia Projects

Resolved GLM installation error

Update: Thanks to JuliaRegistries/General#647, the version cap of the package Distributions has now been removed, so that one can directly install the package GLM along with Distributions v0.19.2. Background I’m reading the book Statistics with Julia, which makes use of GLM. Problem I encountered the following error, which I posted in the issue GLM.jl#311. (v1.1) pkg> add GLM Resolving package versions... ERROR: Unsatisfiable requirements detected for package GLM [38e38edf]: GLM [38e38edf] log: β”œβ”€possible versions are: [0. [Read More]
Julia  GLM 

Insensitive Laptop Touchpad

Log of my Ubuntu Tweak config

Problem The touchpad on my new Ubuntu 18.04 LTS laptop was frozen. Toogling πŸ–± with <Fn>-<F4> didn’t worked. Attempt Logout: didn’t work at all Reboot: worked most of the time Partial solution After changing the Mouse Click Emulation in Keyboard & Mouse in Ubuntu Tweak from the default “Fingers” (2 fingers for right click; 3 fingers for middle click) to “Area” (Right/middle click determined by clicked area), one might have to wait for next reboot. [Read More]

Juno Installation 2019

Log of system-wide config

Goal To install Juno for convenient development in Julia. Problem After Juno installation, I received the following error. Analysis From the error message, the system had tried to find an executable file julia, which would then be executed by the shell /bin/sh. Nonetheless, it’s absent from the system’s environment $PATH, so Juno couldn’t find it. I’ve only changed my $PATH in ZSHRC, which is user-specific. Solution This Stack Overflow question about $PATH setting on *nix has provided various solution. [Read More]
Juno  Atom  Julia 

Conditional Batch File Editing

Adopted Mmark for Math Posts

Problem During the adoption of Mmark for math posts on this blog, I had to insert markup: mmark at the last line of front matter of the source file of each math post. Seek help I separated this into two SO questions Sed conditional match and execute command with offset, and A question about AWK multiple line recognition. Solution From #1., I learnt the use of variables in AWK scripts. [Read More]
awk  sed  Mmark 

JavaScript Copy Button

Goal To create a copy button for my Math.SE comment template in order to save the trouble of copying and pasting. My first attempt I put the boilerplate inside a Markdown codeblock to prevent them from getting interpreted by Hugo’s Markdown parser. Under each codeblock, I placed the copy button. Comment boilerplate goes here ... πŸ“ Another comment boilerplate goes here ... πŸ“ … My page’s original layout [Read More]

Julia Rcall Installation

Rcall.jl build failure due to missing dependencies

Problem During the installation of RCall.jl, the package wasn’t successfully built due to a missing variable $R_HOME. $ julia -q julia> Pkg.add("RCall") Resolving package versions... Installed WinReg ─ v0.3.1 Installed RCall ── v0.13.2 Updating `~/.julia/environments/v1.0/Project.toml` [6f49c342] + RCall v0.13.2 Updating `~/.julia/environments/v1.0/Manifest.toml` [6f49c342] + RCall v0.13.2 [1b915085] + WinReg v0.3.1 Building RCall β†’ `~/.julia/packages/RCall/ffM0W/deps/build.log` β”Œ Error: Error building `RCall`: β”‚ ERROR: LoadError: R_HOME is not a directory. β”‚ Stacktrace: β”‚ [1] error(::String) at . [Read More]
Julia  RCall  R