Pages

Showing posts with label 2024. Show all posts
Showing posts with label 2024. Show all posts

Monday, December 16, 2024

Fedora 41 : The cirq python package only with Python 3.12.8.

Today I install the quil python package on Fedora 41, but with an older version of python :
Python 3.12.8 (main, Dec  6 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] on linux
mythcat@localhost:~$ python3.12 -m pip install quil --user
First, install the python version then install the pip tool:
mythcat@localhost:~$ curl https://bootstrap.pypa.io/get-pip.py | python3.12 -
...
Installing collected packages: pip
Successfully installed pip-24.3.1
Next, install with the pip version:
mythcat@localhost:~$ python3.12 -m pip install quil --user
Collecting quil

Saturday, December 14, 2024

Fedora 41 : OpenCV example with PyQt6.

Today I tested another source code with opencv, numpy, PyQt6 python packages.
I install opencv python package with dnf5 tool:
root@localhost:/home/mythcat# dnf5 install  python3-opencv.x86_64
The source code let you to open, change a image and save using sliders and a reset option.
This is the source code:
import sys
import cv2
import numpy as np
from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QSlider, QFileDialog, QPushButton, QHBoxLayout
from PyQt6.QtGui import QImage, QPixmap
from PyQt6.QtCore import Qt, pyqtSlot

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Real-Time Color Selection")
        self.setGeometry(100, 100, 1200, 800)

        # Create central widget and main layout
        central_widget = QWidget()
        self.setCentralWidget(central_widget)
        main_layout = QVBoxLayout(central_widget)

        # Create image label
        self.image_label = QLabel()
        main_layout.addWidget(self.image_label)

        # Initialize sliders
        self.lower_h = QSlider(Qt.Orientation.Horizontal)
        self.lower_s = QSlider(Qt.Orientation.Horizontal)
        self.lower_v = QSlider(Qt.Orientation.Horizontal)
        self.upper_h = QSlider(Qt.Orientation.Horizontal)
        self.upper_s = QSlider(Qt.Orientation.Horizontal)
        self.upper_v = QSlider(Qt.Orientation.Horizontal)

        # Set slider ranges
        for slider in [self.lower_h, self.upper_h]:
            slider.setRange(0, 179)
        for slider in [self.lower_s, self.lower_v, self.upper_s, self.upper_v]:
            slider.setRange(0, 255)

        # Set initial slider values
        self.lower_h.setValue(50)
        self.lower_s.setValue(100)
        self.lower_v.setValue(50)
        self.upper_h.setValue(130)
        self.upper_s.setValue(255)
        self.upper_v.setValue(255)

        # Connect sliders to update function
        self.lower_h.valueChanged.connect(self.update_hsv_range)
        self.lower_s.valueChanged.connect(self.update_hsv_range)
        self.lower_v.valueChanged.connect(self.update_hsv_range)
        self.upper_h.valueChanged.connect(self.update_hsv_range)
        self.upper_s.valueChanged.connect(self.update_hsv_range)
        self.upper_v.valueChanged.connect(self.update_hsv_range)

        # Create slider layouts with labels
        sliders_layout = QVBoxLayout()
        
        # Add slider pairs with labels
        slider_pairs = [
            ("Lower Hue", self.lower_h),
            ("Lower Saturation", self.lower_s),
            ("Lower Value", self.lower_v),
            ("Upper Hue", self.upper_h),
            ("Upper Saturation", self.upper_s),
            ("Upper Value", self.upper_v)
        ]

        for label_text, slider in slider_pairs:
            row_layout = QHBoxLayout()
            label = QLabel(label_text)
            label.setMinimumWidth(120)
            row_layout.addWidget(label)
            row_layout.addWidget(slider)
            sliders_layout.addLayout(row_layout)

        main_layout.addLayout(sliders_layout)

        # Add buttons
        button_layout = QHBoxLayout()
        
        self.reset_button = QPushButton("Reset Values")
        self.reset_button.clicked.connect(self.reset_values)
        button_layout.addWidget(self.reset_button)

        self.open_image_button = QPushButton("Open Image")
        self.open_image_button.clicked.connect(self.open_image)
        button_layout.addWidget(self.open_image_button)

        self.save_button = QPushButton("Save Image")
        self.save_button.clicked.connect(self.save_image)
        button_layout.addWidget(self.save_button)
        main_layout.addLayout(button_layout)

        # Process initial image
        self.process_image()

    def process_image(self):
        image_bgr = cv2.imread("image.png")
        if image_bgr is None:
            image_bgr = cv2.imread("default_image.png")
        
        self.image_bgr = image_bgr
        self.image_hsv = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2HSV)

        # Create initial mask using current slider values
        lower_values = np.array([self.lower_h.value(), self.lower_s.value(), self.lower_v.value()])
        upper_values = np.array([self.upper_h.value(), self.upper_s.value(), self.upper_v.value()])
        
        mask_test = cv2.inRange(self.image_hsv, lower_values, upper_values)
        image_bgr_masked = cv2.bitwise_and(image_bgr, image_bgr, mask=mask_test)
        self.image_rgb = cv2.cvtColor(image_bgr_masked, cv2.COLOR_BGR2RGB)
        self.update_image()

    def update_image(self):
        height, width, channel = self.image_rgb.shape
        bytes_per_line = width * channel
        q_image = QImage(self.image_rgb.data, width, height, bytes_per_line, QImage.Format.Format_RGB888)
        pixmap = QPixmap.fromImage(q_image)
        self.image_label.setPixmap(pixmap.scaled(700, 500, Qt.AspectRatioMode.KeepAspectRatio))

    def update_hsv_range(self):
        lower_values = np.array([self.lower_h.value(), self.lower_s.value(), self.lower_v.value()])
        upper_values = np.array([self.upper_h.value(), self.upper_s.value(), self.upper_v.value()])
        mask_test = cv2.inRange(self.image_hsv, lower_values, upper_values)
        image_bgr_masked = cv2.bitwise_and(self.image_bgr, self.image_bgr, mask=mask_test)
        self.image_rgb = cv2.cvtColor(image_bgr_masked, cv2.COLOR_BGR2RGB)
        self.update_image()

    def reset_values(self):
        self.lower_h.setValue(50)
        self.lower_s.setValue(100)
        self.lower_v.setValue(50)
        self.upper_h.setValue(130)
        self.upper_s.setValue(255)
        self.upper_v.setValue(255)

    def open_image(self):
        filename, _ = QFileDialog.getOpenFileName(self, "Select Image File", "", "Image Files (*.png *.jpg *.jpeg)")
        if filename:
            self.image_bgr = cv2.imread(filename)
            if self.image_bgr is not None:
                self.image_hsv = cv2.cvtColor(self.image_bgr, cv2.COLOR_BGR2HSV)
                self.update_hsv_range()  # This will apply current filter and update display

    def save_image(self):
        filename, _ = QFileDialog.getSaveFileName(self, "Save Image", "", "PNG Files (*.png);;JPEG Files (*.jpg)")
        if filename:
            # Make sure filename has an extension
            if not filename.endswith(('.png', '.jpg', '.jpeg')):
                filename += '.png'
            # Convert and save
            output_image = cv2.cvtColor(self.image_rgb, cv2.COLOR_RGB2BGR)
            cv2.imwrite(filename, output_image)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec())

Thursday, December 12, 2024

Fedora 41 : The cirq python package cannot be install - build errors

Today, I tried to use cirq python package on Fedora 41. This need the python version 3.12.
root@localhost:/home/mythcat# dnf install python3.12.x86_6c
I got some errors because ask me to install the rust:
root@localhost:/home/mythcat# curl https://sh.rustup.rs -sSf | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
...
Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish
These are the next steps I used:
root@localhost:/home/mythcat# pip install --upgrade pip
...
root@localhost:/home/mythcat# pip install maturin
...
root@localhost:/home/mythcat# pip install cirq
...
Collecting cirq
  Using cached cirq-1.4.1-py3-none-any.whl.metadata (7.4 kB)
...
        cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY
      
        --- stderr
        error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported version (3.12)
        = help: please check if an updated version of PyO3 is available. Current version: 0.20.3
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.13-64bit" PYO3_PYTHON="/usr/bin/python3" PYTHON_SYS_EXECUTABLE="/usr/bin/python3" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-v0zuc831/quil_ebc006157dbd433dbc0890811ee80748/quil-py/Cargo.toml" "--release" "--lib" "--crate-type" "cdylib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for quil
Failed to build quil
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (quil)
Not working ...

Monday, November 25, 2024

Fedora 41 : assembly fasm with cat command and qemu test.

I tested the basic direct binary concatenation where the second file is appended to the end of the first file, preserving all bytes exactly as they are without any linking metadata or relocations with the cat command.
Let's see how can do this.
You need to create two files: kernel.fasm and kernel2.fasm.
First will like this:
org 7C00h

; First stage bootloader
start:
    mov [bootdrive], dl
    mov ax, 0x2000  ; Load kernel at 0x2000:0
    mov es, ax
    xor bx, bx      ; ES:BX = buffer
    
    mov ah, 02h     ; Read sectors
    mov al, 6       ; Number of sectors to read
    mov ch, 0       ; Cylinder 0
    mov cl, 2       ; Start from sector 2
    mov dh, 0       ; Head 0
    mov dl, [bootdrive]
    int 13h
    
    jmp 0x2000:0    ; Jump to second stage

bootdrive db 0
times 510-($-$$) db 0
dw 0xAA55
The second one named kernel2.fasm will come with new features:
org 0

COLS equ 80
ROWS equ 25
VIDEO_MEM equ 0xB800

; Box drawing characters
BOX_DR    equ 201  ; ╔
BOX_HL    equ 205  ; ═
BOX_DL    equ 187  ; ╗
BOX_VL    equ 186  ; ║
BOX_UR    equ 200  ; ╚
BOX_UL    equ 188  ; ╝
BOX_BLOCK equ 219  ; █
...
Use fasm and cat commands to create the bin files and the result file for qemu:
mythcat@localhost:~/fasm$ ./fasm.x64 kernel.fasm kernel.bin
flat assembler  version 1.73.32  (16384 kilobytes memory, x64)
2 passes, 512 bytes.
mythcat@localhost:~/fasm$ ./fasm.x64 kernel2.fasm kernel2.bin
flat assembler  version 1.73.32  (16384 kilobytes memory, x64)
2 passes, 132 bytes.
mythcat@localhost:~/fasm$ cat kernel.bin kernel2.bin > os.img
The last step is to run qemu-system-i386 to test the result
mythcat@localhost:~/fasm$ qemu-system-i386 -fda os.img
The result is this:

Sunday, November 24, 2024

Fedora 41 : Error gio default application for image.

I run today an old python script in my Fedora 41 to create an image and the result after running was:
mythcat@localhost:~$ python test_001.py 
gio: file:///tmp/tmpwy1k4wyo.PNG: Failed to find default application for content type ‘image/png’
This can be fixed with an default application for images like feh:
$ sudo dnf5 install feh

Fedora 41 : remove package lead to unexpected results.

Today I saw the mutter package from Fedora distro come with a new update.
I don't use this package, ... is a mess in my oppinion.
But I found this output when I tried to remove
root@localhost:/home/mythcat# dnf5 remove mutter 
Package                          Arch   Version                 Reposit      Size
Removing:
 mutter                          x86_64 47.1-3.fc41             updates  12.5 MiB
Removing dependent packages:
 gdm                             x86_64 1:47.0-8.fc41           updates   5.3 MiB
 gnome-shell                     x86_64 47.1-1.fc41             updates  13.8 MiB
Removing unused dependencies:
 accountsservice                 x86_64 23.13.9-5.fc41          fedora  379.5 KiB
 accountsservice-libs            x86_64 23.13.9-5.fc41          fedora  212.3 KiB
 bluez-obexd                     x86_64 5.79-1.fc41             updates 345.1 KiB
 bolt                            x86_64 0.9.8-3.fc41            fedora  503.3 KiB
 boost-thread                    x86_64 1.83.0-8.fc41           fedora  136.8 KiB
 color-filesystem                noarch 1-34.fc41               fedora  151.0   B
 colord                          x86_64 1.4.7-5.fc41            fedora    1.7 MiB
 colord-gtk4                     x86_64 0.3.1-2.fc41            fedora   35.6 KiB
 composefs-libs                  x86_64 1.0.6-1.fc41            fedora  166.3 KiB
 cups-pk-helper                  x86_64 0.2.7-8.fc41            fedora  379.0 KiB
 dbus-daemon                     x86_64 1:1.14.10-4.fc41        fedora  553.2 KiB
 evolution-data-server           x86_64 3.54.1-1.fc41           updates   8.8 MiB
 evolution-data-server-langpacks noarch 3.54.1-1.fc41           updates   8.8 MiB
 flatpak-libs                    x86_64 1.15.10-1.fc41          fedora    1.0 MiB
 ...
 
Is this ok [y/N]: N
 ... 
If I used this command the gdm and gnome-shell is gone:
root@localhost:/home/mythcat# dnf5 remove --noautoremove mutter 
Package                        Arch   Version                   Repository        Size
Removing:
 mutter                        x86_64 47.1-3.fc41               updates       12.5 MiB
Removing dependent packages:
 gdm                           x86_64 1:47.0-8.fc41             updates        5.3 MiB
 gnome-session-wayland-session x86_64 47.0.1-1.fc41             fedora        15.9 KiB
 gnome-shell                   x86_64 47.1-1.fc41               updates       13.8 MiB

Transaction Summary:
 Removing:           4 packages
 
Is this ok [y/N]: N
...
I tried with the --noautoremove, and --exclude args and not result:
root@localhost:/home/mythcat# dnf5 remove --noautoremove --exclude=gnome-shell,gdm mutter
Failed to resolve the transaction:
Problem: installed package gnome-shell-47.1-1.fc41.x86_64 requires libmutter-15.so.0()(64bit), but none of the providers can be installed
  - installed package gnome-shell-47.1-1.fc41.x86_64 requires libmutter-clutter-15.so.0()(64bit), but none of the providers can be installed
  - installed package gnome-shell-47.1-1.fc41.x86_64 requires libmutter-cogl-15.so.0()(64bit), but none of the providers can be installed
  - installed package gnome-shell-47.1-1.fc41.x86_64 requires libmutter-mtk-15.so.0()(64bit), but none of the providers can be installed
  - installed package gnome-shell-47.1-1.fc41.x86_64 requires mutter(x86-64) >= 47.0, but none of the providers can be installed
  - conflicting requests
  - problem with installed package
The solution is old rpm tool:
root@localhost:/home/mythcat# rpm -e --nodeps mutter 
root@localhost:/home/mythcat# dnf5 remove mutter
No packages to remove for argument: mutter

Nothing to do.

Wednesday, November 20, 2024

Fedora 41 : generated shapes with python !

Today I created this source code in python that generates eight random convex polygons. The idea was to create sprites for a 2D game: snowballs, boulders, or similar objects ... Obviously I also used Sonet 3.5 artificial intelligence. You can find the source code on the pagure account in fedora.
#!/usr/bin/env python3
"""
SVG Polygon Generator

This script generates multiple deformed polygonal shapes and saves them as separate SVG files.
Each polygon maintains convex properties while having controlled random deformations.

Features:
    - Generates 8 unique polygonal shapes
    - Controls deformation through radial and angular factors
    - Maintains convex properties
    - Exports each shape to a separate SVG file
    - Uses random colors for visual distinction

Usage:
    python generate_svgs.py

Output:
    Creates 8 SVG files named 'polygon_1.svg' through 'polygon_8.svg'
"""

from lxml import etree
import random
import math
from pathlib import Path


def create_svg_root():
    """Create and return a base SVG root element with standard attributes."""
    root = etree.Element("svg")
    root.set("width", "500")
    root.set("height", "500")
    root.set("xmlns", "http://www.w3.org/2000/svg")
    return root


def calculate_points(center_x: float, center_y: float, radius: float, 
                    num_sides: int, deform_factor: float) -> list:
    """
    Calculate polygon points with controlled deformation.

    Args:
        center_x: X coordinate of polygon center
        center_y: Y coordinate of polygon center
        radius: Base radius of the polygon
        num_sides: Number of polygon sides
        deform_factor: Maximum allowed deformation factor

    Returns:
        List of tuples containing (x, y) coordinates
    """
    points = []
    angle_step = 2 * math.pi / num_sides
    
    for i in range(num_sides):
        angle = i * angle_step
        radial_deform = random.uniform(-deform_factor, deform_factor)
        angular_deform = random.uniform(-deform_factor/2, deform_factor/2)
        
        modified_angle = angle + angular_deform
        modified_radius = radius * (1 + radial_deform)
        
        x = center_x + modified_radius * math.cos(modified_angle)
        y = center_y + modified_radius * math.sin(modified_angle)
        points.append((x, y))
    
    return points


def generate_deformed_shapes():
    """Generate multiple deformed polygons and save them to separate SVG files."""
    # Base parameters
    num_sides = 8
    center_x = 250
    center_y = 250
    base_radius = 150
    max_deformation = 0.15
    output_dir = Path("generated_polygons")
    
    # Create output directory if it doesn't exist
    output_dir.mkdir(exist_ok=True)

    for i in range(8):
        root = create_svg_root()
        points = calculate_points(center_x, center_y, base_radius, 
                                num_sides, max_deformation)
        
        path = etree.SubElement(root, "path")
        path_data = f"M {points[0][0]} {points[0][1]}"
        path_data += "".join(f" L {p[0]} {p[1]}" for p in points[1:])
        path_data += " Z"
        
        path.set("d", path_data)
        path.set("fill", "none")
        path.set("stroke", f"#{random.randint(0, 16777215):06X}")
        path.set("stroke-width", "2")
        path.set("opacity", "0.7")

        # Save individual SVG file
        output_file = output_dir / f"polygon_{i+1}.svg"
        tree = etree.ElementTree(root)
        tree.write(str(output_file), pretty_print=True, 
                  xml_declaration=True, encoding='utf-8')
    
    print(f"Generated {num_sides} polygons in {output_dir}")

if __name__ == "__main__":
    generate_deformed_shapes()

Saturday, November 16, 2024

Fedora 41 : Bookworm - open-source eBook reader !

Bookworm is an open-source eBook reader with an easy and simple layout supporting different file formats like epub, pdf, mobi, cbr and cbz. See the official webpage.
root@localhost:/home/mythcat# dnf5 search bookworm
Updating and loading repositories:
Repositories loaded.
Matched fields: name (exact)
 bookworm.x86_64: Simple, focused eBook reader
root@localhost:/home/mythcat# dnf5 install bookworm.x86_64
Updating and loading repositories:
Repositories loaded.
Package                 Arch   Version                      Repository      Size
Installing:
 bookworm               x86_64 1.1.3-0.13.20200414git.c7c36 fedora       3.6 MiB
Installing dependencies:
 granite                x86_64 6.2.0-9.fc41                 fedora     949.2 KiB
 javascriptcoregtk4.0   x86_64 2.46.3-1.fc41                updates     28.3 MiB
 webkit2gtk4.0          x86_64 2.46.3-1.fc41                updates     75.4 MiB

Transaction Summary:
 Installing:         4 packages
...
[6/6] Installing bookworm-0:1.1.3-0.13. 100% | 430.8 KiB/s |   3.7 MiB |  00m09s
Complete!ng trigger-install scriptlet: hicolor-icon-theme-0:0.17-19.fc41.noarch
The last step, search this on gnome environmet and you will find this application.

Wednesday, November 13, 2024

Fedora 41 : use pagure tool with ssh key ...

Pagure is a light-weight git-centered forge based on pygit2.
The basic tool can be found on this fedora package, the pagure has more features.
Because I used only like a repo I install with DNF5 tool the basic cli:
# dnf5 install pagure-cli.x86_64
I created a folder then I used easy like git tool for each project I have under basic fedora account:
mythcat@localhost:~/pagure_fedora$ git clone https://pagure.io/mythcat
Cloning into 'mythcat'...
remote: Enumerating objects: 1567, done.
remote: Counting objects: 100% (1567/1567), done.
remote: Compressing objects: 100% (1467/1467), done.
remote: Total 1567 (delta 76), reused 1496 (delta 63), pack-reused 0
Receiving objects: 100% (1567/1567), 5.82 MiB | 2.26 MiB/s, done.
Resolving deltas: 100% (76/76), done.
mythcat@localhost:~/pagure_fedora$ git clone https://pagure.io/radio-online-catafest
Cloning into 'radio-online-catafest'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (8/8), 6.01 KiB | 267.00 KiB/s, done.
These are git repos for folders: mythcat and radio-online-catafest, any git command can be run on these folders.
mythcat@localhost:~/pagure_fedora$ cd mythcat 
mythcat@localhost:~/pagure_fedora/mythcat$ nano test.txt
mythcat@localhost:~/pagure_fedora/mythcat$ git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file> ..." to include in what will be committed)
	test.txt

nothing added to commit but untracked files present (use "git add" to track)
mythcat@localhost:~/pagure_fedora/mythcat$ git add .
mythcat@localhost:~/pagure_fedora/mythcat$ git commit -am "test with a file"
[main 2c9fa14] test with a file
 Committer: Catalin George Festila <mythcat localhost.localdomain="">
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
 mythcat@localhost:~/pagure_fedora/mythcat$  git config --global --edit
mythcat@localhost:~/pagure_fedora/mythcat$ git commit --amend --reset-author
[main 308a2c9] test with a file
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
mythcat@localhost:~/pagure_fedora/mythcat$ git remote set-url origin git@pagure.io:mythcat.git
mythcat@localhost:~/pagure_fedora/mythcat$ git remote -v
origin	git@pagure.io:mythcat.git (fetch)
origin	git@pagure.io:mythcat.git (push)
You need to use ssh-keygen to have a ssh key for pagure on Fedora linux then remove the old key and, add the ssh key to Fedora pagure account, then I push the file:
mythcat@localhost:~/pagure_fedora/mythcat$ ssh-add ~/.ssh/mypagure
mythcat@localhost:~/pagure_fedora/mythcat$ ssh-keygen -y -f ~/.ssh/mypagure
mythcat@localhost:~/pagure_fedora/mythcat$ systemctl restart sshd.service mythcat@localhost:~/pagure_fedora/mythcat$ git push 
For my repo radio-online-catafest the git remote command is this:
mythcat@localhost:~/pagure_fedora/radio-online-catafest$ git remote set-url origin git@pagure.io:radio-online-catafest.git
mythcat@localhost:~/pagure_fedora/radio-online-catafest$ git push 
Everything up-to-date

Saturday, November 9, 2024

Fedora 41 : timeshift tool for backup.

... one old tool for backup was rsync ...
Now you have a tool named timeshift with this tool named timeshift and more features ...
You can install with:
root@localhost:/home/mythcat# dnf5 install timeshift.x86_64
I run this tool with :
mythcat@localhost:~$ sudo timeshift-gtk 
The result is this G.U.I. ...
... because the backup is not easy, I search on web and I found a video tutorial from the official youtube channel - DrewHowdenTech
...

Fedora 41 : Minimal gnome install and nemo additionals packages.

I reinstall the Fedora, somehow was crashed with a bad systemd error:
uname -a
Linux localhost.localdomain 6.11.5-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 22 20:11:15 UTC 2024 x86_64 GNU/Linux
If you install nemo with minimal gnome features then you need to install fedora packages, like this one:
root@localhost:/home/mythcat# dnf5 install nemo-image-converter

Sunday, October 27, 2024

Fedora 42 : Can be better? part 020.

I wrote in some posts about this blog about the possibility of improving the distribution of Linux Fedora.
Today I discovered that choosing GNOME is a better option with lighting modes and options for the Nemo file manager actions.
I would have wanted to have a better network system similar to portmanager with S.P.N. for fedora users and team on web.
SPN (Secure Peer Name) is a technology related to secure communication protocols, particularly in the context of peer-to-peer networks and distributed systems.
I want to have more tools and applications on tty with GUI, like ncurses... I created an radio online application with ncurses and you can find it on my pagure.
The main goal of these type of graphic user interface is simplicity, no need hardware resources - this HP Compaq 6710b has only 4Gb RAM, and cand be used with Single Board Computer.
I think Fedora don't have a Fedora Spin for Single Board Computer hardware.
Let's start with python 3 action on nemo file manager.
Go to the action folder and create an action file named: python3.nemo_action.
[root@fedora mythcat]# cd /usr/share/nemo/actions
[root@fedora actions]# nano python3.nemo_action
Add this source code :
[Nemo Action]
Name=Execute Python Script
Icon-Name=python
Exec=env /usr/bin/python3 %F
Selection=S
Name[tr]=Python script         
Extensions=py;
Reopen the Nemo file manager and you see an an Execute Python Script, only on the python script on right click menu.
Let's see some screenshots:

Saturday, October 26, 2024

Fedora 42 : ... testing Advanced Intrusion Detection Environment (AIDE).

Advanced Intrusion Detection Environment (AIDE) is a utility that creates a database of files on the system, and then uses that database to ensure file integrity and detect system intrusions.. See more on the official fedora documentation webpage.
NOTE : The documentation and translations on the official page are in progress due to ongoing development and resource management ...
I used the DNF tool to install:
[mythcat@fedora ~]$ sudo dnf install aide
... aide      x86_64      0.18.6-5.fc41        rawhide      
Make sure the AIDE database file exists and is accessible:
[mythcat@fedora ~]$ sudo ls -l /var/lib/aide/aide.db.gz
Ensure that the user running AIDE has the necessary permissions:
[mythcat@fedora ~]$ sudo ls -l /var/lib/aide/
Check the AIDE configuration file:
[mythcat@fedora ~]$ sudo cat /etc/aide.conf | grep DBDIR
Check if the AIDE service file exists:
[mythcat@fedora ~]$ sudo ls /usr/lib/systemd/system/ | grep aide
If the service exists then check the status:
[mythcat@fedora ~]$ sudo systemctl status aide
Unit aide.service could not be found.
If the service not exist then take some time to run first time ...
[mythcat@fedora ~]$ sudo /sbin/aide --init
...
End timestamp: 2024-10-26 14:10:00 +0300 (run time: 98m 41s)
You can check each time you want ...
[mythcat@fedora ~]$ sudo /sbin/aide --check
If you want and your Fedora linux need to use this tool, then you can use it like service:
sudo nano /usr/lib/systemd/system/aide.service
Fill with the basic service source code like any unit service :
[Unit]
   Description=Advanced Intrusion Detection Environment
   After=network.target

   [Service]
   Type=simple
   ExecStart=/sbin/aide --init
   ExecStop=/sbin/aide --check
   Restart=on-failure

   [Install]
   WantedBy=multi-user.target
This is a simple tutorial about how to start with AIDE tool ...

Saturday, October 19, 2024

Fedora 42 : Still in the development without some features ...

An intrusion on my vodafone network , change my layout on windows.
Even the network provider say always is not from hardware or administration vodafone network ...
I tried to wrote a post on my graphics blogger on windows os , but I got something like this:
... ld ne frm 3 cmbire 224 ...
My nicknames comes like this: mhca caafe for mythcat and catafest ...
The tab and enter keys not works, also 1234 789 and num keys ... and more keys: s, t, w, y, o.
This post is wrote on Fedora 42 and works fine , but will be more good if this distro will have all features.
Some examples :
- Selinux still works but some enforced can change the default user permissions and privileges.
- Selinux works but you can use full features like : mls.
- the TPM device from this HP Laptop cannot be used with all features on Fedora.
In conclusion, this old laptop with Fedora and GNOME environment is more than 10 times faster human operations on the range of time, than the Asus laptop with the same 4GB RAM but with a different CPU Intel(R) Core(TM) i3-60060 @ 2.00 GHz 1.99 GHz and windows 10 pro.

Thursday, October 17, 2024

Fedora 42 : Testing isoimagewriter.

Today I tested the isoimagewriter tool on Fedora 42 and works well:
[mythcat@fedora ~]$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 984 MiB, 1031798784 bytes, 2015232 sectors
Disk model: USB FLASH DRIVE 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
[mythcat@fedora ~]$ isoimagewriter 
[mythcat@fedora ~]$ sudo file -s /dev/sdb
/dev/sdb: ISO 9660 CD-ROM filesystem data 'CorePure64' (bootable)
[mythcat@fedora ~]$ sudo qemu-system-x86_64 -cdrom /dev/sdb 
I used an linux iso image from CorePure64

Wednesday, October 16, 2024

Fedora 42 : Using dosbox to run old games in Fedora Linux distro.

You can run DOS games with the DOSBOX emulator ...
This can be install with DNF5 tool:
[root@fedora mythcat]# dnf5 install dosbox-staging.x86_64
Updating and loading repositories:
Repositories loaded.
Package                 Arch   Version                 Repository           Size
Installing:
 dosbox-staging         x86_64 0.81.2-3.fc42           updates-testing  14.6 MiB
The next step is to run the game ...
[mythcat@fedora ~]$ ls /usr/share/dunelegacy/
 ATRE.PAK                  DUNE.PAK       locale         SETUPENG.DIP
 CREDITS.ENG               ENGLISH.PAK    maps           Setup.EXE
 Dune2.BAT                 FINALE.PAK     MENTAT.PAK     SOUND.PAK
 Dune2.EXE                 GFXHD.PAK      MERC.PAK       VOC.PAK
 Dune2.ICO                 HARK.PAK       OneTime.DAT    Waveset.DAT
 Dune2-Versions.txt        HERC.PAK       OPENSD2.PAK    XTRE.PAK
 Dune.CFG                  INTRO.PAK      Options.CFG
'Dune II Icons.icl'        INTROVOC.PAK   ORDOS.PAK
'Dune II Unit Guide.txt'   LEGACY.PAK     SCENARIO.PAK
[mythcat@fedora ~]$ dosbox /usr/share/dunelegacy/Dune2.EXE 
date       time         | 
2024-10-16 11:39:03.508 | arguments: dosbox /usr/share/dunelegacy/Dune2.EXE
2024-10-16 11:39:03.509 | Current dir: /home/mythcat
2024-10-16 11:39:03.509 | stderr verbosity: 0
2024-10-16 11:39:03.509 | -----------------------------------

Monday, October 14, 2024

Fedora 42 : Dune Legacy game .

Dune Legacy is an effort by a handful of developers to revitalize the first-ever real-time strategy game.
It tries to be as similar as possible to the original gameplay but to integrate user interface features most modern realtime-strategy games have like selecting multiple units
I download this game from the official website, and I install with DNF5 tool:
[root@fedora Downloads]# dnf5 install dunelegacy-0.96.4.x86_64.rpm
Updating and loading repositories:
Repositories loaded.
Package                 Arch   Version                 Repository           Size
Installing:
 dunelegacy             x86_64 0.96.4-0.1              @commandline      5.8 MiB
Installing dependencies:
 SDL2_mixer             x86_64 2.8.0-2.fc41            updates-testing 345.3 KiB
 ...
 Warning: skipped PGP checks for 1 package from repository: @commandline
Complete!
Find the orifinal Dune II on web, or try this website.
The game can be start after I unarchive the DuneII archive into DuneII then copy to /usr/share/dunelegacy ...
[mythcat@fedora DuneII]$ sudo su 
[sudo] parola pentru mythcat: 
[root@fedora DuneII]# cp *.* /usr/share/dunelegacy
[root@fedora DuneII]# exit
exit
[mythcat@fedora DuneII]$ dunelegacy 
.. and works well :

Sunday, October 13, 2024

Fedora 42 : The cvxpy python module ... part 001.

We are building a CVXPY community on Discord. Join the conversation! CVXPY is an open source Python-embedded modeling language for convex optimization problems. It lets you express your problem in a natural way that follows the math, rather than in the restrictive standard form required by solvers.
Today I install the cvxpy python module ...
You can see on the official website - www.cvxpy.org .
NOTE: I don't understand why the blogger don't have a a code tag , I used a div - pre - code into txt file to wrote my posts ...
[mythcat@fedora ~]$ nano tutoriale.txt 
Let's see ...
[mythcat@fedora home]# dnf5 upgrade
[mythcat@fedora home]# dnf5 install openblas-devel
[mythcat@fedora home]# dnf5 install blas-devel
...
$ ldconfig -p | grep openblas
$ ldconfig -p | grep blas
...
[mythcat@fedora home]$ pip install cvxpy
...
Successfully built cvxpy ecos scs qdldl
Installing collected packages: scipy, scs, qdldl, ecos, clarabel, osqp, cvxpy
Successfully installed clarabel-0.9.0 cvxpy-1.5.2 ecos-2.0.14 osqp-0.6.7.post3 qdldl-0.1.7.post4 scipy-1.14.1 scs-3.2.7

Thursday, October 10, 2024

Fedora 42 : First test with red language - part 001.

Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single ~1MB file!
I download and change to be executable:
[mythcat@fedora ~]$ cd red-lang/
[mythcat@fedora red-lang]$ ls
red-03oct24-920dd0452  red-toolchain-03oct24-920dd0452  red-view-03oct24-920dd0452
[mythcat@fedora red-lang]$ ls -l
total 4444
-rw-r--r--. 1 mythcat mythcat 1347348 Oct  4 23:56 red-03oct24-920dd0452
-rw-r--r--. 1 mythcat mythcat 1611781 Oct  4 23:55 red-toolchain-03oct24-920dd0452
-rw-r--r--. 1 mythcat mythcat 1589092 Oct  4 23:55 red-view-03oct24-920dd0452
[mythcat@fedora red-lang]$ chmod 760 red*
[mythcat@fedora red-lang]$ ls -l
total 4444
-rwxrw----. 1 mythcat mythcat 1347348 Oct  4 23:56 red-03oct24-920dd0452
-rwxrw----. 1 mythcat mythcat 1611781 Oct  4 23:55 red-toolchain-03oct24-920dd0452
-rwxrw----. 1 mythcat mythcat 1589092 Oct  4 23:55 red-view-03oct24-920dd0452
I check and install these supporting libraries:
sudo yum install glibc.i686
sudo yum install libcurl.i686
sudo yum install gtk3.i686
I start with the basic intro example from the official website.
Then I need to check the missing files with the DNF tool and install Fedora packages for each error on runtime with executable result
dnf provides \*/libgtk-3.so.0
The result is this:

Fedora 42 : Gnome intro ...

Today I tested the new GNOME environment and these are the screeenshot I get:
Look's good ..., see the tour idea ...