mirror of
https://github.com/tiyn/wiki.git
synced 2026-03-09 16:44:46 +01:00
Compare commits
7 Commits
febc5d6532
...
63a7ada580
| Author | SHA1 | Date | |
|---|---|---|---|
| 63a7ada580 | |||
| 5be328f04e | |||
| 55e2798363 | |||
| 0b7874156a | |||
| b6e77adf69 | |||
| 4f8c819370 | |||
| 94aa933c17 |
126
wiki/linux/fingerprint_reader.md
Normal file
126
wiki/linux/fingerprint_reader.md
Normal file
@@ -0,0 +1,126 @@
|
||||
# Fingerprint Reader
|
||||
|
||||
Fingerprint readers can be used for local authentication on
|
||||
[Linux](/wiki/linux.md) systems.
|
||||
|
||||
## Setup
|
||||
|
||||
Support for most fingerprint reader devices is provided by the `libfprint` library and the
|
||||
`fprintd` daemon, which in turn need to be installed.
|
||||
Many [Linux](/wiki/linux.md) distributions package both components directly under this name.
|
||||
|
||||
After installation restart the daemon.
|
||||
|
||||
```sh
|
||||
sudo systemctl restart fprintd
|
||||
```
|
||||
|
||||
By default enrolling fingerprints may require administrative privileges.
|
||||
This can be changed using a `polkit` rule that allows members of the `wheel` group to enroll
|
||||
fingerprints without using `sudo`.
|
||||
|
||||
Create the file `/etc/polkit-1/rules.d/49-fprint.rules`.
|
||||
|
||||
```sh
|
||||
sudo vim /etc/polkit-1/rules.d/49-fprint.rules
|
||||
```
|
||||
|
||||
Insert the following rule.
|
||||
|
||||
```txt
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "net.reactivated.fprint.device.enroll" &&
|
||||
subject.isInGroup("wheel")) {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This section addresses the usage of fingerprint readers.
|
||||
|
||||
### Enrolling a Fingerprint
|
||||
|
||||
A fingerprint can be registered using the following command.
|
||||
|
||||
```sh
|
||||
fprintd-enroll
|
||||
```
|
||||
|
||||
The program will repeatedly ask to place a finger on the reader until the fingerprint has been
|
||||
successfully recorded.
|
||||
|
||||
### Listing Stored Fingerprints
|
||||
|
||||
Stored fingerprints of the current user can be displayed with the following command.
|
||||
`<user>` describes the username to list fingerprints for.
|
||||
|
||||
```sh
|
||||
fprintd-list <user>
|
||||
```
|
||||
|
||||
Fingerprints of other users can be inspected using administrative privileges.
|
||||
|
||||
```sh
|
||||
sudo fprintd-list root
|
||||
```
|
||||
|
||||
### Removing Fingerprints
|
||||
|
||||
Fingerprints can be deleted using `fprintd-delete`.
|
||||
The following displays the removal of a finger called `<finger>` (for example `right-index-finger`)
|
||||
for a user called `<user>`.
|
||||
|
||||
```sh
|
||||
sudo fprintd-delete <user> <finger>
|
||||
```
|
||||
|
||||
### Using Fingerprints with `sudo`
|
||||
|
||||
Fingerprint authentication can be used with `sudo` through PAM.
|
||||
|
||||
Edit the configuration file.
|
||||
|
||||
```sh
|
||||
sudo vim /etc/pam.d/sudo
|
||||
```
|
||||
|
||||
Add the following line near the top of the file.
|
||||
The line should be placed near the top of the file so that fingerprint authentication is attempted
|
||||
before password authentication.
|
||||
|
||||
```txt
|
||||
auth sufficient pam_fprintd.so
|
||||
```
|
||||
|
||||
With this configuration the fingerprint reader can be used for `sudo` authentication while the
|
||||
password remains available as a fallback.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
This section will focus on errors and the fixing of errors of fingerprint readers.
|
||||
|
||||
### Permission denied when enrolling fingerprints
|
||||
|
||||
When attempting to enroll a fingerprint the following error may occur:
|
||||
|
||||
```txt
|
||||
EnrollStart failed: GDBus.Error:net.reactivated.Fprint.Error.PermissionDenied:
|
||||
Not Authorized: net.reactivated.fprint.device.enroll
|
||||
```
|
||||
|
||||
In this case `fprintd` requires elevated privileges to enroll fingerprints.
|
||||
|
||||
The issue can be solved by creating a `polkit` rule which allows members of the `wheel` group to
|
||||
enroll fingerprints.
|
||||
|
||||
In this case the polkit rule `/etc/polkit-1/rules.d/49-fprint.rules` most likely was not set as
|
||||
described in the [setup section](#setup).
|
||||
|
||||
After adding the rule the error should vanish.
|
||||
The rule fingerprint enrollment can then be executed without `sudo`.
|
||||
|
||||
```sh
|
||||
fprintd-enroll
|
||||
```
|
||||
@@ -1,9 +1,9 @@
|
||||
# Hardware (Linux)
|
||||
|
||||
This entry focusses on various hardware components of a [Linux](/wiki/linux.md) desktop PC or a
|
||||
This entry focuses on various hardware components of a [Linux](/wiki/linux.md) desktop PC or a
|
||||
laptop.
|
||||
For non-Linux specific or general topics in hardware see the
|
||||
[correspoding entry](/wiki/hardware_%28general%29.md)
|
||||
[corresponding entry](/wiki/hardware_%28general%29.md)
|
||||
|
||||
## Battery
|
||||
|
||||
@@ -11,22 +11,22 @@ The battery of a notebook can be inspected by using the `upower` command.
|
||||
To use it the tool needs to be installed.
|
||||
In most [Linux](/wiki/linux.md) distributions this is bundled in a package of the same name.
|
||||
|
||||
This section is based on [a video by eKiwi](https://youtu.be/t9KMFDTb79E) which addresses battery
|
||||
health.
|
||||
This section is based on [a YouTube video by the user eKiwi](https://youtu.be/t9KMFDTb79E) which
|
||||
addresses battery health.
|
||||
|
||||
To find out about a battery, its name needs to be known, which can be done using the following
|
||||
To find out about a battery, its name needs to be known which can be done using the following
|
||||
command.
|
||||
|
||||
```sh
|
||||
upower -e
|
||||
```
|
||||
|
||||
Afterwards different values like the state, voltage, percentage and many other can be displayed.
|
||||
Additionally it will show the original capacity (`energy-full-design`) and the current capacity
|
||||
Afterward different values like the state, voltage, percentage and much other can be displayed.
|
||||
Additionally, it will show the original capacity (`energy-full-design`) and the current capacity
|
||||
(`energy-full`), which can be used to determine the health of the battery.
|
||||
The following is an example command where `<battery-name>` is the name of the batter returned from
|
||||
the previous step.
|
||||
This might by similar to `/org/freedesktop/UPower/devices/battery_BAT0`.
|
||||
This might be similar to `/org/freedesktop/UPower/devices/battery_BAT0`.
|
||||
|
||||
```sh
|
||||
upower -i <battery-name>
|
||||
@@ -47,14 +47,14 @@ Tools, programs and guides to manage the power usage and improve battery life ar
|
||||
|
||||
## (Liquid) Coolers
|
||||
|
||||
The viewing of temperatures of coolers aswell as the selection of RGB-settings can be achieved by
|
||||
The viewing of temperatures of coolers as well as the selection of RGB-settings can be achieved by
|
||||
using [liquidctl](https://github.com/liquidctl/liquidctl).
|
||||
|
||||
## Temperature
|
||||
|
||||
To check the temperature the command `sensors` can be used which (on most distributions) is a part
|
||||
of the `lm_sensors` package.
|
||||
It will then display all the available temperature sensors available aswell as many other sensors
|
||||
It will then display all the available temperature sensors available as well as many other sensors
|
||||
like the RPM for fans.
|
||||
|
||||
## ThinkPad TrackPoint
|
||||
@@ -62,7 +62,7 @@ like the RPM for fans.
|
||||
This section is based on a
|
||||
[Reddit comment by zedbraxmen](https://www.reddit.com/r/thinkpad/comments/wjb8qz/configuring_trackpoint_in_wayland/).
|
||||
|
||||
The sensitivity and speed of the classic trackpoint on ThinkPads can be changed using UDEV rules.
|
||||
The sensitivity and speed of the classic TrackPoint on ThinkPads can be changed using UDEV rules.
|
||||
The following lines are an example for a potential file `.rules` located at `/etc/udev/rules.d/`.
|
||||
It could look something like the following.
|
||||
The values for sensitivity and speed could be adjusted.
|
||||
@@ -74,3 +74,10 @@ ATTR{name}=="TPPS/2 IBM TrackPoint",
|
||||
ATTR{device/sensitivity}="275",
|
||||
ATTR{device/speed}="215",
|
||||
```
|
||||
|
||||
## Fingerprint Readers
|
||||
|
||||
Many modern laptops include fingerprint sensors which can be used for authentication on
|
||||
[Linux](/wiki/linux.md).
|
||||
Setup and usage is described in the
|
||||
[entry regarding fingerprint reader](/wiki/linux/fingerprint_reader.md).
|
||||
|
||||
@@ -314,8 +314,8 @@ This section is based on a
|
||||
|
||||
In this case the error stems from a missing package.
|
||||
Normally it can easily be fixed by installing that corresponding package.
|
||||
But please note that [pyenv](/wiki/programming_language/golang.md#setup) can hide packages if the
|
||||
global Python version is set to something other than `system`.
|
||||
But please note that [pyenv](/wiki/programming_language/python.md#pyenv-installation) can hide
|
||||
packages if the global Python version is set to something other than `system`.
|
||||
This is especially the case on [Arch Linux-systems](/wiki/linux/arch-linux.md) because Python
|
||||
packages are also installed via [Pacman or Yay](#arch-linux-pacman-and-yay).
|
||||
In this case the global Version has to be changed to `system` or the package installed to the
|
||||
|
||||
18
wiki/programming_language.md
Normal file
18
wiki/programming_language.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Programming Language
|
||||
|
||||
A programming language is a language for expressing computer programs.
|
||||
|
||||
## List of Programming Languages
|
||||
|
||||
The following is a list of programming languages that are featured in this wiki.
|
||||
|
||||
- [C](/wiki/programming_language/c.md)
|
||||
- [Go](/wiki/programming_language/go.md)
|
||||
- [Nim](/wiki/programming_language/nim.md)
|
||||
- [Python](/wiki/programming_language/python.md)
|
||||
- [Rocq](/wiki/programming_language/rocq.md)
|
||||
- [Rust](/wiki/programming_language/rust.md)
|
||||
- [VHDL](/wiki/programming_language/vhdl.md)
|
||||
- [Viper](/wiki/programming_language/viper.md)
|
||||
<!-- TODO: add short sentences -->
|
||||
<!-- TODO: add SHELL script? -->
|
||||
@@ -174,21 +174,20 @@ This section addresses the [PyTorch module](https://pytorch.org/).
|
||||
Pytorch is a machine learning resource which is often used for
|
||||
[neural networks](/wiki/neural_network.md).
|
||||
|
||||
#### Setup Pytorch with Cuda for GPU usage
|
||||
#### Setup Pytorch with CUDA for GPU usage
|
||||
|
||||
Please note that according to
|
||||
[various sources](https://www.reddit.com/r/archlinux/comments/1nxipcu/nvidia_pascal/gpu_not_supporting_cuda_13_can_i)
|
||||
Cuda 13 does not support nVidia Pascal GPUs.
|
||||
In this case an earlier version of Cuda has to be used.
|
||||
CUDA is also only available for Nvidia GPUs.
|
||||
For AMD GPUs refer to [the ROCm section](#setup-pytorch-with-rocm-for-gpu-usage).
|
||||
|
||||
If you are on Arch Linux or a distribution based on it install
|
||||
`python-pytorch-cuda` via `pacman -S python-pytorch-cuda`.
|
||||
|
||||
After that visit
|
||||
[the official pytorch website](https://pytorch.org/get-started/locally/) and
|
||||
install pytorch for your custom configuration.
|
||||
[the official PyTorch website](https://pytorch.org/get-started/locally) and
|
||||
install PyTorch for your custom configuration.
|
||||
|
||||
After that try to run the following python script:
|
||||
After that try to run the following python script.
|
||||
This should give back `True` if the setup was successful and the GPU is available.
|
||||
|
||||
```python
|
||||
import torch
|
||||
@@ -196,7 +195,66 @@ import torch
|
||||
torch.cuda.is_available()
|
||||
```
|
||||
|
||||
This should give back `True`.
|
||||
Please note that according to
|
||||
[various sources](https://www.reddit.com/r/archlinux/comments/1nxipcu/nvidia_pascal/gpu_not_supporting_cuda_13_can_i)
|
||||
CUDA 13 does not support nVidia Pascal GPUs.
|
||||
In this case an earlier version of CUDA has to be used.
|
||||
|
||||
#### Setup PyTorch with ROCm for GPU usage
|
||||
|
||||
ROCm is also only available for AMD GPUs.
|
||||
For Nvidia GPUs refer to [the CUDA section](#setup-pytorch-with-cuda-for-gpu-usage).
|
||||
|
||||
For ROCm to work some system packages have to be installed.
|
||||
For Linux refer to the
|
||||
[official Linux guide](https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/install/installrad/native_linux/install-radeon.html).
|
||||
For [Arch Linux](/wiki/linux/arch-linux.md) although it is not listed the required
|
||||
[AUR packages](/wiki/linux/package_manager.md) include `rocm-core`, `rocminfo`, `roctracer` and
|
||||
`rccl`.
|
||||
For Windows refer to the
|
||||
[official Windows guide](https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/install/installrad/windows/howto_windows.html).
|
||||
|
||||
After the systemwide setup the project environment can be setup.
|
||||
It is recommended to use [virtual environments](#using-virtual-environments).
|
||||
The easiest way to achieve ROCm support is by using [pip](#modules).
|
||||
As explained in the
|
||||
[official PyTorch guide](https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/install/installrad/native_linux/install-pytorch.html)
|
||||
the following example can be used inside the environment to install all needed ROCm packages.
|
||||
In this example the version `7.2` is installed.
|
||||
Adjustments to the command may have to be done in case another version should be installed.
|
||||
|
||||
```sh
|
||||
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torch-2.9.1%2Brocm7.2.0.lw.git7e1940d4-cp312-cp312-linux_x86_64.whl
|
||||
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchvision-0.24.0%2Brocm7.2.0.gitb919bd0c-cp312-cp312-linux_x86_64.whl
|
||||
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/triton-3.5.1%2Brocm7.2.0.gita272dfa8-cp312-cp312-linux_x86_64.whl
|
||||
wget https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2/torchaudio-2.9.0%2Brocm7.2.0.gite3c6ee2b-cp312-cp312-linux_x86_64.whl
|
||||
pip install \
|
||||
torch-2.9.1+rocm7.2.0.lw.git7e1940d4-cp312-cp312-linux_x86_64.whl \
|
||||
torchvision-0.24.0+rocm7.2.0.gitb919bd0c-cp312-cp312-linux_x86_64.whl \
|
||||
torchaudio-2.9.0+rocm7.2.0.gite3c6ee2b-cp312-cp312-linux_x86_64.whl \
|
||||
triton-3.5.1+rocm7.2.0.gita272dfa8-cp312-cp312-linux_x86_64.whl
|
||||
```
|
||||
|
||||
If old versions of `torch`, `torchvision`, `torchaudio` or `triton` are installed inside the
|
||||
environment they may need to be removed.
|
||||
|
||||
After this installation for some GPUs - especially integrated GPUs like the Radeon 660M - an
|
||||
additional step has to be taken.
|
||||
In this case the following global shell variable has to be set.
|
||||
|
||||
```sh
|
||||
export HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
```
|
||||
|
||||
After that try to run the following python script.
|
||||
Since ROCm uses a bridge to access CUDA it should give back `True` if the setup was successful and
|
||||
the GPU is available.
|
||||
|
||||
```python
|
||||
import torch
|
||||
|
||||
torch.cuda.is_available()
|
||||
```
|
||||
|
||||
### Hailo
|
||||
|
||||
|
||||
75
wiki/programming_language/rocq.md
Normal file
75
wiki/programming_language/rocq.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Rocq
|
||||
|
||||
[Rocq](https://rocq-prover.org/) is an interactive theorem prover.
|
||||
It was formerly known as Coq.
|
||||
|
||||
## Setup
|
||||
|
||||
Rocq can be installed as explained on [the official website](https://rocq-prover.org/install).
|
||||
|
||||
The easiest way to install Rocq is by using Opam due to it also being able to manage packages for
|
||||
Rocq.
|
||||
Opam needs to be installed for this.
|
||||
On most [Linux-based Systems](/wiki/linux.md) the [package manager](/wiki/linux/package_manager.md)
|
||||
contains a package called `opam`.
|
||||
If Opam was not initialized before, do it using the following commands.
|
||||
The command may ask to edit the config file for the shell.
|
||||
This is needed to function correctly.
|
||||
|
||||
```sh
|
||||
opam init
|
||||
eval $(opam env)
|
||||
```
|
||||
|
||||
Then Rocq can be installed using the following command.
|
||||
`<version>` has to be set to the desired version to install (for example `9.0.0`).
|
||||
|
||||
```sh
|
||||
opam pin add rocq-prover <version>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This section addresses the usage of Rocq.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
Rocq proves are saved in `.v` files.
|
||||
These can be compiled using the following command where `<file>` is a Rocq proof file.
|
||||
|
||||
```sh
|
||||
rocq c <file>
|
||||
```
|
||||
|
||||
If nothing is shown as output and files like a `.vo` file are generated the proof was successful.
|
||||
Otherwise it was not successful.
|
||||
|
||||
### Examples
|
||||
|
||||
The following example proofs can be used to confirm the [Rocq setup](#setup) to work correctly.
|
||||
|
||||
The following is a simple proof for commutativity of addition.
|
||||
This proof is correct.
|
||||
|
||||
```v
|
||||
Theorem plus_comm : forall n m : nat, n + m = m + n.
|
||||
Proof.
|
||||
intros n m.
|
||||
induction n as [| n' IH].
|
||||
- simpl. rewrite <- plus_n_O. reflexivity.
|
||||
- simpl. rewrite IH. rewrite <- plus_n_Sm. reflexivity.
|
||||
Qed.
|
||||
```
|
||||
|
||||
The following proof attempts to proof that all natural numbers are equal to zero which is obviously
|
||||
false.
|
||||
|
||||
```v
|
||||
Theorem all_zero : forall n : nat, n = 0.
|
||||
Proof.
|
||||
intros n.
|
||||
destruct n.
|
||||
- reflexivity.
|
||||
- reflexivity.
|
||||
Qed.
|
||||
```
|
||||
Reference in New Issue
Block a user