Install fonts in Linux
Copy the fonts files to ~/.local/share/fonts/
. Then, run fc-cache
to rebuild fonts cache.
fc-cache -fv
Copy the fonts files to ~/.local/share/fonts/
. Then, run fc-cache
to rebuild fonts cache.
fc-cache -fv
From the Stackoverflow post
Query CPU options
grep . /sys/devices/system/cpu/cpu0/cpufreq/*
Set the maximum CPU frequency
echo 4400000 | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
Install cpufrequtils
sudo apt install cpufrequtils
Set the maximum CPU frequency
sudo cpufreq-set -u 4Ghz
When dual-booting Linux and Windows,it might be better to set the clock to the local time zone in Linux1 to in sync with Windows settings.
timedatectl set-local-rtc 1
How to recover Nautilus (File manager in Gnome) places folders.
Check ~/.config/user-dirs.dirs
and make sure the following entries exist and properly setup
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
After saving the file, run the following command to reload Nautilus settings:
xdg-user-dirs-gtk-update
Use pathlib
to read and tomllib
to parse the file. (requires Python >= 3.11)
For example, to extract Julia version from Manifest.toml
import tomllib; from pathlib import Path; print(tomllib.loads(Path("Manifest.toml").read_text())["julia_version"])
And it's easy to run in a bash shell or CI script.
python -c 'import tomllib; from pathlib import Path; print(tomllib.loads(Path("Manifest.toml").read_text())["julia_version"])'
You can make GPUs consume less (or more) power by setting the power limit.
Source: Puget systems
# Power limit to 300 Watt
sudo nvidia-smi -pl 300
To monitor GPU power draw:
nvidia-smi -q -d POWER -l 1 | grep "Power Draw"
The concurrency keyword ensures there is only one job running on the specified group. If there are older jobs running in the same group, you could cancel old jobs to save runner resources.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Run Github actions after successful Cirrus CI runs using the check_suite
trigger.
on:
check_suite:
type: ['completed']
name: Continue after Cirrus CI Completes Successfully
jobs:
continue:
name: After Cirrus CI
if: github.event.check_suite.app.name == 'Cirrus CI' && github.event.check_suite.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Continue
run: echo "Cirrus CI run is Completed"
For example, how to find changed PHP files between latest and the commit before it: 1
git diff --name-only HEAD~1 HEAD '**/*.php'
If the shell does not support the glob pattern, use grep
git diff --name-only HEAD~1 HEAD | grep .php