1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-11-07 05:31:17 +01:00

Merge branch 'master' of ssh://github/tiyn/wiki

This commit is contained in:
TiynGER
2023-03-25 02:25:27 +01:00
205 changed files with 5751 additions and 811 deletions

View File

@@ -0,0 +1,51 @@
# Arch Linux
[Arch Linux](https://archlinux.org/) is a rolling-release, general-purpose
[Linux](/wiki/linux/linux.md)
distribution.
Arch Linux uses the [pacman](./package_manager.md) package manager.
The Arch User Repositories (AUR) features community-made packages that can be
installed with different
[package manager that inlcude access to the AUR](/wiki/linux/arch-linux/package_manager.md).
## Installation
The installation of a basic Arch Linux system is described in the
[installation entry](/wiki/linux/arch-linux/installation.md).
The entry features a guide to install a system with a X server setup aswell as
programs for the most used tasks on a system.
### ISO Medium
For the installation usage of a simple USB key is advised.
This has to be flashed with the Arch ISO.
The ISO file can be found on the
[official website](https://www.archlinux.org/download/).
The iso can be written on an USB-stick using the command
`dd bs=4M if=<path to ISO> of=/dev/sdx conv=fsync oflag=direct status=progress`.
`<path to ISO>` points the command to the location of the ISO file
## Recommended Practices
The following articles describe steps to undertake to harden the system security
or setups and installation that are recommended for Arch Linux.
## Enable Microcode Updates
The microcode of Intel and AMD CPUs can be automatically updated by installing
the `amd-ucode` or `intel-ucode` package depending on your CPU.
Not all processors are supported, especially old ones can lead to problems.
It has to be confirmed that the processor is supported, if this is not the case
is possible for the next steps to break the functionality of the bootloader.
The following part assumes the system is installed with
[UEFI bootloader](/wiki/linux/arch-linux/installation.md#10-install-and-configure-uefi-bootloader)
similar to the [recommended guide](/wiki/linux/arch-linux/installation.md).
The microcode updates can then be enabled by adding the following line into
`/boot/loader/entries/arch.conf`:
```txt
initrd /<installed microcode package>.img
```
`<installed microcode package>` is either `amd-ucode` or `intel-ucode`.

View File

@@ -1,17 +1,18 @@
# Arch installation with LUKS encryption and LVM
This is the English version of the
[German installation guide on rvbg.eu](https://wiki.rvbg.eu/#arch/installation.md).
This guide is based upon a
[german arch wiki entry](https://wiki.archlinux.de/title/Moderne_Installation_mit_UEFI_und_Verschlüsselung).
[german arch wiki article](https://wiki.archlinux.de/title/Moderne_Installation_mit_UEFI_und_Verschlüsselung).
For encryption [dm-crypt](../dm-crypt.md) is used.
Inside the encrypted partition a logical volume will be created with
[LVM](../lvm.md).
At the end of this guide a fully functional Arch Linux will be installed.
## 1. Preparation
Ahead of the installation an Arch boot-stick has to be created. The iso-file can
be found on the [official website](https://www.archlinux.org/download/).
The iso can be written on an USB-stick using `dd`.
Ahead of the installation an Arch boot-stick has to be created as described in
[the Arch Linux entry](/wiki/linux/arch-linux/arch-linux.md#installation-medium).
After that the USB can be plugged in the system on which Arch should be installed.
Boot the target system and select `Boot Arch Linux (x86_64)`.
@@ -100,31 +101,18 @@ Now the created filesystems will be mounted for the installation.
- `mount /dev/sda1 /mnt/boot` - Mount EFI partition
- `swapon /dev/mapper/main-swap` - Mounting swap partition
## 6. Prepare base installation (optional)
In this step the country specific mirrorserver for the installation will be configured.
This will improve the download speed.
- `cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak` - Create a backup
of mirrorlist
- `grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist`
- Example command to only use _German_ mirrors
- `cat /etc/pacman.d/mirrorlist` - Check if the file is to your liking. If it is
not, you can just recover by using `mirrorlist.bak`
## 7. Starting base installation
## 6. Starting base installation
Now you need a working internet connection.
Plug in your lan cable or use `wifi-menu` to get a wireless connection.
- `pacstrap /mnt base base-devel dosfstools gptfdisk lvm2 linux linux-firmware vim networkmanager`
- Installation of main system with needed tools
- `pacstrap /mnt base base-devel dosfstools gptfdisk lvm2 linux linux-firmware vim networkmanager ntp`
- `genfstab -Up /mnt > /mnt/etc/fstab` - creation of fstab
- `arch-chroot /mnt` - Switch into the newly installed system
- `echo ArchLinux > /etc/hostname` - Assign hostname. `ArchLinux` can be changed
for any name of your preference.
## 8. Set Region and Language
## 7. Set Region and Language
- `echo LANG=en\_US.UTF-8 > /etc/locale.conf` - Assign system Language to be
english (you can use other languages, look into the `/etc/locale.gen` for a list of all available languages)
@@ -138,14 +126,13 @@ en_US.UTF-8 UTF-8
- `locale-gen` - Generate languages
- `echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf` - set the keymap
- `cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime` - set your timezone
- `ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime` - set your timezone
(select the first file accordingly to your location)
- `date +%Y%m%d -s "<yyyymmdd>"` - set the current date (change
values accordingly)
- `date +%T -s "<hh:mm:ss>"` - set the current time (change values accordingly)
- `hwclock -w` - sync the current date and time with the hardware clock
- `ntpdate -q 0.de.pool.ntp.org` - sync the time and date with
[NTP](/wiki/linux/ntp.md) (note that a german time server is used and
depending on the needs a adjustments should be made)
## 9. Configure and create kernel-image
## 8. Configure and create kernel-image
- `vim /etc/mkinitcpio.conf`
@@ -156,12 +143,10 @@ en_US.UTF-8 UTF-8
- `mkinitcpio -p linux` - generate Kernel-Image
## 10. Install and configure UEFI bootloader
## 9. Install and configure UEFI bootloader
- `bootctl install` - Prepare bootloader
- `ls -l /dev/disk/by-uuid` - find out the UUID
- `lsblk -no UUID /dev/sda2 | head -n1 > /boot/loader/entries/arch.conf` - print
the UUID in your configuration file
- `ls -l /dev/disk/by-uuid` - find out the UUID of your root partition
- `vim /boot/loader/entries/arch.conf` - Create configuration
- Change the config to look similar to this:
@@ -173,8 +158,8 @@ en_US.UTF-8 UTF-8
options cryptdevice=UUID=<enter your uuid here>:lvm:allow-discards root=/dev/mapper/main-root resume=/dev/mapper/main-swap rw quiet
```
- `cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf`
- Create a fallback
- `cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf` -
create a fallback
- `vim /boot/loader/loader.conf` - Create loader configuration
- Insert the following text
@@ -184,12 +169,12 @@ en_US.UTF-8 UTF-8
default arch
```
## 11. Finishing base installation
## 10. Finishing base installation
- `passwd` - set password for the root account
- `systemctl enable NetworkManager.service`
## 12. Finish the setup
## 11. Finish the setup
- `exit` - exit the installed system
- `umount /mnt/{boot,}` - unmount all partitions
@@ -200,12 +185,21 @@ en_US.UTF-8 UTF-8
If the system is installed in a virtual environment or a system with deactivated
UEFI, don't forget to enable the EFI option, otherwise the system won't boot.
## 13. Further steps and graphical environment
## 12. Further steps and graphical environment
Now you can follow my larbs installation script
Now you can follow the recommended larbs installation script of this wiki
(`curl -o larbs.sh https://raw.githubusercontent.com/tiyn/larbs/master/larbs.sh`)
this will install a bunch of useful software including a graphical environment.
this will install a bunch of useful base software including
[a graphical environment](../x_window_system.md) and
[a window manager](../suckless.md#programs).
You can go on to other guides aswell.
Especially the
[Recommended practices](/wiki/linux/arch-linux/arch-linux.md#recommended-practices)
should be checked for further setups.
Additionally if you have a NVidia Graphics Cards you should read
[the NVidia entry](../nvidia.md) too.
[the NVidia article](../nvidia.md) too.
If you are interested in automatic decryption of the dm-crypt encrypted
partition, take a look at the according section in
[the dm-crypt article](../dm-crypt.md).

View File

@@ -1,20 +0,0 @@
# Package Manager
Package managers are important programs to get software onto your system.
In Arch Linux there are 2 main package managers.
One is `pacman`, the default package manager.
But there are also a bunch other managers for the Arch User Repositories (AUR).
In this article I'll use `yay` as my go to AUR manager.
`yay` is also a wrapper for `pacman` so you can just use `yay` instead of pacman
to install programs.
## Bugfixes
### Error while importing keys
Both `yay` and `pacman` use gpg keys to confirm the package manager gets the
right package.
It is possible that it runs into errors when importing new keys.
If this happens you should try to restart your gpg key server with
`gpgconf --kill all`.

View File

@@ -0,0 +1,60 @@
# Pacman and Yay
Package managers are important programs to get software onto your system.
In Arch Linux there are 2 main package managers.
One is `pacman`, the default package manager.
But there are also a bunch other managers for the Arch User Repositories (AUR).
In this article `yay` is used as the go to AUR manager.
`yay` is also a wrapper for `pacman` so you can just use `yay` instead of pacman
to install programs.
## Update Mirrorlist
After a while not updating the system it is possible for the mirrorlist to be
outdated.
This can be fixed by updating it with the following command:
```sh
curl -o /etc/pacman.d/mirrorlist https://archlinux.org/mirrorlist/all/
```
## Bugfixes
### Error while importing keys
Both `yay` and `pacman` use gpg keys to confirm the package manager gets the
right package.
It is possible that it runs into errors when importing new keys.
If this happens you should try to restart your gpg key server with
`gpgconf --kill all`.
### Unknown public key
If the error `ERROR: One or more PGP signatures could not be verified!`, you
have to manually receive the key and trust it.
This is done by running the following lines:
```sh
gpg --recv-key <KEYID>
gpg --lsign <KEYID>
```
Where <KEYID> is the placeholder of the identification string of the key.
It usually gets gets printed in the line above the error looking like
`FAILED (unknown public key <KEYID>)`.
### Error while updating `is marginal trust`
Both `yay` and `pacman` use gpg keys to confirm the package manager gets the
right package.
It is possible that it runs into errors when importing new keys.
If the error `[...] Key [...] is marginal trust` occurs while updating the
system, it can be fixed by running the following commands and then restarting
the update process of the package manager.
```sh
pacman -Sy archlinux-keyring
pacman-key --populate archlinux
pacman-key --refresh-keys
```

View File

@@ -67,3 +67,18 @@ Scripts to change configuration at docking/undocking
- For the docked configuration use `vim /etc/dockd/dock.hook`
- For the undocked configuration use `vim /etc/dockd/undock.hook`
## FN keys not working
If the fn keys are not working properly run
[a script](https://github.com/tiyn/dotfiles/blob/master/.local/bin/etc/fchange)
that changes the `sys/module/hid_apple/parameters/fnmode` file.
This toggles between the two different fn key functions.
## Toggle the touchpad
To toggle the touchpad on or off
[a simple script](https://github.com/tiyn/dotfiles/blob/master/.local/bin/tools/dwm/toggletouchpad)
can be used that uses `synclient TouchpadOff=1` or `synclient TouchpadOff=0`.
This requires `xf86-input-synaptics` which is a synaptics driver for
notebook touchpads.

View File

@@ -2,9 +2,24 @@
Audio is an important point in a linux desktop environment
## Sound Server
A sound server is software that manages use and access of audio devices.
The following is a list of available sound servers.
- [PulseAudio](./pulseaudio.md) is the go-to sound server program used for
linux.
- [Pipewire](./pipewire.md) is a modern graph based sound server.
## Noise cancellation
Noise cancellation can be achieved by installing
[Noisetorch](https://github.com/lawl/NoiseTorch).
This works for `pulseaudio` and `pipewire`.
Removing noise can be achieved by using
sound processing software options for [sound server](#sound-server).
An example for this is the noise reduction included in
[easyeffects](/wiki/linux/easyeffects.md#noise-cancellation) for Pipewire.
As an alternative software explicitly made for the reduction of noise can be
installed.
Belonging to the latter option noise cancellation can be easily achieved by
installing [Noisetorch](https://github.com/lawl/NoiseTorch).
After the installation modify the `Voice Activation Threshhold` to your needs.

View File

@@ -7,7 +7,7 @@ To change the hardware clock look at the [according article](./hwclock.md)
To change the time and date run the following command:
```shell
```sh
date
```
@@ -16,14 +16,14 @@ date
To change the date run the following command with an adjusted value for the
date:
```shell
```sh
date +%Y%m%d -s "20210809"
```
To change the time run the following command with an adjusted value for the
date:
```shell
```sh
date +%T -s "18:49:42"
```
@@ -34,6 +34,6 @@ After that you can check if the time is correct by displaying it.
To set your timezone run the following command with the accordingly selected
file for your location:
```shell
```sh
cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
```

View File

@@ -1,28 +1,114 @@
# Disk Management
## Grow non-LVM ext4 partition
This article focusses on non-LVM and non-MDADM storage.
For [LVM](lvm.md), [NTFS](./ntfs.md), [Samba](./samba.md), [MDADM](./mdadm.md) and [LUKS volumes](./dm-crypt.md) there
are separate entries.
## Universally Unique identifier
Universally Unique identifier (UUID) are identifiers for informations on
computer systems.
Most notably they are used to identify file systems.
This way the UUID of a file system can be used to identify and
[mount it](#mounting) persistently and correctly.
By listing the directory `/dev/disk/by-partuuid` all mappings of devices to a
UUID are displayed.
## Mounting
Mounting a file system makes the files of it accessible to the user.
The command `mount` is used to manually and temporarily mount file systems.
Automatic mounting is done by changing the file `/etc/fstab`.
The exact guide on how to mount specific file systems can be found in their
respecitive wiki entries.
The following describes the general basics of mounting temporarily and
persistently.
The basic mount command for temporarily accessing a file system is the
following:
`mount <path to partition> <path to mount point>`
All partitions can be found at `/dev` and the standard mount point is `/mnt` and
its subfolders.
For automatic mounting the following line has to be adapted and added to the
file `/etc/fstab`
`<specified partition> <path to mount point> <file system> <additional options> <dump flag> <fsck order>`
The partition can be specified by [UUID](#universally-unique-identifier).
The file system varies and a file system specific guide on how to mount them
can be found in their respective entries.
The dump flag signals if the file system should be dumped.
The `fsck` order signals if a file system should be checked at boot.
Boot partitions should be flagged with a `1` for this reason, otherwise `0`.
For undoing the mount the `umount` command can be used.
The following is a command to unmount a device from a specified directory.
```sh
umount <path to mount point>
```
## Create Partition
In the following it is assumed that the disk is `/dev/sda`
- open up parted with `parted /dev/sdd`
- if not already done create a partition table with `mklabel GPT`
- create a primary partition (ext4 format) with `mkpart primary 2048s 100%`
- `quit` parted
`<path to partition>` points to the partition that will be enlarged (for
example `/dev/sda2`).
## Grow non-LVM partition
ATTENTION: Please note that the partition to enlarge has to be the last one with
the free space after it.
SSH into the VM.
- run `lsblk` check if the disk size has changed
- if not `reboot` the machine
In the following it is assumed that the partition to enlarge is `/dev/sda2`
- change the size of the partition with `parted /dev/sda`
- inside of parted run `print free` and check where the free space after your
partition ends
- run `resizepart` and follow the instructions; End is the number you checked in
the last step
the last step (alternatively you can insert `100%` as end, if you want to add all
the available free space to the partition)
- `quit` parted
Now you need to resize the filesystem with `resize2fs /dev/sda2`.
Afterwards the file system need to be resized as described in a
[later section](#growing-a-file-system).
## Growing a File System
A file system can easily be resized if free space is available on the partition
it is stored in.
The free space has to be placed behind the partition.
This can be done by running the following command:
```sh
sudo resize2fs <path to partition>
```
## Shrinking a File System
To shrink a file system the `resize2fs` command will be used aswell as `e2fsck`.
First the file system needs to be checked for size aswell as data distribution.
This can be done using the command `sudo e2fsck -f <path to partition>`.
`<path to partition>` directs to the volume whose file system should be
shrinked - for example `/dev/sda1`.
It has to be the same for the next step aswell.
Afterwards the file system can be shrinked with the command
`sudo resize2fs <path to partition> <new size of the file system>`.
`<new size of the file system>` is the size that the file system will be
shrunken to in the usual notation (for example `12G`).
Especially for large file systems this might take a while.
## Error solving
This section addresses various problems that can occur and are related to
disk-management.
### sudo: unable to open ... Read-only file system
Ususally the filesystem will go into read-only mode whe the system is running
@@ -34,3 +120,23 @@ To fix it run:
`fsck from util-linux 2.20.1`
you may want to try using the ext4-specific fsck:
- `fsck.ext4 -f /dev/sda1`
### cannot access: Transport endpoint is not connected
This error message can occur if a mounted directory is left mounted due to a
crash of the filesystem but not accessible anymore.
This error can be fixed and the directory made accessible again by running the
following command.
```sh
fusermount -u <path to mount point>
```
If this does not work the following command can be used to unmount the device.
```sh
umount -l <path to mount point>
```
This section is based on a reply by
[Jonathan Brown on Stack Overflow](https://stackoverflow.com/questions/16002539/fuse-error-transport-endpoint-is-not-connected).

55
wiki/linux/dislocker.md Normal file
View File

@@ -0,0 +1,55 @@
# Dislocker
[Dislocker](https://github.com/Aorimn/dislocker) is a driver to read and write
Bitlocker-ed volumes under Linux systems.
## Setup
On most of the Linux distributions Dislocker is bundled with the `dislocker`
package.
## Usage
### Manual Mounting of Bitlocker Partition
For the [mounting](/wiki/linux/disk-management.md#mounting) to work two directories
are required.
One to mount the `dislocker-file` (`/mnt/bitlocker`) and one to mount the
[windows volume](/wiki/linux/ntfs.md#manual-mounting) (`/mnt/windows`).
The device which holds the windows partition is assumed to be calles
`/dev/sdc1`.
The following command mounts the `dislocker` file to `/mnt/bitlocker`.
Make sure to replace the password in the following command.
There is no gap between the `-u` and the password:
`sudo dislocker /dev/sdc1 -u<password> -- /mnt/bitlocker`.
If the Bitlocker partition is set up using a `.BEK` file then the follwing
command takes the path to the file in:
`sudo dislocker /dev/sdb2 -f <path to bek-file> -- /mnt/bitlocker`
Alternatively a recovery key can be used:
`sudo dislocker /dev/sdc1 -p<recovery password> -- /mnt/bitlocker`.
Afterwards the `dislocker-file` can be mounted to the `/mnt/windows` directory
or another mount point as described in the
[NTFS entry](/wiki/linux/ntfs.md#manual-mounting).
### Automatic Mounting at Boot
Using [fstab](/wiki/linux/disk-management.md#mounting) the partition encrypted with
Bitlocker can be automatically mounted.
The following lines have to be adapted and written into
[`/etc/fstab`](/wiki/linux/disk-management.md#mounting).
In this case the intermediary dislocker file `dislocker-file` is mounted to
`/mnt/bitlocker`.
```txt
UUID=<partition uuid> /mnt/bitlocker fuse.dislocker bekfile=<path to bek-file>,nofail 0 0
```
After that a line to mount the `dislocker-file` as a [NTFS](./ntfs.md) partition
has to be added as described in
[the NTFS entry](/wiki/linux/ntfs.md#automatic-mounting).
In this case the specified partition to mount is
`/mnt/bitlocker/dislocker-file`.
The mount point can be chosen according to preference - for example
`/mnt/windows`.

View File

@@ -1,15 +1,176 @@
# DM-Crypt
`dm-crypt` can create and manage encrypted devices.
DM-Crypt can create and manage encrypted devices.
## Creating an encrypted devices
## Usage
### Creating an Encrypted Devices
To create a encrypted device simply run:
`cryptsetup -y -v luksFormat /dev/sda2`.
Where `/dev/sda2` is the device you want to create.
Where `/dev/sda2` is the device to be created.
## Open an encrypted device
### Create/Add a Key File to an encrypted volume
To open and map a device run `cryptsetup -y -v luksFormat /dev/sda1 crypt0` where
`/dev/sda1` is your encrypted device and `crypt0` is where it will be mapped to
with `dev/mapper/crypt0`.
First a key file has to be created.
With the following lines a random file will be created that will later be used
as the key file.
If a key file already exists this part can be skipped.
The following command needs to be adapted.
It will create a key of bitlength 2048 (512 x 4).
```txt
dd bs=512 count=4 if=/dev/random of=<path to destination>
```
It is possible to increase the length to get a stronger key file.
Alternatively strong LUKS keys can be created using [OpenSSL](./openssl.md)
using a bitlength of 4096:
`openssl genrsa -out <path to destination> 4096`.
The key file will then be saved to `<path to destination>`.
Finally the key file can be added to an opened LUKS encrypted volume by running
the following command:
`cryptsetup luksAddKey <path to LUKS volume> <path to key file>`.
`<path to LUKS device>` is the encrypted device (for example `/dev/sda2`) and
`<path to key file>` is the location of the key file.
### Resize a LUKS Encrypted Volume
If volume groups on the encrypted volume are opened make sure to close them
with the following command modified to the present needs:
`vgchange -a n <volume group>`
Open the encrypted volume:
`cryptsetup luksOpen <path to LUKS volume> <mapper location>`.
`<path to LUKS device>` is the encrypted device (for example `/dev/sda2`) and
`<mapper location>` is where it will be mapped to with `dev/mapper/` prepended.
Now resize the encrypted volume to all available space of the partition.
If the encrypted volume should not be extended to the whole partition
or the partition is too small for its intended purposes, make sure to resize the
partition first accordingly (see [disk management](./disk-management.md)).
`cryptsetup resize crypt-volume`
### Open/Close an Encrypted Volume
To open and map a device using a set password run
`cryptsetup luksOpen <path to LUKS device> <mapper location>` where
`<path to LUKS device>` is the encrypted device (for example `/dev/sda2`) and
`<mapper location>` is where it will be mapped to with `dev/mapper/` prepended.
Using `secret` as a `<map location>` the opened drive is available at
`/dev/mapper/secret`.
Alternatively an encrypted volume can be decrypted using
[a key file](#createadd-a-key-file-to-an-encrypted-volume) if set up for it.
This can be achieved by running:
`cryptsetup luksOpen <path to LUKS volume> crypt-volume --key-file=<key file location>`.
`<path to LUKS device>` is the encrypted device (for example `/dev/sda2`).
Afterwards it can be closed by running `cryptsetup close /dev/mapper/crypt0`.
### Creating/Add a USB Decryption Key
This guide assumes an Arch Linux System, as installed in
[this wikis arch linux installation](./arch-linux/installation.md).
This section is based on entries from the
[arch linux forum](https://forum.archlinux.de/d/28886-systementschluesselung-per-usb-stick).
It uses a similar technique to the decryption of the encrypted volume via
[a key file](#createadd-a-key-file-to-an-encrypted-volume).
Insert the USB stick.
This guide will assume its address is `/dev/sde`.
Fill in the first sectors (in this case 94, make sure this number is bigger
than skip sector count and size sector count combined) stick with a random
sequence:
`dd if=/dev/urandom of=/dev/sde bs=512 seek=1 count=94`.
Save the key to a keyfile (with offset 14848 = 29 x 512 and
keysize 2048 = 4 x 512):
`dd if=/dev/sde bs=512 skip=29 count=4 > key.bin`.
Add the keyfile to the encrypted partition (assuming the dm-crypted device is
called `/dev/sda2`):
`cryptsetup luksAddKey /dev/sda2 key.bin`.
Next it has to be made sure that the decryption key, is available at the same
position every time.
For this check the `serial` and `product` of the USB stick with the following
commands.
```sh
udevadm info -a -p `udevadm info -q path -n /dev/sde` | grep ATTRS{serial}
udevadm info -a -p `udevadm info -q path -n /dev/sde` | grep ATTRS{product}
```
The first line gives the `serial`, the second the `product`.
The `product` should match the USB stick.
After this create a file at `/etc/udev/rules.d/50-usbkey.rules` with the
following content.
Assuming the `serial` is `14AB0000000096`.
```txt
SUBSYSTEMS=="usb", ATTRS{serial}=="14AB0000000096", KERNEL=="sd*", SYMLINK+="usbkey%n"
```
Then reload the udev rules by running:
`udevadm control --reload-rules`.
Unplug the stick and plug it back in.
It should be available under `dev/usbkey`.
With the following command an encrypted device can be decrypted with the usb
stick.
Use this to confirm the correct setup of the decryption key and the encrypted
device.
Make sure to edit `--key-file`, `--keyfile-offset` and `--keyfile-size` to
match the settings used in the creation of the USB key.
```sh
cryptsetup luksOpen /dev/sda2 crypt-volume --key-file=/dev/usbkey --keyfile-offset=14848 --keyfile-size=2048
```
After that make sure in `/etc/mkinitcpio.conf` under the `HOOKS` section
`keymap encrypt lvm2` are written before `filesystems`.
Add `/etc/udev/rules.d/50-usbkey.rules` under the `FILES` section.
Then modify `/boot/loader/entries/arch.conf` and add
`cryptkey=/dev/usbkey:14848:2048` to the
end of the `options` line.
Finally run:
`mkinitcpio -p linux`.
Reboot the system with `reboot`.
Make sure the USB key for decryption is plugged in.
If so the encrypted partition should be decrypted automatically.
### Automatical Mounting of an Encrypted Volume
For automatic mounting of an encrypted volume a keyfile is needed.
This will be achieved by entries in the file`/etc/fstab` aswell as the file
`/etc/crypttab`.
First adapt and insert the following lines into `/etc/fstab`:
```txt
/dev/mapper/<mapping location> <mount location> ext4 defaults 0 0
```
`<mapping location>` is a freely choosable identificator and while the
`<mount location>` is an existing directory for the volume to be mounted on.
Additionally the following lines has to be adapted and added to the file
`/etc/crypttab`:
```txt
<mapping location> UUID=<UUID of encrypted volume> <location of key file>
```
`<mapping location>` has to be the same as chosen in the step before.
`<UUID of encrypted volume>` is the
[universally unique identifier](/wiki/linux/disk-management.md#universally-unique-identifier)
of the volume.
`<location of key file>` describes the location where to find the key file
created in the previous step.

44
wiki/linux/easyeffects.md Normal file
View File

@@ -0,0 +1,44 @@
# Easyeffects
[Easyeffects](https://github.com/wwmm/easyeffects) is a free and open-source
GUI-software for applying sound effects and filters on input and output audio
streams.
Easyeffects uses [Pipewire](./pipewire.md) as
[sound server](/wiki/linux/audio.md#sound-server).
## Setup
Easyeffects can be installed on most distributions by installing the
`easyeffects` package.
An installation via [Flatpak](./flatpak.md) is also possible.
## Usage
Easyeffects can apply `Effects` to input and output sound.
### Noise cancellation
Setup
Noise cancellation can be achieved by installing
Easyeffects.
Make sure to check the box `Process all Inputs` and `Process all Outputs` to
route everything through `easyeffects`.
Make log out of your system afterwards.
To enable noise cancellation navigate `Inputs` and click `Plugins`.
After that click `Add Plugin` and select `Noise Reduction`.
### Presets
Presets can be created by selecting `Presets`, setting the name and clicking the
`+` to save it.
It is then displayed in the list below from where it can be loaded or deleted.
Presets are saved in the directory `~/.config/easyeffects/input` and
`~/.config/easyeffects/output`.
#### Recommended Presets
The following is a list of presets that have been tested and only need slight
configuration to adjust them to the specific system.
- [tiyns voice input preset](https://github.com/tiyn/dotfiles/blob/master/.config/easyeffects/input/voice.json)
is a list of different effects to achieve an enhanced quality of microphone
sound for speach.

26
wiki/linux/fdupes.md Normal file
View File

@@ -0,0 +1,26 @@
# fdupes
[fdupes](https://github.com/adrianlopezroche/fdupes) is a command-line utility
for identifying and deleting duplicate files residing within one or more
specified directories.
## Setup
The fdupes program can be installed by going to the
[github page of it](https://github.com/adrianlopezroche/fdupes/releases).
Alternatively many linux package managers package fdupes in the `fdupes`
package.
## Usage
Running `fdupes <path to directory>` find the duplicates inside the given
directory.
Using the `-r` flag the program will search in the subdirectories aswell.
`-d` signals to delete the duplicates and will force a dialogue to select which
version of the file to keep.
This dialogue can be skipped by using `-N` which will select the first file of
a set of multiple duplicates.
A complete and automatic removal of all duplicates within a directory and its
subdirectories works with the following command:
`fdupes -rNd <path to directory>`.

View File

@@ -1,20 +1,65 @@
# ffmpeg
# FFmpeg
[ffmpeg](https://www.ffmpeg.org) is a free and open-source suite consisting of
[FFmpeg](https://www.ffmpeg.org) is a free and open-source suite consisting of
many audio and video tools and libraries.
## Usage
### Convert from format to another
The following line is an example for a conversion of a video and audio capable
format - in this case `.webm` - to an audio format - in this case `.flac`:
`ffmpeg -i audio.webm -c:a flac audio.flac`.
For audio to audio conversion the following example is used:
`ffmpeg -i audio.m4a -f flac audio.flac`.
## Concatenate multiple video files with matching audio-tracks
First you need to create a text file `files.txt` that includes a line for every
video you want to concatenate in the form of:
```shell
```sh
file '<path to the video>'
```
You have to give the absolute path towards the files.
Make sure the videos are in correct order.
To concatenate these video files you can run:
```shell
```sh
ffmpeg -f concat -safe 0 -i files.txt -map 0 -c copy output.mp4
```
If the video files you want to concatenate are not mp4 files change the above
command accordingly.
### Two-Pass Encoding
Two pass encoding - as described in the
[official FFmpeg documentation](https://trac.ffmpeg.org/wiki/Encode/H.264#twopass)
- uses two passes.
The first pass analyzes the input data and outputs a descriptor file.
The second pass actually encodes the data.
The following is an example where the file `input` is encoded with `libx264` to
`mp4` video with `libfdk_aac` audio.
The video bitrate is `555k` and the audio bitrate is `128k`.
```sh
ffmpeg -y -i input -c:v libx264 -b:v 555k -pass 1 -c:a libfdk_aac -b:a 128k -f mp4 /dev/null && \
ffmpeg -i input -c:v libx264 -b:v 555k -pass 2 -c:a libfdk_aac -b:a 128k output.mp4
```
### Encode Audio/Video to Target Size
For the encoding of a file to a target size the target bitrate of the output
video is needed.
An explanation of this was given by
[aergistal on Stack Overflow](https://stackoverflow.com/questions/29082422/ffmpeg-video-compression-specific-file-size).
This can easily be done with the calculation `bitrate = target size / duration`
in Bits/Second.
Afterwards the encoding can be done by using Two-Pass Encoding as explained in
[a previous section](#two-pass-encoding).
Note that the bitrate for videos is split amongst a bitrate for video and a
bitrate for audio.
The target bitrate has to be equal to or greater than the sum of both video
bitrate and audio bitrate.

View File

@@ -0,0 +1,55 @@
# flac (Package)
This article describes the `flac` package on linux.
For the audio codec see the [flac entry](../flac_(codec).md)
`flac` is a package to work with the [flac codec](../flac_(codec).md).
## Setup
On most distributions it is bundled together with the command line tagging
software `metaflac` and other auxiliary tools in the `flac` package.
Another possible tagging software is [MusicBrainz Picard](../picard.md)
## Usage
### Splitting Flac file according to cue file
An easy way to split flac files according to a [cue file](../cue_sheet.md) is
using `cuebreakpoints` and `shnsplit`.
On most distributions they are in a package with the same name.
The following line of shell command splits a flac file according to a cue file.
The `-o` tag specifies the output file format.
```sh
cuebreakpoints '<cue file>' | shnsplit -o flac '<audio flac file>'
```
Omitting of the `-o` flag will result in output files with the `.wav` filetype.
Alternatively the usage of `cuebreakpoints` can be avoided with the following
command.
```sh
shnsplit -f '<cue file>' -o flac '<audio flac file>'
```
Another option is to use [`cue2tracks`](https://github.com/ar-lex/cue2tracks).
This has the advantage that tags for album title, song name and others are set
while splitting the files.
An example command looks like the following.
The `.flac` file is not mentioned in the command.
```sh
cue2tracks '<cue file>'
```
For any of these commands there can be problems with splitting `.flac` files.
It then is recommended to convert the file to the also lossless `.wav` format,
split the files and convert it back to `.flac`.
High quality flac files with older `.cue` files that use the format `mm:ss:ff`
might split the file at the wrong timings.
The format `mm:ss:ff` is not compatible with the newer versions of
cuebreakpoints, cue2tracks and shnsplit.
To get the correct timings the `.cue` file has to be changed to use the format
`mm:ss:fff`.
It is recommended to use the shnsplit alternative in this case.

31
wiki/linux/flatpak.md Normal file
View File

@@ -0,0 +1,31 @@
# Flatpak
[Flatpak](https://flatpak.org/) is a cross-distribution package manager for
linux systems.
## Setup
The `flatpak` package can be installed by most distribution specific package
managers (e.g. [pacman or yay](./arch-linux/package_manager.md)).
After installation it is important to add [flathub](https://flathub.org/home),
a source for many Flatpak packages.
The addition of this can be done by running
`flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo`.
For browsing and installing Flatpak packages via a graphic user interface the
software management suite called Discover can be used.
It requires the Flatpak backend.
## Usage
### Installing software
When software installation is done with Flatpak it is recommended to pass the
`--user` so the software is not installed system-wide but for the user only.
In practice it looks like the following:
`flatpak install --user <package to install>`.
### Running software
Software installed via Flatpak can be run by typing the full package path into
the command line, for example `com.makemkv.MakeMKV`.

39
wiki/linux/fwupd.md Normal file
View File

@@ -0,0 +1,39 @@
# fwupd
[fwupd](https://fwupd.org/) is a daemon for managing and installing firmware
updates on Linux based operating systems.
It is mainly used for UEFI firmware and supported devices.
## Setup
fwupd can be installed on most distributions by installing the
`fwupd` package.
## Usage
The following commands describe the basic usage of an update process using
fwupd.
First the devices updatable by fwupd can be checked.
```sh
fwupdmgr get-devices
```
Afterwards the latest metadata can be downloaded by the following command.
```sh
fwupdmgr refresh
```
The updates can the be listed.
```sh
fwupdmgr get-updates
```
Finally the updates can be installed.
```sh
fwupdmgr update
```

View File

@@ -0,0 +1,46 @@
# GPU Screen Recorder
[GPU Screen Recorder](https://git.dec05eba.com/gpu-screen-recorder/about/) is a
utility similar to [Nvidia ShadowPlay](/wiki/nvidia.md#screen-capture).
## Setup
GPU Screen Recorder can be installed on some distributions by installing the
`gpu-screen-recorder-git` package.
An installation via [git](https://git.dec05eba.com/gpu-screen-recorder/about/)
is always possible.
## Usage
The program features normal recording of the screen and recording in the so
called replay mode.
To start a simple screen recording run the following command.
```sh
gpu-screen-recorder -w $(xdotool selectwindow) -c mp4 -f 60 -a "$(pactl get-default-sink).monitor" -o test_video.mp4`
```
The window to record has to be selected first by clicking on it.
The default audio device is already selected.
To stop the recording `Ctrl-C` the previous command or use the command below.
```sh
killall -SIGINT gpu-screen-recorder
```
For the replay mode the recording can be started the following way.
```sh
gpu-screen-recorder -w $(xdotool selectwindow) -c mp4 -f 60 -a "$(pactl get-default-sink).monitor" -r 30 -o .`
```
In this case a replay will have the maximum length of 30 seconds (specified by
`-r 30`).
It is also important to assign the `-o` flag with a directory and not a file
anymore.
The last 30 seconds (replay) can then be sending a SIGUSR1 signal.
```sh
killall -SIGUSR1 gpu-screen-recorder
```

View File

@@ -2,18 +2,20 @@
`hwclock` is a program to set and display the hardware clock.
## Display time and date
## Usage
### Display time and date
To display the hardware clock run the following command:
```shell
```sh
hwclock
```
## Sync the hardware clock to the system time
### Sync the hardware clock to the system time
To sync the hardware clock run the following command:
```shell
```sh
hwclock -w
```

11
wiki/linux/init.md Normal file
View File

@@ -0,0 +1,11 @@
# Init
The init process is the first process started after boot.
All processes running in later stages are descendants of the init process.
The init process is given to a init system that manages various services.
## Init Services
The following is a list of available init services.
- [SystemD](/wiki/linux/systemd.md) is most common among linux systems.

31
wiki/linux/intel.md Normal file
View File

@@ -0,0 +1,31 @@
# Intel
[Intel](https://www.intel.de/content/www/de/de/homepage.html) is a vendor and
manufacturer of semiconductor chips.
They provide motherboard chips, network interface controllers, flash memory,
[graphics chips](#intel-graphics) and more.
## Intel Graphics
Intel graphics is the name for various intel made integrated graphics
processors.
### Configuration
#### Screen Tearing
Linux systems that use intel graphics can sometimes have problems with screen
tearing.
To get this working you need to change the `/etc/X11/xorg.conf.d/20-intel.conf`
as explained on
[maketecheasier](https://www.maketecheasier.com/get-rid-screen-tearing-linux)
to:
```txt
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
```

View File

@@ -4,24 +4,50 @@
interfaces, routing and tunnels.
It is a replacement for the program `ifconfig`.
## List all network interfaces
## Usage
### List all network interfaces
You can list network interfaces by running:
```shell
```sh
ip link list
```
## Enable/disable a network interface
### Enable/disable a network interface
Assuming the interface is named `wlan0` run the following:
```shell
```sh
ip link set wlan0 up
```
Disabling works accordingly by running:
```shell
```sh
ip link set wlan0 down
```
### Get Outside IP
For VPN and other applications using a tunnel it can be useful to check the
outside IP of your system.
The following command uses the `dig` command.
It is either bundled in the `dig` package - like in
[Arch Linux](/wiki/linux/arch-linux/arch-linux.md) - or in the `dnsutils`
package - like in Ubuntu - or even another package depending on the distribution
used.
After installation the following command can be used to get the outside IP
address of your system.
```sh
dig +short txt ch whoami.cloudflare @1.0.0.1
```
There is an alternative to this using `wget`.
It uses a call to DuckDuckGo and requests the outside IP from there.
The mentioned command is the following.
```sh
wget -qqO- 'https://duckduckgo.com/?q=what+is+my+ip' | grep -Pow 'Your IP address is \K[0-9.]+'
```

View File

@@ -1,13 +1,12 @@
# Khal
`khal` is a calendar you can use in your terminal.
[Khal](https://github.com/pimutils/khal) is a calendar you can use in your terminal.
You can sync it with [vdirsyncer](vdirsyncer.md)
## Setup
### Arch-Linux
- `pacman -S khal` - Install needed packages
On most linux distributions Khal can be installed with the `khal` package.
Alternatively it can be installed via [Github](https://github.com/pimutils/khal).
### Configuration

View File

@@ -1,13 +1,12 @@
# Khard
`khard` is a adressbook that runs in your terminal.
[Khard](https://github.com/lucc/khard) is a adressbook that runs in your terminal.
You can sync it with [vdirsyncer](vdirsyncer.md).
## Setup
### Arch Linux
- `pacman -S khard` - Install needed programs
On most linux distributions Khal can be installed with the `khard` package.
Alternatively it can be installed via [Github](https://github.com/lucc/khard).
### Configuration

14
wiki/linux/linux.md Normal file
View File

@@ -0,0 +1,14 @@
# Linux
Linux is a family of open-source operating systems that are based on the kernel
with the same name.
Linux based operating systems are Unix-like.
## Distributions
The different operating systems that are based on the Linux kernel are called
distributions.
- [Arch Linux](/wiki/linux/arch-linux/arch-linux.md) is a rolling-release
distribution whose base system is as minimal and needs heavy user
configuration.

View File

@@ -2,7 +2,9 @@
`lvm` is a utility to create logical volumes.
## Create VG for proxmox
## Usage
### Create Volume Group for Proxmox
We will use `/dev/sdb` as our drive.
Setup the disk for the physical volume with `sgdisk -N 1 /dev/sdb`.
@@ -13,35 +15,153 @@ This can be solved by removing the old partition table with `wipefs -a /dev/sdb`
And finally create the volume group `vgcreate vmdata /dev/sdb`.
Then follow the guide in proxmox on how to connect a `vg` to proxmox.
## Add Drive to existing volume group
### Add Physical Volume to Existing Volume Group
First format the disk so that it has one partition (we will assume its called
`/dev/sdc1`).
To add the partition to a group run:
```shell
```sh
pvcreate /dev/sdc1
vgextend <name of your volume group> /dev/sdc1
```
## Increase size of a logical volume
### Remove Physical Volume
To increase the size of the logical volume you need to have free space in the
Before removing a physical volume it has to be confirmed that it is not part of
any volume group.
This can be done by running `sudo pvs` and confirm it is not listed for any
logical volumes.
If it is [a later section](#shrink-size-of-a-logical-volume) how the physical
volume can be completely emptied and removed from the logical volume.
A physical volume can be removed by running the following command:
```sh
sudo pvremove <path to physical volume>
```
`<path to physical volume>` is the physical volume that will get removed.
### Resize a Physical Volume
To increase the size of a physical volume you have to have free free space
in the partition containing the physical volume.
A guide to change 'normal' partitions can be found in the
[disk management article](./disk-management.md); if you have a volume that is
encrypted with LUKS a guide is available in
[the dm-crypt articel](./dm-crypt.md).
To resize the physical volume to the size of the containing volume run:
`pvresize /dev/mapper/<name of physical volume>`
### Increase Size of a Logical Volume
To increase the size of the logical volume you have to have free space in the
according volume group. You can check that by running: `vgdisplay`.
If you don't have enough space you have to resize the physical volume as
described in this article.
Then run:
```shell
```sh
lvextend -L +<size (e.g. 40G)> /dev/<volume groupt>/<logical volume>
```
If you want to allocate all the free space existing in a volume group run:
```shell
```sh
lvextend -l +100%FREE /dev/<volume group>/<logical volume>
```
Now you need to extend the filesystem with:
Now you need to extend the file system with:
```shell
```sh
resize2fs /dev/<volume group>/<logical volume>
```
### Shrink Size of a Logical Volume
When trying to shrink a logical volume caution is advised as data can easily be
destroyed by mistyping commands of paths.
This section is based on a guide given by
[telcoM](https://unix.stackexchange.com/questions/591389/how-to-remove-a-disk-from-an-lvm-partition).
First of all the volumes have to be unmounted and not used by any programs or
services other than the following commands.
If the volume to shrink is the root volume it has to be done offline.
For that a simple installation stick is enough.
[The Arch Linux entry](/wiki/linux/arch-linux/arch-linux.md#installation-medium)
describes the creation of such a boot stick.
Afterwards the operating system has to be booted from the just created stick or
a comparable device.
For non-root volumes this extra step can be skipped.
The volume group needs to be activated by running the command
`sudo vgchange -ay <volume group>`.
`<volume group>` is the name of the volumegroup that features the logical volume
to shrink.
Then the file system needs to be resized.
For safety reasons make the file system exactly as big or smaller than the
future logical volume.
The process of shrinking a file system is explained in the
[disk management entry](/wiki/linux/disk-management.md#shrinking-a-file-system).
The partition to shrink in this case is the logical volume.
This is the only step that needs to be done offline for root volumes.
Rebooting to the root volume at this moment is advised.
The next step will shrink the logical volume itself.
This will be done by running the following command:
```sh
sudo lvreduce -L <new size of logical volume> /dev/mapper/<volume group>-<logical volume>
```
Again this statement has to be adapted accordingly.
`new size of logical volume` describes the new size the logical volume will have
after successful completion of the command.
It is important for this to be exactly the same or larger than the size given
into the resizing of the file system with `resize2fs`.
### Remove Physical Volume from Volume Group
This section describes the removal of a physical volume from a logical volume.
First the command `vgs <volume group>` has to be run.
`<volume group>` is the name of the volume group belonging to the logical volume
a physical volume should be removed from.
It has to be ensured, that enough free space (`VFree`) on all physical volumes
(except the ones to remove) is available to remove a physical volume from the
volume group.
There has to be equal or more free space than the size (`VSize`) of the physical
volume that will be removed.
Otherwise an [earlier section](#shrink-size-of-a-logical-volume) explains how to
shrink a logical volume.
The logical volume has to be shrunk according to the described ration between
`VFree` and `VSize`.
The following command will distribute the contents of a physical volume onto
other physical volumes available:
```sh
sudo pvmove <path to physical volume>
```
`<path to physical volume>` is the physical volume that will get emptied and
later removed from the logical volume.
Afterwards the physical volume is emptied and can be removed from the logical
volume by running the following command:
```sh
sudo vgreduce <logical volume> <path to physical volume>
```
`<logical volume>` is the name of the logical volume.
After this command the physical volume is no longer a part of it.
If no longer used the empty physical volume can then be removed as described in
the [according section](#remove-physical-volume).
Afterwards the file system can be matched to the logical volume so it takes up
the full new size.
This is explained in the
[entry about disk management](/wiki/linux/disk-management.md#growing-a-file-system).

View File

@@ -1,15 +1,83 @@
# MDADM
`mdadm` is a utility to create and manage raid devices.
MDADM is a utility to create and manage raid devices.
For the rest of this entry `n` is the number of drives inside a raid device.
## Raid 1
## Usage
### Get Information About a Raid
To get an info for a running raid (assuming it is `/dev/md0`) run
`mdadm -D /dev/md0`.
### Add Disk/Partition to Raid Device
You can add a disk or partition to a raid device by running the following.
It is assumed you are adding a partition called `/dev/sdd1` but it could also
be a whole drive and the mdadm drive is called `/dev/md0`.
`mdadm --add /dev/md0 /dev/sdd1`
This will add the disk as spare to the existing raid.
To make the disk active the raid needs to be grown as described in the
[regarding article](#growing-raid-device).
### Growing Raid Device
Growing a raid device will increase its number of active drives.
[Check the number of active drives](#get-information-about-a-raid).
Then change and run the following command accordingly.
```sh
mdadm --grow --raid-disks=5 /dev/md0
```
`/dev/md0` is the raid device.
`5` is the number of disks that should be active.
For adding disks view the [previous section](#add-diskpartition-to-raid-device).
### Raid 1
Raid 1 creates a mirror with even amount of drives.
For `n=2` [raid 5](#raid-5) and raid 1 are basically the same.
The space efficiency is `1/n` and the fault tolerance is `n-1` drive failure.
The read perfromance is `n` and the write performance `1`.
### Create Raid 0 device
#### Create Raid 1 Device
You can create a Raid 0 device with
You can create a Raid 1 device with
`mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb`
where `sda` and `sdb` are the disks you want to include in your raid.
You can increase the number of raid devices, but they have to be at least 2.
If it is an uneven amount of disks in the raid, a disk will act as a spare disk.
#### Convert Raid 1 to Raid 5
Assuming the raid 1 device is called `/dev/md0`.
All other drives are part of the `md0` raid device.
Note that mostly raid 1 devices consisting of 2 drives should be converted to
[raid 5](#raid-5).
- Remove all drives but 2 (if there are more drives than that) by running
`mdadm /dev/md0 --fail /dev/sda1` and `mdadm /dev/md0 --remove /dev/sda1`
where `sda1` is the drive to remove
- Make sure your raid 1 array has only 2 active drives by running
`mdadm --grow /dev/md0 -n 2`
- Now convert your raid 1 to a raid 5 device with `mdadm --grow /dev/md0 -l5`
- Add the disks you removed back to the raid with
`mdadm /dev/md0 --add /dev/sda1`
- Finally grow the active drive number to your needs (in this example 4)
`mdadm --grow /dev/md0 -n4`
- MDADM now reshapes the raid. You can monitor it by running
`watch cat /proc/mdstat`
### Raid 5
Raid 5 creates a raid device with distributed parity and is set to have at least
3 drives.
The space efficiency is `1-(1/n)` and the fault tolerance is `1` drive failure.
The read perfromance is `n` and the write performance `1/4` for single sector
and `n-1` for full stripe.
In the special case of 2 drives in a raid 5 it is functionally the same as
[raid 1](#raid-1).

15
wiki/linux/microcode.md Normal file
View File

@@ -0,0 +1,15 @@
# Microcode
Processor vendors release stability and security updates to the processor
microcode.
## Setup
Most Linux based operating systems feature packages depending on the processor
manufacturer (on Arch Linux for example `intel-ucode` and `amd-ucode`).
## Automatic Updates
Automatic updates can be enabled depending on bootloader and operating system.
For Arch Linux a description is given in the
[Arch Linux entry](/wiki/linux/arch-linux/arch-linux.md#enable-microcode-updates).

54
wiki/linux/mime.md Normal file
View File

@@ -0,0 +1,54 @@
# MIME
A MIME type (short for Multipurpose Internet Mail Extensions) is a identifier
for file formats and contents on the internet.
## Usage
### Setting applications for MIME types
In `~/.config/mimeapps.list` a list of applications to run specific MIME
types can be found.
An example file looks like the following:
```txt
[Default Applications]
text/x-shellscript=text.desktop;
x-scheme-handler/magnet=torrent.desktop;
application/x-bittorrent=torrent.desktop;
x-scheme-handler/mailto=mail.desktop;
text/plain=text.desktop;
application/postscript=pdf.desktop;
application/pdf=pdf.desktop;
image/png=img.desktop;
image/jpeg=img.desktop;
image/gif=img.desktop;
application/rss+xml=rss.desktop
video/x-matroska=video.desktop
inode/directory=file.desktop
```
A line consists of a MIME type left of the equals sign and an application on
the right of it.
The application can be found in `~/.local/share/applications/`.
In this directory a file for every application on the right side of the equals
sign with the same title can be found.
A simple application file looks like the following example of `img.desktop`:
```txt
[Desktop Entry]
Type=Application
Name=Image viewer
Exec=/usr/bin/sxiv -a %f
```
Atleast `Type`, `Name` and `Exec` have to be specified for a minimal
application file.
### Getting MIME type of a file
The MIME type of a file can be returned by running
`xdg-mime query filetype <file>` or `file -b --mime-type image.png`.
The MIME type can be then used to set default applications as explained in
[the section regarding setting applications for MIME types](#setting-applications-for-mime-types).

36
wiki/linux/netplan.md Normal file
View File

@@ -0,0 +1,36 @@
# Netplan
[Netplan](https://netplan.io) is a utility for configuring the networking of a
linux system via YAML files.
## Usage
### Add more IP addresses to a system
In the file `/etc/netplan/50-cloud-init.yaml` create an `addresses:` section
for a device (for example an ethernet device) and list the IP addresses you
want to add to the system to it.
It has to be noted, that the added addresses should be outside of the DHCP
range of your router.
An example file will look something like the following lines.
In this case 4 addresses were added.
`192.168.178.18/24` is the IP assigned by the DHCP server.
It has to be noted that this is a special case as the DHCP server assigns this
address always to the system.
```txt
network:
ethernets:
ens18:
dhcp4: true
addresses:
- 192.168.178.18/24
- 192.168.178.201/24
- 192.168.178.202/24
- 192.168.178.203/24
- 192.168.178.204/24
version: 2
```
Afterwards netplan has to be restarted by running `sudo netplan apply`.
The addresses then are assigned to the system.

View File

@@ -0,0 +1,27 @@
# NetworkManager
NetworkManager - short NM - is a program to automatically detect and connect to
networks by providing options for various configuration.
## Setup
NetworkManager can be installed with the `networkmanager` package on most linux
distributions which provides daemon aswell as `nmcli` a command line interface
and `nmtui` a terminal user interface for configuration.
Additionally `nm-connection-editor` can be installed for a graphical user
interface.
## Usage
After installation `networkmanager.service` has to be enabled by the used
[init-system](/wiki/linux/init.md) (for example
[systemD](/wiki/linux/systemd.md#startstopenabledisable-a-service)).
### OpenVPN
NetworkManager needs a plugin to work with openvpn configurations.
This plugin can be installed with the `networkmanager-openvpn` package.
OpenVPNs `.ovpn` files can then be imported by running
`nmcli connection import type openvpn file <openvpn-file>`.
Afterwards they can be modified accordingly.

38
wiki/linux/ntfs.md Normal file
View File

@@ -0,0 +1,38 @@
# NTFS
NTFS is the proprietary [file system](./disk-management.md) of Windows.
## Setup
For the usage of NTFS file systems the `ntfs-3g` package - available on most
distributions - has to be installed.
## Usage
When [mounting](/wiki/linux/disk-management.md#mounting) a
[Bitlocker encrypted drive](./dislocker.md) there are additional steps that have
to be taken to decrypt the device.
### Manual Mounting
Partitions using NTFS can be mounted on Linux based operating systems by
running the following command:
`mount -t ntfs-3g -o loop <path to partition> <path to mount point>`.
If the partition to mount is bootable or contains a windows system the
hibernation and fast boot have to be disabled to mount the partition with write
access.
### Automatic Mounting
For the usage of NTFS file systems the `ntfs-3g` package - available on most
distributions - has to be installed.
To [automount partitions](/wiki/linux/disk-management.md#mounting) with NTFS
the following line has to be adapted and added to `/etc/fstab`:
```txt
<specified partition> <path to mount point> ntfs-3g nofail,windows_names,big_writes 0 0
```
If the partition to mount is bootable or contains a windows system the
hibernation and fast boot have to be disabled to mount the partition with write
access.

26
wiki/linux/ntp.md Normal file
View File

@@ -0,0 +1,26 @@
# NTP
[NTP](https://www.rfc-editor.org/rfc/rfc5905) - short for Network Time Protocol
- is the most common method to synchronize the software clock of a
[Linux](/wiki/linux/linux.md) system.
## Setup
NTP can be installed on most distributions by installing the
`ntp` package.
## Usage
The following section describes the usage of the NTP package.
### Synchronize Time once
For one time synchronization of the time and date the `ntpdate` command can be
used.
The following command is an example for a one time sync.
Note that the server has to be changed for different time zones.
In this case a german time server is used.
```sh
ntpdate -q 0.de.pool.ntp.org
```

View File

@@ -1,27 +1,34 @@
# NVidia
# Nvidia
NVidia is a vendor for graphics cards.
[Nvidia](/wiki/nvidia.md) is a vendor for graphics cards.
## Setup NVidia GPU
## Setup
### Arch Linux
For NVidia GPUs to work install the `nvidia` and the `nvidia-utils` package.
For Nvidia GPUs to work install the `nvidia` and the `nvidia-utils` package.
If you want to easily configure the monitors as described in a later section of
this file you can also install `nvidia-settings`.
There is no initial setup for a `xorg.conf` in `/etc/X11` needed
(except for a multiple GPU/APU setup).
## Change monitor configuration
### Configuration
After running `sudo nvidia-setting` can drag and drop the monitors to your
liking.
After that you have to save the configuration to the `/etc/X11/xorg.conf`.
A basic configuration can be achieved by running `nvidia-xconfig`.
## Avoid screen tearing
## Usage
To avoid screen tearing open up `nvidia-settings` and under
`X Server Display Configuration` select your display.
Then click on `Advanced` and select either `Force Composition Timeline` or
Most configuration and changes require the use of `nvidia-settings`.
### Change monitor configuration
In `nvidia-setting` monitors can be dragged and dropped to your liking.
After that you have to save the configuration to the
[X window manager](./x_window_system.md) configuration file
`/etc/X11/xorg.conf`.
### Avoid screen tearing
In `nvidia-settings` under
`X Server Display Configuration` select your display and click on `Advanced`
and select either `Force Composition Timeline` or
`Force Full Composition Timeline`.

View File

@@ -3,7 +3,9 @@
[OpenSSL](https://www.openssl.org) is a software library for secure
communication over computer networks.
## Creating a key pair
## Usage
### Creating a key pair
As described by [dreikanter](https://gist.github.com/dreikanter/c7e85598664901afae03fedff308736b)
you can create and save a pretty secure private key to `private.key` with
@@ -11,7 +13,7 @@ you can create and save a pretty secure private key to `private.key` with
After that run `openssl rsa -in private.key -pubout -out public.key` to save the
according public key to `public.key`.
## Encrypting and decrypting files
### Encrypting and decrypting files
[Dreikanter](https://gist.github.com/dreikanter/c7e85598664901afae03fedff308736b)
describes to encrypt larger files with symmetric encryption and encrypt the key

27
wiki/linux/pipewire.md Normal file
View File

@@ -0,0 +1,27 @@
# Pipewire
[Pipewire](https://pipewire.org) is a graph based
[sound server](/wiki/linux/audio.md#sound-server).
## Setup
For clients that use the [PulseAudio](/wiki/linux/pulseaudio.md) API
`pipewire-pulse` (on Arch-based distros or according
packages on other distros) can be installed.
It will automatically remove unneeded and conflicting PulseAudio packages.
Additionally `pipewire-alsa` and `pipewire-jack` for JACK and Alsa clients are
available.
Make sure to restart to be sure everything is running correctly.
## Usage
For simple sound processing in the form of volume adjustment as well as setting
the default input and output devices
[`pavucontrol`](https://freedesktop.org/software/pulseaudio/pavucontrol/) can be
used as a simple mixer.
For more advanced routing [`qpwgraph`](https://github.com/rncbc/qpwgraph) is
recommended.
`qpwgraph` is a graph-based interface using the Qt interface.
For further sound processing the easiest way to do so is using
[easyeffects](/wiki/linux/easyeffects.md) which features a wide range of effects
to apply to sound streams including noise reduction.

View File

@@ -14,20 +14,30 @@ After that follow the instructions and fill in the fields to your liking.
### Enlarging disk of a VM
Make sure there is enough disk space available.
For further information see [the disk management article](./disk-management.md)
SSH into Proxmox.
Enlarge a disk by using:
```shell
```sh
qm resize <vmid> <vm-disk-to-enlarge> <size>
```
For example (100G is 100GibiByte):
For example if you want to the disk 100 by 100G (100GibiByte):
```shell
```sh
qm resize 100 ide0 +100G
```
After that grow the filesystem as described in [the disk-management article](disk-management.md).
Afterwards the partition of the VM needs to be enlarged.
For that
[the disk management article](/wiki/linux/disk-management.md#grow-non-lvm-partition)
can be used for non-LVM paritions.
Alternatively [the LVM article](/wiki/linux/lvm.md#increase-size-of-a-logical-volume)
can be referenced for LVM systems.
After that grow the filesystem in the vm as described in
[the disk management article](/wiki/linux/disk-management.md#growing-a-file-system).
## Remove local-lvm and add its size to local
@@ -43,19 +53,19 @@ Finally extend the filesystem `resize2fs /dev/mapper/pve-root`.
On the host system find the usb you're looking to pass through with
```shell
```sh
lsusb
```
Then assign it to the vm using
```shell
```sh
qm set <vm-id> -usb<id-to-set> host=<id-of-the-usb>
```
for example
```shell
```sh
qm set 101 -usb0 host=aaaa:8816
```
@@ -74,7 +84,7 @@ To increase it navigate to the webinterface and click on Datacenter and Storage
select the storage you want to save your backup to and change `Max Backups` to
your liking.
## Bugfixing
## Troubleshooting
### No internet after mainboard swap

13
wiki/linux/pulseaudio.md Normal file
View File

@@ -0,0 +1,13 @@
# PulseAudio
[PulseAudio](https://www.freedesktop.org/wiki/Software/PulseAudio) is a
[sound server](/wiki/linux/audio.md#sound-server) distributed by the
[freedesktop.org](https://www.freedesktop.org/wiki/Software/PulseAudio) project.
## Usage
### Mixing
For simple sound processing in the form of volume adjustment as well as setting
the default input and output devices `pavucontrol` can be used as a simple
mixer.

View File

@@ -0,0 +1,21 @@
# RAR (package)
RAR is a package available for many Linux distributions that handles `.rar`
archives of the [RAR algorithm](/wiki/rar_(algorithm).md).
## Setup
On most distributions the functionalities for creating a `.rar` archive is
bundled in the `rar` package.
For extraction a separate package is used called `unrar`.
## Usage
### Extracting a `.rar` archive
A `.rar` archive can be extracted using the `unrar` package with the following
command.
```sh
unrar e <path to .rar file>
```

27
wiki/linux/samba.md Normal file
View File

@@ -0,0 +1,27 @@
# Samba
[Samba](../samba.md) is the standard Windows interoperability suite for linux
and unix.
## Usage
### Manual Mounting
The mounting of Samba shares requires a package containing `mount.cifs` in many
distributions packaged in the `cifs-utils` package to be installed.
Samba shares then can be mounted by adapting and running the following example:
`mount -t cifs //<server address>/<share name> <path to mount point> -o username=<username>,password=<password>`
### Automatic Mounting
The mounting of Samba shares requires a package containing `mount.cifs` in many
distributions packaged in the `cifs-utils` package to be installed.
To automount Samba shares the following line has to be adapted and added
to `/etc/fstab`:
`//<server address>/<share name> <path to mountpoint> cifs,nofail credentials=<path to authentication file> 0 0`.
An authentication file looks like the following:
```txt
username=<username>
password=<password>
```

View File

@@ -1,13 +1,11 @@
# SC-IM
`sc-im` is a program to view and edit tables especially in csv-format.
[sc-im](https://github.com/andmarti1424/sc-im) is a program to view and edit tables especially in csv-format.
## Setup
### Arch-Linux
- `yay -S sc-im` - Install sc-im
- `sc-im <insert-filename>.csv` - Edit files
Sc-im can be installed via [github](https://github.com/andmarti1424/sc-im).
Some distributions also feature the `sc-im` package.
## Usage
@@ -18,7 +16,7 @@ You can delete (multiple (for example `3`) rows `dr`/`d3r`, yank rows `yr`/`y3r`
You can delete (multiple (for example `3`) columns `dc`/`d3c`, yank rows `yc`/`y3c`.
You can insert new rows `ir`/`i3r` or columns `ic`/`i3c`.
### Special numbers
### Calculations and Functions
There are some functions you can use when in numbers mode.

41
wiki/linux/shell.md Normal file
View File

@@ -0,0 +1,41 @@
# Shell
A shell is a command-line interpreter that provides a command-line interface to
interact with the many unix-like system.
## Change the standard shell
The Shell in some distributions is made up by a POSIX compliant mode of bash.
Problem with that is the speed.
A shell like dash would be much faster.
This is a guide on how to persistently change the symlink /bin/sh from bash to
dash.
- `yay -S dash` - Install dash
- `sudo ln -sfT /bin/dash /bin/sh` - link /bin/sh to dash
- `sudo vim /usr/share/libalpm/hooks/bash-update.hook` - setup a hook to avoid
bash resetting the symlink
## Disown a Command
This section is based on a guide by
[baeldung](https://www.baeldung.com/linux/detach-process-from-terminal).
Disowning a command removes it from the current shell.
Commands that are detached from a shell will not terminate upon its closure.
A command can be disowned simply by appending `& disown` at the end of it.
It will then provide the PID of the command that got disowned.
## Silencing a Command
This section is based on a guide by
[baeldung](https://www.baeldung.com/linux/silencing-bash-output).
If the output of a command is unwanted it can be silenced.
There are two parts that can be silenced independently.
Non-error outputs (stdout) can be silenced by appending `1> /dev/null` to the
command.
Due to the `1` being ommitable `> /dev/null` has the same effect.
Error outputs (stderr) can be silenced by appending `2> /dev/null`.
The complete output of both stderr and stdout can be silenced by appending
`> /dev/null 2>&1` to the command.
A shortened version of it not possible on all shells is `&> /dev/null`.

View File

@@ -1,15 +0,0 @@
# Shells
## Change /bin/sh
### Arch-Linux
The Shell in Arch-Linux is made up by a POSIX compliant mode of bash.
Problem with that is the speed.
A shell like dash would be much faster.
This is a guide on how to persistently change the symlink /bin/sh from bash to dash.
- `yay -S dash` - Install dash
- `sudo ln -sfT /bin/dash /bin/sh` - link /bin/sh to dash
- `sudo vim /usr/share/libalpm/hooks/bash-update.hook` - setup a hook to avoid
bash resetting the symlink

View File

@@ -3,23 +3,35 @@
SSH is a network protocoll to securely connect to a computer.
In this article it is assumed that `openssh` is used.
## Generate new keys
## Usage
### Generate new keys
To generate new ssh keys simply run `ssh-keygen -t ed25519` or
`ssh-keygen -t rsa -b 4096`.
## Enable root login via SSH
### Enable root login via SSH
Edit the `/etc/ssh/sshd_config` and change the line containing `PermitRootLogin`
to `PermitRootLogin yes`.
## Add login via SSH public key
### Add login via SSH public key
To enable easy login without password you can add the contents of the file
`~/.ssh/id_rsa.pub` from your local machine to the file `~/.ssh/authorized_keys`
on the machine you want to log into.
You can use the modified command below for ease of use:
```shell
```sh
cat ~/.ssh/id_rsa.pub | ssh username@server 'cat >> ~/.ssh/authorized_keys'
```
### Mount directory with sshfs
To mount a directory (in this case called `directory`) from a remote server
(in this case called `server` also can be substituted by something like
`user@server-ip`) on a local mount (in this case `mountpoint`) run:
```sh
sshfs server:/directory mountpoint
```

View File

@@ -3,7 +3,15 @@
Suckless is a community that is best known for minimalist free software.
Notable works include `dwm` and `dmenu`.
## Workflow for installation
## Programs
- dmenu is a menu with prgram launcher functionality
- dwm is a window manager
- ii is an IRC client
- slock is a screen locker
- st is a terminal
## Setup
Programs written by the suckless community are minimal by default.
`.diff` files are available to patch functionality.
@@ -32,10 +40,15 @@ new `feature`
- Get the `config.def.h` of `master` into `config` with
`git checkout master config.def.h`
## Programs
- dmenu is a menu with prgram launcher functionality
- dwm is a window manager
- ii is an IRC client
- slock is a screen locker
- st is a terminal
## Troubleshooting
### suckless program crashes or struggles with colored emojis
Suckless programs especially `st` and `dmenu` can not display colored
emojis.
This is because of problems with libxft.
libxft is the client side font rendering library to display anti-aliased text.
To change this [libxft-bgra](https://github.com/uditkarode/libxft-bgra) needs
to be installed.
This is a patched version especially for running with the suckless programs.

53
wiki/linux/systemd.md Normal file
View File

@@ -0,0 +1,53 @@
# SystemD
SystemD is an [init system](./init.md) for Linux systems.
It is used for service configuration and startup.
## Usage
### Run Command on Boot
To run a command (in this case `/bin/bash /root/run.sh`) create the following
file at `/etc/systemd/system/` with a name ending on `.service`.
In this case it is called `unturned.service`.
```txt
[Unit]
Description=Description of the service
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/bin/bash /root/run.sh
Type=simple
```
For [Proxmox](./proxmox.md) you can add the following line under the `[Unit]`
section to make sure the service is started after Proxmox has finished
initializing.
```txt
After=pve-guests.service
```
Such a service can be started by running:
```sh
sudo systemctl start unturned
```
Alternatively it can be enabled to start at every boot by running:
```sh
sudo systemctl enable unturned
```
## Start/Stop/Enable/Disable a service
Services can be started by running `systemctl start <service-name>`.
They respectively can be stopped by replacing the `start`
keyword for `stop`.
To start the service after boot it has to be enabled.
This works accordingly with the keyword `enable`.
The `disable` keyword stops the service from starting automatically.

32
wiki/linux/tlp.md Normal file
View File

@@ -0,0 +1,32 @@
# TLP
[TLP](https://linrunner.de/tlp) is a linux command line utility for saving
laptop battery power aswell as optimizing battery life.
## Setup
TLP can be installed on most distributions by installing the `tlp` package.
Afterwards the TLP
[service](/wiki/linux/systemd.md#startstopenabledisable-a-service) needs to be
started and enabled.
In contrast to other
[SystemD services](/wiki/linux/systemd.md#startstopenabledisable-a-service) this
can be done by running `sudo tlp start`.
## Configure Battery Charge Thresholds
There are two battery charge thresholds.
The first is `START_CHARGE_THRESH` this threshold contains the battery charge
level below which charging will begin.
`STOP_CHARGE_TRESH` is the second threshold.
It describes up to which level the battery will be charged.
Battery charge thresholds are used to limit the charging of the battery to
extend the battery life.
Thresholds can be set in the file `/etc/tlp.conf`.
Search and edit the following lines according to your needs.
```txt
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80
```

View File

@@ -1,25 +1,25 @@
# Todoman
`todoman` is a todolist you can use in your terminal.
[todoman](https://github.com/pimutils/todoman) is a todolist you can use in your terminal.
You can sync it using [vdirsyncer](vdirsyncer.md)
## Setup
### Arch-Linux
- `pacman -S todoman` - Install needed packages
Todoman can be installed via the
[github page](https://github.com/pimutils/todoman).
Some distributions also feature the `todoman` package.
### Configuration
- Edit the `~/.config/todoman/todoman.conf`
- Edit the `~/.config/todoman/config.py`
- Insert the following lines
```txt
[main]
path = ~/.local/share/pim/calendars/*/*
date_format = %d.%m.%Y
time_format = %H:%M
default_list = personal
#[main]
path = "~/.local/share/pim/calendars/*/*"
date_format = "%d.%m.%Y"
time_format = "%H:%M"
default_list = "personal"
```
Replace `personal` with your choice of primary list and

View File

@@ -3,7 +3,9 @@
[UFW (Uncomplicated Firewall)](https://code.launchpad.net/ufw) is a program to
manage a netfilter firewall.
## Block specific IPs
## Usage
### Block specific IPs
To block the whole traffic from a specific IP to your computer run:
`ufw deny from <ip> to any`
@@ -12,7 +14,7 @@ was blocked.
If you don't care if the target knows you can also run:
`sudo ufw reject from <ip> to any`
## List all rules
### List all rules
To show all rules you can run:
`ufw status`
@@ -20,7 +22,7 @@ or:
`ufw status numbered`
if you want to have a list of all rules with according numbers.
## Remove rules
### Remove rules
Locate the rule you want to remove by showing all rules (numbered).
Then run:

57
wiki/linux/v4l2.md Normal file
View File

@@ -0,0 +1,57 @@
# V4L2
V4L2 is the second version of
[Video4Linux](https://www.linuxtv.org/wiki/index.php/Main_Page).
It functions as a driver for webcams and tv tuner cards and other devices.
## v4l2loopback
The following section is based on a
[gist by ioquatix](https://gist.github.com/ioquatix/18720c80a7f7eb997c19eef8afd6901e).
[v4l2loopback](https://github.com/umlaeute/v4l2loopback) is a utility to create
a virtual video device.
One use of it is in [OBS Virtual Camera](/wiki/obs.md#virtual-camera).
To use v4l2loopback an according
package needs to be installed.
Some distributions have a package named `v4l2loopback-dkms` in the package
manager, making the manual installation process unnecessary.
Afterwards v4l2loopback can be manually started by running:
```sh
modprobe v4l2loopback card_label='V4L2 Loopback' video_nr=7 exclusive_caps=1
```
`video_nr=7` states the device path to use with v4l2loopback - in this case
`/dev/video7`.
This can be changed according to the needs.
It is important that the device is not already in use by another application.
For an automatic start at boot via [SystemD](./systemd.md) a service can be
created - as described in [the SystemD entry](./systemd.md#run-command-on-boot).
For v4l2loopback create the file `/etc/systemd/system/v4l2loopback.service`
containing the following lines:
```txt
[Unit]
Description=V4L2 Loopback
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/bin/modprobe v4l2loopback card_label='V4L2 Loopback' video_nr=7 exclusive_caps=1
ExecStop=/bin/rmmod v4l2loopback
[Install]
WantedBy=default.target
```
Note the line starting with `ExecStart=/bin/` is the same line described above
to change the device path.
Make sure to change it if needed.
Afterwards enable the service to start at every boot process by running:
```sh
sudo systemctl enable v4l2loopback
```

View File

@@ -1,13 +1,13 @@
# Vdirsyncer
`vdirsyncer` can sync calendars and contacts using the caldav and carddav
protocol.
[Vdirsyncer](https://github.com/pimutils/vdirsyncer) can sync calendars and
contacts using the caldav and carddav protocol.
## Setup
### Arch-Linux
- `pacman -S vdirsyncer` - Install needed packages
Vdirsyncer can be installed via the
[github page](https://github.com/pimutils/vdirsyncer).
Some distributions also feature the `vdirsyncer` package.
### Configuration

View File

@@ -2,7 +2,15 @@
[ViFM](https://vifm.info) is a file manager focussed on vim like usage.
## Image Previews with Ueberzug
## Setup
ViFM can be installed via the
[github page](https://github.com/vifm/vifm).
Some distributions also feature the `vifm` package.
### Configuration
#### Image Previews with Ueberzug
This section is based on a
[video by Distrotube](https://www.youtube.com/watch?v=qgxsduCO1pE).

View File

@@ -1,7 +1,8 @@
# C in Vim
C is a common programming language.
In this entry we will focus on making vim support c and use vim as an ide for c.
In this article we will focus on making vim support c and use vim as an ide for
c.
## Autocompletion

View File

@@ -1,8 +1,10 @@
# GoLang in Vim
GoLang is a common programming language.
In this entry we will focus on making vim support Go and use vim as an ide for it.
This guide is based on a guide from [octetz.com](https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/).
In this article we will focus on making vim support Go and use vim as an ide
for it.
This guide is based on a guide from
[octetz.com](https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/).
## Build, Test, Run, Docs, Debug, Format

View File

@@ -1,8 +1,8 @@
# Python in Vim
Python is a common programming language.
In this entry we will focus on making vim support python and use vim as an ide
for it.
In this article we will focus on making vim support python and use vim as an
ide for it.
## Autocompletion

View File

@@ -1,7 +1,7 @@
# VHDL in Vim
VHDL is a hardware description language.
In this entry we will focus on making vim support VHDL.
In this article we will focus on making vim support VHDL.
## Linting

20
wiki/linux/webcams.md Normal file
View File

@@ -0,0 +1,20 @@
# Webcams
Webcams are video cameras which are designed to be used with a computer for
streaming, video calls or similar usages.
This section lists and explains software for the handling of webcams under a
Linux operating system.
## Editing Video Stream
The editing of a video stream provided by a webcam can be achieved by using
[OBS](/wiki/obs.md) together with the
[OBS Virtual Camera plugin](/wiki/obs.md#virtual-camera).
## Configure the Webcam
A webcam can be configured with [guvcview](https://guvcview.sourceforge.net/).
This program provides a simple interface for capturing and viewing video from a
[v4l2](./v4l2.md) device and is thus dependent on v4l2.
Additionally guvcview provides an interface to configure various webcam settins
and enable a few effects on top of it.

View File

@@ -1,24 +1,29 @@
# Wine
# WINE
Wine is a compatibility layer to run windows programs on linux machines.
[WINE](https://www.winehq.org/) is a compatibility layer to run windows
programs on Linux machines.
## Setup
- Enable multilib support in pacman
- `vim /etc/pacman.conf` - Uncomment the following lines
WINE can be installed on most distributions by acquiring the `wine` package.
The `winetricks` package also is recommended.
Alternatively it can be downloaded from
[the official website](https://www.winehq.org/).
```txt
[multilib]
Include = /etc/pacman.d/mirrorlist
```
## Usage
- `pacman -S wine winetricks` - Install wine and configuration helper
## Configuration
### Run a windows program
- Set the global variable `WINEPREFIX` to your liking, standard is `$HOME/.wine`
- `winetricks` - run the installation of basic windows dependencies to the wine directory
- `winetricks` - run the installation of basic windows dependencies to the wine
directory
- Move the program you want to run to `$WINEPREFIX/drive_c/`
- `winetricks sandbox` - (Optional) if you don't want wine to set up directories
- `winetricks sandbox` - (Optional) if you don't want WINE to set up directories
or files into your home directory
- `wine $WINEPREFIX/drive_c/<insert program>` - Run the program with wine
- `wine $WINEPREFIX/drive_c/<insert program>` - Run the program with WINE
### Games and management/configuration of them
WINE is able to run many Windows games.
An easy way to create WINE prefixes for different games and managing the
installations of them is [Lutris](/wiki/games/lutris.md).

View File

@@ -4,7 +4,9 @@
It is especially interesting due to its WPA2 and WPA3 capabilities in contrast
to other networking software.
## Connect to a WPA2 secured WLAN
## Usage
### Connect to a WPA2 secured WLAN
This part assumes that your network interface is called `wlan0`
(change it accordingly).

View File

@@ -1,37 +0,0 @@
# X11
## Change Keyboardlayout
To temporarily change the layout of the keyboard just run
`setxkbmap <your preferred layout>`.
For a permanent change run `localectl set-x11-keymap <your preferred layout>`.
## Screen Tearing
### Intel Graphics
Linux can sometimes have problems with screen tearing.
To get this working you need to change the `/etc/X11/xorg.conf.d/20-intel.conf` to:
```txt
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
```
This was found on
[maketecheasier](https://www.maketecheasier.com/get-rid-screen-tearing-linux).
## Disable Screen Blanking
To save power the screen is set to turn black after a given amount of time.
This can be disabled temporarily by running `xset s off` or permanently by
adding the following lines to your `/etc/X11/xorg.conf`:
```txt
Section "ServerFlags"
Option "BlankTime" "0"
EndSection
```

View File

@@ -0,0 +1,86 @@
# X Window System
X Window System - also called X and X11 according to the current version - is a
protocoll for handling the display of the most unix-like operating systems.
[Xorg](https://www.x.org/wiki/) is the most used implementation of the X
protocoll.
It is maintained by the [X.Org Foundation](https://x.org/wiki/).
## Peripheral Devices
X also handles various options of peripheral devices.
In the files of the directory `/etc/X11/xorg.conf.d` and the file
`/etc/X11/xorg.conf` these settings can be found.
The handling of input devices is achieved by xinput.
For this the identifier of the device to show the options of is needed.
By running `xinput list` a list of all devices with identifiers handled by
xinput is printed.
Properties and options of a peripheral device can then be shown by running
`xinput list-props <id>` where `<id>` is the identifier of the
device.
### Keyboard
This section describes the handling of keyboards by X.
#### Change Keyboardlayout
To temporarily change the layout of the keyboard just run
`setxkbmap <your preferred layout>`.
For a permanent change run `localectl set-x11-keymap <your preferred layout>`.
### Display
This section describes the handling of displays by X.
Additionally to the guides in this section that are independent of the used
graphics unit special configuration for [Nvidia](/wiki/linux/nvidia.md)
and [Intel](./intel.md) can be found in their respective entries in this wiki.
#### Screen Blanking
To save power the screen is set to turn black after a given amount of time.
This can be disabled temporarily by running `xset s off` or permanently by
adding the following lines to your `/etc/X11/xorg.conf`:
```txt
Section "ServerFlags"
Option "BlankTime" "0"
EndSection
```
### Mouse
This section describes the handling of mouse by X.
#### Emulation of the Middle Mouse Button
If middle mouse button emulation is enabled the system will emulate a middle
mouse button click when clicking both left and right mouse button
simultaneously.
The middle mouse button emulation can be activated or deactivated.
First the current options have to be confirmed as explained in
[the peripheral section](#peripheral-devices).
Important is the property named `libinput Middle Emulation Enabled`.
To enable the usage of the middle mouse button it should be set to `1`.
As written by
[opinion_no9](https://askubuntu.com/questions/160164/how-do-i-enable-middle-mouse-button-emulation-in-12-04-lts/902976#902976)
there are two ways to change this property.
If the change is only needed temporarily
`xinput set-prop <id> "libinput Middle Emulation Enabled" <flag>` can be run.
`<id>` is the identifier of the mouse and <flag> is `0` for disabling and `1`
for enabling the middle mouse button.
For permanent change of the property a change or addition to
`/etc/X11/xorg.conf.d/40-libinput.conf` can be made.
If a section for the device is already present the line
`Option "MiddleEmulation" "true"` should be added to it.
Otherwise a catchall section for all types of mouses can be created like the
following:
```txt
Section "InputClass"
Identifier "middle button emulation class"
MatchIsPointer "on"
Option "MiddleEmulation" "true"
EndSection
```