0% found this document useful (0 votes)
29 views48 pages

Terminal Fedora x21

The document provides a comprehensive guide to using the Fedora terminal, covering basic commands for file management, user permissions, system cleaning, package management, network configuration, and multimedia installation. It includes specific command syntax for tasks such as creating directories, managing users, installing software packages, and performing system maintenance. Additionally, it offers instructions for using tools like BleachBit, Wireshark, and Snapstore, along with tips for encryption and network monitoring.

Uploaded by

prototype199191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views48 pages

Terminal Fedora x21

The document provides a comprehensive guide to using the Fedora terminal, covering basic commands for file management, user permissions, system cleaning, package management, network configuration, and multimedia installation. It includes specific command syntax for tasks such as creating directories, managing users, installing software packages, and performing system maintenance. Additionally, it offers instructions for using tools like BleachBit, Wireshark, and Snapstore, along with tips for encryption and network monitoring.

Uploaded by

prototype199191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Terminal Fedora

Basics User Bleach Bit Clean Repository

Encryption/
Network Monitor Permissions Generic
Decryption
Compression/
Date/Time Speed Test SELinux Multimedia
Extraction

Snapstore Ejection Color Profile Efibootmgr Multipart Archive

Fedora WS GPG
HRV Python VeraCrypt
Check
Basics
Back

query current dir


{ pwd }

go to dir
{ cd "name" }

query files and folders in current dir


{ ls }

query all files and folders in current dir


{ ls -a }

create new folder in current dir


{ mkdir "name" }

remove a folder in current dir


{ rm -r "name" }

read the manual of a command


{ man "command name" }

create new file


{ touch "name" }

open new file in editor


{ nano "filename" }

read contents of file


{ cat "filename" }
copy file from one loc to another
{ cp "filename" path }

locate a file
{ locate "filename" }

get quick info on command


{ whatis "commandname" }

search system files using wildcards


{ sudo find / -name '*filename*' }

remove system files


{ sudo rm -rf /path/to/file }

find all running processes


{ top }

kill a running process


{ kill "PID" }

for a history of commands typed


{ history }

to clear command history


{ history -c }

to clear terminal screen


{ clear }

shutdown after in minutes


{ shutdown "number" }
cancel scheduled shutdown
{ shutdown -c }

reboot now
{ shutdown -r now }
User
Back

gain access to superuser via a root shell


{ sudo -i }

to exit root shell


{ exit }

add new user


{ useradd "username" }

add password
{ passwd "username" }

switch user
{ su "username" }

check active sessions for all users


{ who } {w}

find active processes for a username


{ ps -u username }

delete a user account


{ sudo userdel -r username }

manually delete folder


{ sudo rm -r /home/username(path) }
Bleachbit
Back
interface

System > Rotated Logs, Cache, Temporary Files, Trash

Thumbnails > Cache

Dnf > Clean All

prefs,whitelist folders

/etc
/var/lib
/boot
/lib
/lib64
/usr/lib
/usr/lib64
/bin
/sbin
/usr/bin
/usr/sbin
/proc
/sys
/dev
/etc/yum.repos.d
/var/tmp/dnf-zxy-w4mxs6lr
/home/zxy/Repozit
Clean
Back

remove unused packages


{ sudo dnf autoremove }

clear cache
{ sudo dnf clean all }

restrict journald/ctl logs to


{ sudo journalctl --vacuum-time=2weeks }

restrict logging size to


{ sudo journalctl --vacuum-size=150M }
Repository
Back

check flatpack version


{ flatpak --version }

install packages
{ sudo dnf install <package-name> }

search packages
{ sudo dnf search <package-name> }

package updates
{ sudo dnf update }

package upgrades
{ sudo dnf upgrade }

checking installed repositories


{ sudo dnf repolist }

checking installed packages


{ sudo dnf list }

piping the output through grep to search for packages with names
containing "rpmfusion/'name'"
{ sudo dnf list | grep rpmfusion }

dnf wildcard search


{ sudo dnf search <keyword>* }

verifying flathub activation


{ flatpak remotes }
checking installed flatpaks
{ flatpak list }

flatpak help
{ flatpak --help }

installing applications from flathub


{ flatpak install flathub <app id "com.adobe.Reader"> }

flatpak to launch apps


{ flatpak run com.adobe.Reader"app id" }

finding the app id


{ flatpak search <package-name> }

removing rpm fusion apps


{ sudo dnf remove <package_name> }

removing flatpak apps


{ flatpak uninstall com.adobe.Reader }

listing installed packages


{ dnf list }

searching within the list


{ dnf list | grep <application_name> }

repository location .repo


{ /etc/yum.repos.d }

dnf cache dir


{ /var/tmp/dnf-zxy-w4mxs6lr }
system cache dir
{ /var/cache/dnf }

additional dnf.conf options


{ sudo nano /etc/dnf/dnf.conf }

max_parallel_downloads=20
defaultyes=True

rpm fusion configuration site


https://rpmfusion.org/Configuration

enable access to both the free and the nonfree rpm repository

fedora with dnf:


{ sudo dnf install
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$
(rpm -E %fedora).noarch.rpm
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-
release-$(rpm -E %fedora).noarch.rpm }

openh264 library
{ sudo dnf config-manager setopt fedora-cisco-openh264.enabled=1 }

tainted free-repos
{ sudo dnf install rpmfusion-free-release-tainted }

{ sudo dnf install libdvdcss }

tainted nonfree-repos
{ sudo dnf install rpmfusion-nonfree-release-tainted }
flatpak repo
{ flatpak remote-add --if-not-exists flathub
https://dl.flathub.org/repo/flathub.flatpakrepo }

Network
Back

get the hostname


{ hostname }

edit hostname in rootshell


{ nano /etc/hostname } (ctrl o, ctrl x)

color username,hostname$, bashrc


-open the ~/.bashrc file
{ nano ~/.bashrc }

# color of username@hostname

export PS1="\[\e[0;30m\]\u@\h:\W\$ \[\e[0m\]"

-apply changes after terminal restart


{ source ~/.bashrc }

display information about network interfaces


{ ifconfig }

check for active internet through interfaces eno1,lo and wlp0s26u1u3


in rootshell
{ ping -I wlp0s26u1u4 google.com }

{ ping -I enp0s25 google.com }

disable connections to a network interface


{ ifconfig wlp0s26u1u4 down }

{ ifconfig enp0s25 down }

enable connections to a network interface


{ ifconfig wlp0s26u1u4 up }

{ ifconfig enp0s25 up }

change ip for the interface


{ ifconfig wlp0s26u1u4 192.168.1.18(new ip) }
{ ifconfig enp0s25 192.168.1.18 }

restart the network connection


{ systemctl restart NetworkManager }

hostname for the running network interface


{ hostname -i }

Monitor
Back

install wireshark
{ sudo dnf install wireshark }

run wireshark as root


{ sudo wireshark }

display information about wireless network interfaces


{ sudo iw dev }

installing aircrack
{ sudo dnf install aircrack-ng }

check the interface of the WiFi


{ sudo airmon-ng }

check the interfering processes


{ sudo airmon-ng check }

kill these processes


{ sudo airmon-ng check kill }

put the interface into monitor mode


{ sudo airmon-ng start wlp0s26u1u4 }

return to the original interface


{ sudo airmon-ng stop wlp0s26u1u4mon }

restart the network connection


{ systemctl restart NetworkManager }

output to only show lines related to network controllers


{ lspci | grep -i network }

details about the various network adapters or connections available


on your machine
{ ip link show }

check for active connection


{ ping google.com }
information about the NetworkManager service
{ systemctl status NetworkManager }

information about all Wi-Fi network interfaces (adapters) detected on


your system and displays a
{ nmcli device wifi list }

tools
{ sudo wavemon } { sudo nmon }

Permissions
Back

navigate terminal to linux folder


{ cd "foldername" }

navigate terminal to win folder right click - open in terminal list all
permissions for folders and files in current dir
{ ls -l }
permissions syntax rwxrwxrwx - rwx(user-u)rwx(group-g)rwx(other-o)
change all permissions to rwx
{ chmod ugo+rwx filename(ext)/foldername }

change all permissions to null


{ chmod ugo-rwx filename(ext)/foldername }

change permissions for individual sections


{ chmod u/g/o+/- r/w/x filename(ext)/foldername }

open file
{ ./filename }

give permissions to all sec


{ chmod +x/r/w filename(ext)/foldername }

Encryption
Back

encrypt using gpg in rootshell


{ gpg -c /path/filename(ext) } +
passphrase test encryption
{ nano filename(ext) }

decrypt using gpg


{ gpg -d filename(ext) } + passphrase
Generic
Back

search for word in a file


{ grep "searchterm" "filename(ext)" }

list the number of matches


{ grep "searchterm" "filename(ext)" -c }

last few lines of a file


{ tail -n 3(number)filename(ext) }

| - Pipe for concatenation

search within a command's data


{ ifconfig(cmd name) | grep "searchterm" }

adding command output to a file


{ ifconfig(cmd name) > "filename(ext)/path }

adding search output to a file


{ ifconfig(cmd name) | grep "searchterm" > "filename(ext)/path }

kernel version
{ uname -r }

Extract/Compress
Back

compress file(s)
{ tar czvf sampl.tar.gz samplet.txt (filename {/path} ) filename
filename... }

extract from archive


{ tar xzvf sampl.tar.gz(filename {/path} ) }
extract to folder/path
{ tar xzvf sampl.tar.gz -C /home/zxy }

Time and Date


Back

synchronizing the system clock with a remote server using ntp, enable
{ sudo timedatectl set-ntp true }

enable automatic synchronization of the system clock with a remote


server
{ sudo timedatectl set-ntp yes }
verify the status
{ timedatectl status }

set rtc in utc


{ sudo timedatectl set-local-rtc 0 }

revert rtc defaults


{ sudo timedatectl set-local-rtc 1 }

Speed Test
Back

install python
{ sudo dnf install python } { sudo dnf install python3 }

check python version


{ python --version } { python3 --version }

install red hat lsb


{ sudo dnf install redhat-lsb }

check release
{ lsb_release -a }

create dir, go to dir


{ mkdir Spte }

{ cd Spte }

download speedtest_cli.py
{ wget -O speedtest-cli
https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedte
st.py }

grant execution
{ chmod +x speedtest-cli }

go to dir
{ cd /home/zxy/Spte }

check the internet speed


{ ./speedtest-cli } { python speedtest-cli }

check in bytes
{ ./speedtest-cli --bytes }

to generate and provide a url to the speedtest.net share results image


{ ./speedtest-cli --share }

share in bytes
{ ./speedtest-cli --share --bytes }
server lists
{ wget http://www.speedtest.net/speedtest-servers.php }

view a server ID
{ more speedtest-servers.php }

test through the server id


{ ./speedtest-cli --server " id " }

SELinux
Back

check status
{ sestatus } { getenforce }

permissive mode
{ sudo setenforce 0 }

enforcing mode
{ sudo setenforce 1 }

Multimedia
Back
initial variant
{ sudo dnf install gstreamer1-plugins-{bad-\*,good-\*,base}
gstreamer1-plugin-openh264 gstreamer1-libav gstreamer1-plugins-
ugly }

{ sudo dnf install lame\* --exclude=lame-devel }

{ sudo dnf group upgrade --with-optional multimedia }


vaapi
{ sudo dnf install libva libva-intel-driver libva-vdpau-driver libvala
libvarlink libvarlink-util libva-utils gstreamer1-vaapi libva-intel-media-
driver libva-intel-hybrid-driver libvdpau-va-gl }

vdpau
{ sudo dnf install libvdpau libva-vdpau-driver libvdpau-va-gl }

mesa
{ sudo dnf install mesa-va-drivers mesa-vdpau-drivers.x86_64 mesa-
dri-drivers mesa-filesystem mesa-libEGL mesa-libGL mesa-libGLU
mesa-libOSMesa mesa-libOpenCL mesa-libTeflon mesa-omx-drivers
mesa-va-drivers mesa-vdpau-drivers mesa-libglapi mesa-libgbm }

xorg
{ sudo dnf install xorg-x11-drv-ati xorg-x11-drv-evdev xorg-x11-drv-
fbdev xorg-x11-drv-intel xorg-x11-drv-libinput xorg-x11-drv-nvidia-libs
xorg-x11-drv-openchrome xorg-x11-drv-qxl xorg-x11-drv-vesa xorg-
x11-drv-vmware xorg-x11-drv-wacom xorg-x11-drv-synaptics-legacy
xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-drivers xorg-
x11-drv-amdgpu xorg-x11-drv-wacom-serial-support xorg-x11-font-
utils xorg-x11-fonts-ISO8859-1-100dpi xorg-x11-fonts-misc xorg-x11-
server-Xwayland xorg-x11-server-source xorg-x11-server-x2gokdrive
xorg-x11-xauth xorg-x11-xbitmaps xorg-x11-xdm xorg-x11-xinit xorg-
x11-xinit-session }

gstreamer
{ sudo dnf install gstreamer1-vaapi gstreamer1-plugin-libav
gstreamer1-plugin-gif PackageKit-gstreamer-plugin gstreamer-plugin-
crystalhd gstreamer1 gstreamer1-rtsp-server gstreamer1-svt-vp9
gstreamer1-svt-av1 gstreamermm perl-GStreamer1 phonon-qt5-
backend-gstreamer pipewire-gstreamer python3-gstreamer1
rubygem-gstreamer mingw32-gstreamer1 gnome-video-effects
pocketsphinx-plugin }

intel
{ sudo dnf install intel-compute-runtime intel-gmmlib intel-gpu-
firmware intel-igc intel-igc-libs intel-lpmd intel-mediasdk intel-opencl
intel-vpl-gpu-rt libva-intel-hybrid-driver intel-media-driver libva-intel-
media-driver oneVPL-intel-gpu libigfxcmrt libvpl libvpl-tools nvtop }

codecs
{ sudo dnf install libavcodec-free libavcodec-freeworld pipewire-
codec-aptx xpra-codecs-freeworld xmms2-avcodec opencv-imgcodecs
python3-numcodecs alsa-plugins-a52 alsa-plugins-lavrate baresip-vp9
daala-libs daala-tools flac-libs libtheora libvorbis libvpx mingw64-
wavpack mozilla-openh264 openh264 openjpeg-libs schroedinger vlc-
plugin-gstreamer vlc-plugins-freeworld xvidcore }

drm
{ sudo dnf install libdrm libdrm-armada drm-utils igt-gpu-tools }
{ sudo dnf install libplacebo }

appstream metadata
{ sudo dnf update @core }

{ sudo dnf group install multimedia }

{ sudo dnf group install sound-and-video }

{ sudo dnf update @sound-and-video }

{ sudo dnf update @multimedia }


{ sudo dnf group list --hidden }

check group permissions for current user


{ groups }

assign group permissions for current user and reboot


{ sudo usermod -aG
cdrom,mail,dialout,games,video,lock,audio,input,render,usbmon,wire
shark,power,flatpak,colord,pipewire zxy }

ffmpeg
{ sudo dnf install ffmpeg }

{ sudo dnf install ffmpeg-free --allowerasing }

convert mp4 to aac


{ cd foldername }

{ ffmpeg -i name.mp4 -vn -acodec copy name.aac }


convert aac to opus(at default bitrate)
{ ffmpeg -i name.aac -acodec libopus name.opus }
Snapstore/Snapd
Back

install snapstore, enable snapd


{ sudo dnf install snapd }

reboot & check for snap’s path in the env var PATH
{ echo $PATH }
check for /var/lib/snapd/snap/bin

enable classic snap support to create a symbolic link between


/var/lib/snapd/snap and /snap: and reboot
{ sudo ln -s /var/lib/snapd/snap /snap }
install snap store
{ sudo snap install snap-store }

install mpv-wayland
{ sudo snap install “package-name” }

check for updates


{ snap refresh list } { snap refresh }

check for snap package updates


{ snap refresh “package-name” }

check package information


{ snap info “package-name” }

Eject Devices
Back

check for block devices


{ lsblk }

unmount a device
{ sudo umount /dev/sdb1 } (partition of mounted sdb disk)

eject unmounted device


{ sudo eject /dev/sdb } (partition unmounts/ force unmounts)

power off ejected device


{ sudo udisksctl power-off -b /dev/sdb }

Color Profile
Back

query the RPM database that match colord


{ rpm -qa colord }

default location of the icc profile


{ cd /home/zxy/.local/share/icc }

reads files sequentially, displaying their content to the terminal,


querying the colord icc dir
{ cat /var/lib/colord/icc/ }
applying the profile:

transfer the profile


{ sudo cp /home/zxy/.local/share/icc/edid-
da4cb303bc7c842a7c5e1fb8cbfb7b08.icc /var/lib/colord/icc/ }

if not automatically loaded

open gnome settings -> color


select monitor
add profile
locate and select the icc profile from the path where it is stored
{ ~/.local/share/icc/ } or { /var/lib/colord/icc/ }
set for all users or copy into the /var/lib/colord/icc/ and install

Efibootmgr
Back

uefi boot menu entries,bootorder


{ man efibootmgr }

Example Configuration
[root@localhost ~]# efibootmgr
BootCurrent: 0004
BootNext: 0003
BootOrder: 0004,0000,0001,0002,0003
Timeout: 30 seconds
Boot0000* Diskette Drive(device:0)
Boot0001* CD-ROM Drive(device:FF)
Boot0002* Hard Drive(Device:80)/HD(Part1,Sig00112233)
Boot0003* PXE Boot: MAC(00D0B7C15D91)
Boot0004* Linux

Deleting a boot option:


Assuming the configuration in the example efibootmgr -b 4 -B could
be called to delete entry 4 and remove it from the BootOrder.

Changing the boot order:


Assuming the configuration in the example, efibootmgr -o 3,4
could be called to specify PXE boot first, then Linux boot.

Changing the boot order for the next boot only:


Assuming the configuration in the first example, efibootmgr -n 4
could be called to specify that the Linux entry be taken on next boot.

case of double entry,for config


{ sudo efibootmgr }
BootNext: 0000
Timeout: 1 seconds
BootOrder: 0002,0000,0008,0001,0003
Boot0000* Fedora HD(1,GPT,c70d52b0-0116-4fcf-8ee8-
129cc0852994,0x800,0x12c000)/\EFI\fedora\shimx64.efi
Boot0001* Hard Drive BBS(HD,,0x0)
Boot0002* Fedora HD(1,GPT,c70d52b0-0116-4fcf-8ee8-
129cc0852994,0x800,0x12c000)/\EFI\FEDORA\shimx64.efi
Boot0003* Network Card BBS(Network,,0x0)
Boot0008* UEFI: ST1000DM010-2EP102
PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,65535,0)/HD(1,GPT,c70d52b0-0116-
4fcf-8ee8-129cc0852994,0x800,0x12c000)/\EFI\BOOT\BOOTX64.EFI

nav to EFI\fedora\shimx64.efi | EFI\FEDORA\shimx64.efi


{ sudo nautilus } nav to /boot/efi/EFI
{ ~# cd /boot/efi/EFI }

to del EFI\FEDORA\shimx64.efi boot entry

delete a boot entry


{ ~# efibootmgr -b 2 -B }
where -b selects boot num, and -B deletes it

change a boot order fully


{ ~# efibootmgr -o 0000,0008,0001,0003,0002 }
where -o sets it consecutively

optionally, changing boot next


{ ~# efibootmgr -n 0008 }
where -n sets it until next boot before reverting to prev order

Multipart Archive
Back

combine files, an image and an archive, changing extension


{ cat imgname.jpg archname.7z > endname.png }
where cat concatenates and displays, and > functions as a redirection
operator combining them to work as a multipart archive file. The orig
extensions are held in binary modules where one part functions as an
image and the other an archive displaying the image while masking
the content of the archive.

.7z
{ sudo dnf install p7zip p7zip-plugins p7zip-gui }
extract a multipart image extension archive with a .7z
{ 7z x endname.png }

extract a multipart image extension archive with a .zip


{ unzip endname.png }

HRV Python
Back

pip3 to install other Python packages


{ sudo dnf install python3-pip }

python packages for hrv based graphs


{ pip3 install numpy matplotlib }

install the SciPy library


{ sudo dnf install python3-scipy }

list of applicable color maps


Perceptually Uniform Sequential

viridis, plasma, inferno, magma, cividis

Sequential

Greys, Purples, Blues, Greens, Oranges, Reds,YlOrBr, YlOrRd, OrRd, PuRd, RdPu,
BuPu, GnBu, PuBu, YlGnBu, PuBuGn, BuGn, YlGn

Sequential 2

binary, gist_yarg, gist_gray, gray, bone, pink, spring, summer, autumn, winter,
cool, Wistia, hot, afmhot, gist_heat, copper,

Diverging

PiYG, PRGn, BrBG, PuOr, RdGy, RdBu, RdYlBu, RdYlGn, Spectral, coolwarm, bwr,
seismic

Cyclic

twilight, twilight_shifted, hsv

Qualitative

Pastel1, Pastel2, Paired, Accent,Dark2, Set1, Set2, Set3, tab10, tab20, tab20b,
tab20c

Miscellaneous

flag, prism, ocean, gist_earth, terrain, gist_stern, gnuplot, gnuplot2, CMRmap,


cubehelix, brg, gist_rainbow, rainbow, jet, turbo, nipy_spectral, gist_ncar

from within the folder of .py scripts


{ cd Pyhrv }
creates the poincare scatter plot using r-r interval data plotting
standard deviations from the line of identity of the poincare cloud.
Higher x-axis (RR(n)) values correspond to slower heart rate for the current
interval. Higher y-axis (RR(n+1)) values correspond to slower heart rate in the
subsequent interval. Points further away from the origin indicate slower heart
rate values whereas points closer to the origin indicate faster heart rate values.
Typically quadrant two and three on the plot indicate slower and faster rates
respectively on both axes while quadrant one and four exhibit slower heart rates
on the successive and preceding, RR(n+1), and RR(n) intervals respectively. Points
near the line of identity indicate stable HRV as points further from the line of
identity indicate more heart rate variability (either short-term or long-term
depending on the direction). SD1 reflects short-term variability (beat-to-beat
changes). A larger SD1 indicates a greater variation in successive RR intervals
(higher HRV). Points far from the line of identity in the perpendicular direction
suggest more short-term fluctuations. SD2 reflects long-term variability in heart
rate. A larger SD2 indicates more variation in longer-term trends in heart rate
(more long-term HRV). This is often influenced by the balance between
sympathetic and parasympathetic nervous system inputs.
{ sudo nano poincarestdev.py }

{
import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
style.use('ggplot')

def plotPoincareWithEllipse(RRints, SD1, SD2):


"""
Input:
- RRints: List of RR intervals
- SD1: Short-term variability (width of ellipse)
- SD2: Long-term variability (length of ellipse)

Output:
- Poincare plot with SD1, SD2 lines and ellipse showing variability
"""
ax1 = RRints[:-1]
ax2 = RRints[1:]

# Normalize the color values to be between 0 and 1


norm = plt.Normalize(vmin=min(RRints), vmax=max(RRints))
# Create a colormap object
cmap = plt.get_cmap('gist_heat')

# Create scatter plot


scatter = plt.scatter(ax1, ax2, c=RRints[:-1], cmap=cmap, norm=norm, s=27)

# Add a colorbar to show the color mapping


plt.colorbar(scatter, label='Colour Bar: Dark Red-White')

# Line of identity (diagonal line)


min_val = min(min(ax1), min(ax2))
max_val = max(max(ax1), max(ax2))
#plt.plot([min_val, max_val], [min_val, max_val], 'k--', label="Line of Identity")
plt.plot([min_val, max_val], [min_val, max_val], color='#373b4a', linestyle='--',
dashes=(22, 7), label="Line of Identity")

# Ellipse parameters
center_x = np.mean(ax1)
center_y = np.mean(ax2)
angle = np.degrees(np.arctan2(SD1, SD2)) # Angle of rotation of ellipse

# Create the ellipse patch


ellipse = Ellipse((center_x, center_y), width=2*SD2, height=2*SD1, angle=angle,
color='#c7d530', fill=False, linestyle='--', linewidth=0.98596, label='Ellipse')

# Add ellipse to the plot


plt.gca().add_patch(ellipse)

# Plot SD1 and SD2 lines


plt.plot([center_x - SD1, center_x + SD1], [center_y + SD1, center_y - SD1], color=
'#3193cf', lw=3.14, label='SD1')
plt.plot([center_x - SD2, center_x + SD2], [center_y - SD2, center_y + SD2],
color='#F3C122', lw=3.14, label='SD2')
# Add labels
plt.xlabel(r'RR$_n$ (ms)')
plt.ylabel(r'RR$_{n+1}$ (ms)')
plt.legend()
plt.title('Standard Deviations Poincare Plot')
# Add SD1 and SD2 text to the plot (position it above the graph)
plt.text(0.502, 1.088, f'SD1 = {SD1:.2f} ms, SD2 = {SD2:.2f} ms',
horizontalalignment='center', verticalalignment='center',
transform=plt.gca().transAxes, fontsize=10, color='#005189',
fontweight='heavy')

# Add grid
plt.grid(True)

# Show plot
plt.show()

def ellipseFittingMethod(RRints):
"""
Input:
- RRints: List of RR intervals

Output:
- Dictionary with SD1 and SD2 values
"""
SDSD = np.std(np.diff(RRints))
SDRR = np.std(RRints)
SD1 = (1 / np.sqrt(2)) * SDSD
SD2 = np.sqrt((2 * SDRR ** 2) - (0.5 * SDSD ** 2))
return {'SD1': SD1, 'SD2': SD2}

# Swap RR intervals
RR_intervals =
[763,776,772,757,748,746,748,739,743,779,792,786,802,810,806,793,780,768,775,
787,790,735,694,678,713,707,707,723,698,672,673,698,693,646,640,640,647,646,7
43,755,711,677,671,696,706,693,694,692,714,716,697,704,701,711,709,692,669,65
4,653,665,660,648,648,648,644,632,621,620,625,614,620,615,622,643,660,648,655
,655,701,700,684,645,628,631,621,649,896,775,742,722,707,680,670,681,698,663,
655,649,646,639,649,675,680,662,659,668,682,684,683,667,652,685,748,801,780,8
24,822,803,747,738,743,737,733,727,765,772,738,750,787,796,784,747,738,742,72
6,712,714,718,731,725,753,790,784,746,760,750,737,724,719,705,699,688,677,661
,697,739,809,817,832,827,800,759,752,748,743,728,722,769,802,802,813,848,832,
814,812,805,771,734,723,717,701,707,733,843,865,873,848,818,785,718,729,690,6
75,663,665,716,704,719,709,702,677,677,692,707,798,731,694,678,670,676,675,67
5,670,683,760,825,843,859,868,831,793,760,740,713,688,676,659,659,668,680,699
,726,738,730,721,705,697,699,704,690,694,676,675,653,643,636,629,620,611,605,
609,611,615,620,620,639,655,677,686,711,737,945,867,857,857,843,837,827,779,7
63,751,734,725,688,658,643,634,646,648,646,642,659,658,667,669,661,682,726,72
4,754,746]

# Calculate SD1 and SD2


ellipse_results = ellipseFittingMethod(RR_intervals)

# Plot the Poincare plot with SD1 and SD2 lines and ellipse
plotPoincareWithEllipse(RR_intervals, ellipse_results['SD1'], ellipse_results['SD2'])
}

save out (ctrl+o,ctrl+x) , make the script executable


{ sudo chmod ugo+rwx poincarestdev.py }

execute the script


{ python3 poincarestdev.py }

creates the poincare scatter plot using r-r interval data plotting color
coded acceleration and deceleration points printing the C_DOWN and
C_UP parameters for heart rate acceleration and deceleration
respectively.
Acceleration happens when RRn+1 < RRn and deceleration when RRn+1 > Rrn.
The three heart beats that represent a point on the plot has RRn in milliseconds
preceding RRn+1, the two successive intervals that are plotted forward in time.
The greater or lesser value in milliseconds that the successive RRn+1, taken into
account while plotting makes for the decelerating or accelerating heart beat.
Each point whether accelerating or decelerating represents linear time. A group
of points or all points on the plot in general represents non-linear time since
variations in successive points tend to fluctuate more than less. When isolated
clusters are analyzed as groups they tend to revert back to represent linear time
due to linear representation of values on the respective axes.
{ sudo nano poincarehra.py }

}
import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt

style.use('ggplot')

def hraMethod(RRints):
"""
Perform analysis to quantify heart rate asymmetry (HRA).

Input :

- RRints : [list] of RR intervals

Output :

- C_DOWN, C_UP : {dict} with keys 'C_DOWN' (numpy.float64) and


'C_UP' (numpy.float64)
"""
ax1 = np.array(RRints[:-1])
ax2 = np.array(RRints[1:])
SD1I = np.sqrt((1 / len(ax1)) * (np.sum((ax1 - ax2) ** 2) / 2))
ax1ax2 = (ax1 - ax2) / np.sqrt(2)
indices_up = np.where(ax1ax2 > 0)
indices_down = np.where(ax1ax2 < 0)
SD1_UP = np.sqrt(np.sum(ax1ax2[indices_up] ** 2) / len(ax1))
SD1_DOWN = np.sqrt(np.sum(ax1ax2[indices_down] ** 2) / len(ax1))
C_UP = SD1_UP ** 2 / SD1I ** 2 # for decelerations
C_DOWN = SD1_DOWN ** 2 / SD1I ** 2 # for accelerations
return {'C_UP': C_UP, 'C_DOWN': C_DOWN}

def plot_poincare(RRints):
"""
Plot the Poincaré plot with points color-coded for acceleration and
deceleration.

Input :

- RRints : [list] of RR intervals


"""
# Calculate HRA values
hra_values = hraMethod(RRints)
C_UP = hra_values['C_UP']
C_DOWN = hra_values['C_DOWN']

# Convert RR intervals to numpy arrays


ax1 = np.array(RRints[:-1])
ax2 = np.array(RRints[1:])

# Determine acceleration and deceleration points


ax1ax2 = (ax1 - ax2) / np.sqrt(2)
indices_up = np.where(ax1ax2 > 0)
indices_down = np.where(ax1ax2 < 0)

# Count the number of points


num_acceleration = len(indices_up[0])
num_deceleration = len(indices_down[0])

# Multiply by 3 for each point representing 3 beats


adjusted_acceleration = num_acceleration * 3
adjusted_deceleration = num_deceleration * 3
total_beats = adjusted_acceleration + adjusted_deceleration

# Plotting
plt.scatter(ax1[indices_up], ax2[indices_up], color='#df0647',
label='Acceleration', alpha=0.8)
plt.scatter(ax1[indices_down], ax2[indices_down], color='#1e9634',
label='Deceleration', alpha=0.8)

# Add text annotations above the title


plt.title('Heart Rate Asymmetry Poincare Plot')
plt.xlabel(r'RR$_n$ (ms)')
plt.ylabel(r'RR$_{n+1}$ (ms)')
plt.legend()
plt.grid(True)

# Add the annotations above the title


plt.text(0.5, 1.10, f'[ C_UP: {C_UP:.2f} ] [ C_DOWN: {C_DOWN:.2f} ] [ Acceleration
Count: {num_acceleration} ] [ Deceleration Count: {num_deceleration} ]
[ {total_beats} Beats ]',
transform=plt.gca().transAxes, ha='center', va='bottom',
fontsize=8, bbox=dict(facecolor='#a27b8e', alpha=0.0314))

plt.show()

# Swap RR Intervals
RRints =
[763,776,772,757,748,746,748,739,743,779,792,786,802,810,806,793,780,768,775,
787,790,735,694,678,713,707,707,723,698,672,673,698,693,646,640,640,647,646,7
43,755,711,677,671,696,706,693,694,692,714,716,697,704,701,711,709,692,669,65
4,653,665,660,648,648,648,644,632,621,620,625,614,620,615,622,643,660,648,655
,655,701,700,684,645,628,631,621,649,896,775,742,722,707,680,670,681,698,663,
655,649,646,639,649,675,680,662,659,668,682,684,683,667,652,685,748,801,780,8
24,822,803,747,738,743,737,733,727,765,772,738,750,787,796,784,747,738,742,72
6,712,714,718,731,725,753,790,784,746,760,750,737,724,719,705,699,688,677,661
,697,739,809,817,832,827,800,759,752,748,743,728,722,769,802,802,813,848,832,
814,812,805,771,734,723,717,701,707,733,843,865,873,848,818,785,718,729,690,6
75,663,665,716,704,719,709,702,677,677,692,707,798,731,694,678,670,676,675,67
5,670,683,760,825,843,859,868,831,793,760,740,713,688,676,659,659,668]

# HRA with color coded acceleration and deceleration


plot_poincare(RRints)
}

save out (ctrl+o,ctrl+x) , make the script executable


{ sudo chmod ugo+rwx poincarehra.py }

execute the script


{ python3 poincarehra.py }

creates the poincare scatter plot of the interbeat autocorrelation


coefficient r_rr, a unit-free measure between 0 and 1, indicates how
similar consecutive RR intervals are to one another.
A high r_rr indicates that consecutive heartbeats are very similar in duration,
meaning that the time between each heartbeat doesn't vary much from beat to
beat. The heart is beating at a more regular and consistent rate. Strong positive
correlation indicative of high r_rr values mean that when one RR interval is high
(longer in duration), the next one tends to be similarly high, and when one is low
(shorter in duration), the next tends to be similarly low and consistent as against
dramatic fluctuations as seen in low r_rr. A low r_rr value would suggest greater
variability between consecutive RR intervals, meaning the heart rate is fluctuating
more significantly from beat to beat. In terms of heart rate variability (HRV), this
could reflect a more adaptive or reactive state where the heart rate is constantly
adjusting to internal and external stimuli, often indicating good autonomic
flexibility indicative of physical exertion and variability in breathing patterns
therein. Strong positive correlation implied by higher r_rr values mean that most
points on the plot would be close to the diagonal (where x=y). This reflects the
idea that each heartbeat is followed by another heartbeat of nearly the same
duration, leading to a tight cluster of points along the diagonal line. This
clustering reflects consistency in the intervals and suggests that the variability in
heart rate is low. r_rr is not about one specific point on the Poincaré plot, but
rather about the overall trend between pairs of points (consecutive intervals) in
the dataset. A high r_rr indicates that, on average, each interval is highly
correlated with the next one. It measures how linearly related each pair of
intervals is. This is done based on the values as they were recorded, at the time of
recording, reflecting moment-to-moment linearity between successive
heartbeats. The autocorrelation is a pairwise comparison of intervals computing
the mean relationship between each pair of intervals across the entire dataset
depicting how much one RR interval depends on the next. The calculation
compares the difference of each interval from the mean RR interval (mu_rr) and
checking whether these differences move in the same direction for each pair of
successive intervals providing a linear correlation for successive heartbeats,
aggregated into a single coefficient for the entire dataset. Higher density along
the line of identity suggests lower variability. This means that the heart rate is
more stable, with less fluctuation between consecutive intervals. Lower density
indicates higher variability, as the intervals are more spread out, and the heart
rate is less stable. High r_rr values correspond to high density along the line of
identity. This indicates that consecutive intervals are similar and exihibit lower
variability. Low r_rr values indicate greater variability between RR intervals, which
is consistent with lower density in certain areas of the plot. Density calculation
uses Gaussian KDE to determine the density. Autocorrelation mapping generates
a series of autocorrelation values and normalizes them to be used for coloring
the points. Color mapping the scatter plot uses the normalized autocorrelation
values as colors, allowing visual insight into how density relates to
autocorrelation. The mean values of RR intervals in milliseconds of the entire
dataset along with their autocorrelation are displayed at the top of the plot.

{ sudo nano poincareautocorrelation.py }

}
import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
style.use('ggplot')

# Function to calculate the interbeat autocorrelation coefficient


def correlationCoef(RRints):
"""
Computes interbeat autocorrelation coefficient.

Input:
- RRints: [list] of RR intervals

Output:
- r_rr: [numpy.float64] interbeat autocorrelation coefficient
"""
ax1 = RRints[:-1]
ax2 = RRints[1:]
mu_rr = np.mean(RRints)
r_rr = np.mean((ax1 - mu_rr) * (ax2 - mu_rr)) / (np.sqrt(np.mean((ax1 - mu_rr) **
2) * np.mean((ax2 - mu_rr) ** 2)))
return mu_rr, r_rr

# Function to plot the Poincare plot with density and autocorrelation


colormapping
def plot_poincare_density_autocorr(RRints):

# Calculate mu_rr and r_rr


mu_rr, r_rr = correlationCoef(RRints)

# Create the ax1 (x-values) and ax2 (y-values)


ax1 = RRints[:-1]
ax2 = RRints[1:]

# Create a 2D density plot


xy = np.vstack([ax1, ax2])
z = gaussian_kde(xy)(xy)

# Normalize autocorrelation values for coloring


autocorr_values = np.linspace(0.097, 0.97, num=len(z)) # Mapping of autocorr
to color
normalized_autocorr = (autocorr_values - np.min(autocorr_values)) /
(np.max(autocorr_values) - np.min(autocorr_values))

# Create scatter plot with density and autocorrelation color mapping


scatter = plt.scatter(ax1, ax2, c=normalized_autocorr, cmap='plasma', s=27)

# Add a colorbar to indicate the autocorrelation values


cbar = plt.colorbar(scatter, label='Plasma:Normalized Autocorrelation')

# Line of identity (diagonal line)


min_val = min(min(ax1), min(ax2))
max_val = max(max(ax1), max(ax2))

plt.plot([min_val, max_val], [min_val, max_val], color='#373b4a', linestyle='--',


dashes=(22, 7), label="Line of Identity")
# Label axes
plt.xlabel(r'RR$_n$ (ms)')
plt.ylabel(r'RR$_{n+1}$ (ms)')
plt.title('Interbeat Autocorrelation Coefficient Poincare Density Map')
plt.legend()
plt.text(0.5, 1.087, f'[ Mean(RR) mu_rr = {mu_rr:.2f} ms ] [ Interbeat
Autocorrelation r_rr = {r_rr:.2f} ]',
horizontalalignment='center', verticalalignment='center',
transform=plt.gca().transAxes, fontsize=9, color='#005189',
fontweight='heavy')

plt.text(0.51, 1.126, f'[High r_rr = High Density = Lower Variability = Higher


Stability ]',
horizontalalignment='center', verticalalignment='center',
transform=plt.gca().transAxes, fontsize=9, color='#005189',
fontweight='bold')

# Show the plot


plt.grid(True)
plt.show()

# Swap RR intervals
RRints =
[763,776,772,757,748,746,748,739,743,779,792,786,802,810,806,793,780,768,775,
787,790,735,694,678,713,707,707,723,698,672,673,698,693,646,640,640,647,646,7
43,755,711,677,671,696,706,693,694,692,714,716,697,704,701,711,709,692,669,65
4,653,665,660,648,648,648,644,632,621,620,625,614,620,615,622,643,660,648,655
,655,701,700,684,645,628,631,621,649,896,775,742,722,707,680,670,681,698,663,
655,649,646,639,649,675,680,662,659,668,682,684,683,667,652,685,748,801,780,8
24,822,803,747,738,743,737,733,727,765,772,738,750,787,796,784,747,738,742,72
6,712,714,718,731,725,753,790,784,746,760,750,737,724,719,705,699,688,677,661
,697,739,809,817,832,827,800,759,752,748,743,728,722,769,802,802,813,848,832,
814,812,805,771,734,723,717,701,707,733,843,865,873,848,818,785,718,729,690,6
75,663,665,716,704,719,709,702,677,677,692,707,798,731,694,678,670,676,675,67
5,670,683,760,825,843,859,868,831,793,760,740,713,688,676,659,659,668,680,699
,726,738,730,721,705,697,699,704,690,694,676,675,653,643,636,629,620,611,605,
609,611,615,620,620,639,655,677,686,711,737,945,867,857,857,843,837,827,779,7
63,751,734,725,688,658,643,634,646,648,646,642,659,658,667,669,661,682,726,72
4,754,746,771,795,765,771,751,725,707,678,663,655,643,641,644,654,654,662,680
,688,726,738,754,694,676,669,652,633,691,715,691,677,679,689,714,698,692,687,
682,645,642,639,656,665,797,800,810,783,762,756,727,686,676,665,679,681,676,6
65,667,655,643,621,620,614,604,602,595,593,592,601,609,618,622,629,678,714,70
0,737,729,735,690,709,698,676,657,638,615,605,595,595,607,625,634,615,612,607
,611,613,616,647,725,701,680,684,824,865,882,832,766,729,692,675,640,655,642,
646,654,663,668,684,698,690,685,676,676,672,669,681,690,683,681,685,699,693,6
87,693,690,682,680,672,670,665,668,658,648,644,634,631]

# Call the function to plot


plot_poincare_density_autocorr(RRints)
}

save out (ctrl+o,ctrl+x) , make the script executable


{ sudo chmod ugo+rwx poincareautocorrelation.py }

execute the script


{ python3 poincareautocorrelation.py }

Fedora WS GPG Check


Back

Download the checksum file into the same directory as the image you
downloaded and navigate to it.

Import Fedora's GPG key(s)

{ curl -O https://fedoraproject.org/fedora.gpg }

Verify the checksum file is valid

{ gpgv --keyring ./fedora.gpg Fedora-Workstation-41-1.4-x86_64-


CHECKSUM }
Verify the checksum matches

{ sha256sum -c Fedora-Workstation-41-1.4-x86_64-CHECKSUM }

Veracrypt
Back

Import VeraCrypt GPG Public Key

{ sudo rpm --import


https://www.idrix.fr/VeraCrypt/VeraCrypt_PGP_public_key.asc }

Download VeraCrypt RPM packages from the official website and


verify the RPM package against the imported key

[ RPM packages: Fedora 40:

GUI: veracrypt-1.26.14-Fedora-40-x86_64.rpm (PGP Signature)


Console: veracrypt-console-1.26.14-Fedora-40-x86_64.rpm (PGP
Signature) ]

{ rpm --checksig /Path/to/File/veraCrypt/veracrypt-1.26.14-Fedora-40-


x86_64.rpm }

{ rpm --checksig /Path/to/File/veraCrypt/veracrypt-console-1.26.14-


Fedora-40-x86_64.rpm }

Install VeraCrypt manually from path

{ sudo dnf install /Path/to/File/veracrypt-1.26.14-Fedora-40-


x86_64.rpm }

{ sudo dnf install /Path/to/File/veracrypt-console-1.26.14-Fedora-40-


x86_64.rpm }

Remove VeraCrypt via dnf

{ sudo dnf remove veracrypt }

You might also like