Pages

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 ...

Monday, October 7, 2024

Fedora 42 : Fedora game project with pygame and agentpy - part 004.

... working on hacking game code , you can test two version of the unfinished game with agentpy at my pagure Fedora account.
* Hack the code based on minimal information versus total information. The code has 5 distinct letters. - click on the letters on the keypad - the number of guessed letters is displayed in the form: centered - guessed letters on positions and moved guessed letters but on other positions NOTE: the source code is under development, I need to enter a scroll to be able to enter more codes with letters

Saturday, September 28, 2024

Fedora 42 : testing programming for ARM - part 001.

Today I tested the creation of a program that works on ARM processors and tested with QEMU emulator in Fedora 42.
I install with dnf5 these fedora packages:
[root@fedora mythcat]# dnf5 clean all
[root@fedora mythcat]# dnf5 install qemu-system-arm
[root@fedora mythcat]# dnf5 install arm-none-eabi-gcc gcc-arm-linux-gnu gcc-c++-arm-linux-gnu
[root@fedora mythcat]# dnf5 install arm-none-eabi-newlib.noarch 
...
[root@fedora mythcat]# dnf5 install binutils-devel
I create a new folder into may pagure account to test this issue with QEMU:
[mythcat@fedora mythcat]$ mkdir ARMProjects
[mythcat@fedora mythcat]$ cd ARMProjects/
[mythcat@fedora ARMProjects]$ qemu-system-arm --version
QEMU emulator version 9.1.0 (qemu-9.1.0-2.fc42)
I create a default assembly file for ARM named hello.s:
[mythcat@fedora ARMProjects]$ cat hello.s 
.global _start

_start:
    mov r0, #1     
    mov r7, #4     
    str r0, [r7]
    bx lr
Let's see how this means:
  • global _start: This declares the _start label as global, making it accessible from outside the file.
  • _start:: This marks the beginning of the program.
  • mov r0, #1: Moves the immediate value 1 into register R0.
  • mov r7, #4: Moves the immediate value 4 into register R7. This represents the system call number for write().
  • str r0, [r7]: Stores the contents of R0 (which contains 1) into the memory address pointed to by R7.
  • bx lr: Branches to the address in Link Register (LR). In this case, it loops indefinitely because there's no return instruction.
The compile of the file:
[mythcat@fedora ARMProjects]$ arm-none-eabi-gcc -nostartfiles -lc hello.s -o hello.o
[mythcat@fedora ARMProjects]$ ls
hello.o  hello.s
Let's see the hello.o file:
[mythcat@fedora ARMProjects]$ nm hello.o
00008000 t $a
00009010 T __bss_end__
00009010 T _bss_end__
00009010 T __bss_start
00009010 T __bss_start__
00009010 T __data_start
00009010 T _edata
00009010 T __end__
00009010 T _end
00080000 B _stack
00008000 T _start
[mythcat@fedora ARMProjects]$ objdump -f hello.o

hello.o:     file format elf32-little
architecture: UNKNOWN!, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00008000

Fedora 42 : ima: Error Communicating to TPM chip ... cannot be fixed.

TPM stands for Trusted Platform Module. It's a hardware security chip designed to provide cryptographic capabilities and perform platform authentication.
I found this error and I tried to fix on my laptop HP 6710b:
[mythcat@fedora ~]$ sudo dmesg | grep Error
[    1.274790] tpm tpm0: [Hardware Error]: Adjusting reported timeouts: A 750->750000us B 2000->2000000us C 750->750000us D 750->750000us
[    2.240276] ima: Error Communicating to TPM chip
[    2.243913] ima: Error Communicating to TPM chip
[    2.246923] ima: Error Communicating to TPM chip
[    2.249919] ima: Error Communicating to TPM chip
[    2.253088] ima: Error Communicating to TPM chip
[    2.255923] ima: Error Communicating to TPM chip
[    2.258921] ima: Error Communicating to TPM chip
[    2.261938] ima: Error Communicating to TPM chip
[    2.415255] RAS: Correctable Errors collector initia
I update and nistall with the dnf5 tool
[root@fedora mythcat]# dnf5 upgrade 
...
[root@fedora mythcat]# dnf install tpm-tools
...
I reboot the Fedora and I try to test it:
[mythcat@fedora ~]$ ls /dev/tpm*
/dev/tpm0
[mythcat@fedora ~]$ lsmod | grep tpm
tpm_infineon           20480  0
To see all commands, use:
[mythcat@fedora ~]$ tpm_
tpm_changeownerauth  tpm_nvwrite          tpm_setclearable
tpm_clear            tpm_resetdalock      tpm_setenable
tpm_createek         tpm_restrictpubek    tpm_setoperatorauth
tpm_getpubek         tpm_restrictsrk      tpm_setownable
tpm_nvdefine         tpm_revokeek         tpm_setpresence
tpm_nvinfo           tpm_sealdata         tpm_takeownership
tpm_nvread           tpm_selftest         tpm_unsealdata
tpm_nvrelease        tpm_setactive        tpm_version
I install tcsd
[root@fedora mythcat]#  dnf install tcsd
...
[mythcat@fedora ~]$ sudo usermod -a -G tss $USER
[root@fedora mythcat]# systemctl daemon-reload
[root@fedora mythcat]# systemctl start tcsd
[root@fedora mythcat]#  systemctl status tcsd
I check the tpm version vith:
[mythcat@fedora ~]$ tpm_version
  TPM 1.2 Version Info:
  Chip Version:        1.2.1.2
  Spec Level:          2
  Errata Revision:     0
  TPM Vendor ID:       IFX
  TPM Version:         01010000
  Manufacturer Info:   49465800
[mythcat@fedora ~]$ sudo dnf5 search tpm2-tools
Updating and loading repositories:
Repositories loaded.
Matched fields: name (exact)
 tpm2-tools.x86_64: A bunch of TPM testing toolS build upon tpm2-tss
[mythcat@fedora ~]$ sudo dnf5 install tpm2-tools
...
Package "tpm2-tools-5.7-2.fc41.x86_64" is already installed.
The last error :
[mythcat@fedora ~]$ sudo tpm2_startup
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpmrm0: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpm0: Device or resource busy 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tcm0: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
WARNING:tcti:src/util-io/io.c:262:socket_connect() Failed to connect to host 127.0.0.1, port 2321: errno 111: Connection refused 
ERROR:tcti:src/tss2-tcti/tcti-swtpm.c:617:Tss2_Tcti_Swtpm_Init() Cannot connect to swtpm TPM socket 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-swtpm.so.0 
WARNING:tcti:src/util-io/io.c:262:socket_connect() Failed to connect to host 127.0.0.1, port 2321: errno 111: Connection refused 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-mssim.so.0 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:263:tctildr_get_default() No standard TCTI could be loaded 
ERROR:tcti:src/tss2-tcti/tctildr.c:477:tctildr_init_context_data() Failed to instantiate TCTI 
ERROR: Could not load tcti, got: "(null)"

Fedora 42 : Fedora game project with pygame and agentpy - part 003.

I have upgraded the source code with the following changes:
  • added agent with logic using the python agentpy module;
  • I increased the grid to 16 x 16;
  • I kept the win condition at 8 pieces aligned in any direction;
  • I added conditions for displaying the equality message;
The game is hard to win, you can try on my pagure account.

Wednesday, September 25, 2024

Fedora 42 : Fedora game project with pygame and agentpy - part 002.

... and update from 8 in 8 with SVG file type.
The source code I used or you can find it on the pagure project:
import pygame
from pygame.math import Vector2
import random
import os 
username = os.getlogin()
# Initialize Pygame
pygame.init()
# Set up the display
width, height = 800, 800
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Eight-in-a-Row")
# Font setup
font = pygame.font.Font(None, 74)
# Colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (0, 0, 120)
# Game board dimensions
BOARD_WIDTH = 8
BOARD_HEIGHT = 8

class Player:
    def __init__(self, color, is_computer=False):
        self.color = color
        self.pieces = set()
        self.is_computer = is_computer
        self.svg_image = self.load_svg_image()

    def add_piece(self, x, y):
        self.pieces.add((x, y))

    # def draw_pieces(self):
    #     for x, y in self.pieces:
    #         pygame.draw.circle(screen, self.color, 
    #                            (x * width // BOARD_WIDTH + width // (2 * BOARD_WIDTH), 
    #                             y * height // BOARD_HEIGHT + height // (2 * BOARD_HEIGHT)), 
    #                            min(width, height) // (2 * BOARD_WIDTH) - 5)
    
    def load_svg_image(self):
        if self.color == BLUE:
            svg_path = "penguin-svgrepo-com.svg"
        elif self.color == WHITE:
            svg_path = "cube-svgrepo-com.svg"
        else:
            svg_path = "cube-svgrepo-com.svg"
        return pygame.image.load(svg_path)

    def draw_pieces(self):
        piece_size = min(width, height) // (BOARD_WIDTH) - 10
        for x, y in self.pieces:
            pos = Vector2(x * width // BOARD_WIDTH + width // (2 * BOARD_WIDTH),
                          y * height // BOARD_HEIGHT + height // (2 * BOARD_HEIGHT))
            scaled_image = pygame.transform.scale(self.svg_image, (piece_size, piece_size))
            image_rect = scaled_image.get_rect(center=pos)
            screen.blit(scaled_image, image_rect)

    def make_move(self, board):
        if self.is_computer:
            empty_squares = [(x, y) for x in range(BOARD_WIDTH) for y in range(BOARD_HEIGHT) 
                             if (x, y) not in board[0] and (x, y) not in board[1]]
            if empty_squares:
                return random.choice(empty_squares)
        return None

def check_winner(player):
    directions = [(0, 1), (1, 0), (1, 1), (1, -1)]
    for x, y in player.pieces:
        for dx, dy in directions:
            if all((x + i*dx, y + i*dy) in player.pieces for i in range(8)):
                return True
    return False
    
def display_winner(winner):
    text = font.render(f"Player {winner} wins!", True, [145,190,190])
    text_rect = text.get_rect(center=(width // 2, height // 2))
    screen.blit(text, text_rect)
    pygame.display.flip()
    pygame.time.wait(3000)  # Display the message for 3 seconds

# Create players
player1 = Player(BLUE)
player2 = Player(WHITE, is_computer=True)
# Game loop
running = True
turn = 0
game_over = False

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        elif event.type == pygame.MOUSEBUTTONDOWN and not game_over:
            if turn % 2 == 0:  # Human player's turn
                mouse_x, mouse_y = event.pos
                column = mouse_x // (width // BOARD_WIDTH)
                row = mouse_y // (height // BOARD_HEIGHT)
                
                if (column, row) not in player1.pieces and (column, row) not in player2.pieces:
                    player1.add_piece(column, row)
                    
                    if check_winner(player1):
                        # print("Player 1 wins!")
                        display_winner(username)
                        game_over = True
                    
                    turn += 1

    if not game_over and turn % 2 == 1:  # Computer player's turn
        move = player2.make_move((player1.pieces, player2.pieces))
        if move:
            player2.add_piece(*move)
            
            if check_winner(player2):
                # print("Player 2 (Computer) wins!")
                display_winner("Computer")
                game_over = True
            turn += 1

    screen.fill(BLACK)
    
    # Draw game board
    for i in range(BOARD_WIDTH + 1):
        pygame.draw.line(screen, WHITE, (i * width // BOARD_WIDTH, 0), (i * width // BOARD_WIDTH, height), 2)
    for i in range(BOARD_HEIGHT + 1):
        pygame.draw.line(screen, WHITE, (0, i * height // BOARD_HEIGHT), (width, i * height // BOARD_HEIGHT), 2)

    # Draw pieces
    player1.draw_pieces()
    player2.draw_pieces()
    pygame.display.flip()

pygame.quit()

Saturday, September 21, 2024

Fedora 42 : Fedora game project with pygame and agentpy - part 001.

I started a game project with the python packages pygame and agentpy in the Fedora 42 Linux distribution.
I used this version of Fedora:
[mythcat@fedora fedora_game]$ uname -a
Linux fedora 6.11.0-63.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Sep 15 17:14:12 UTC 2024 x86_64 GNU/Linux
... and this python version:
Python 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 14.0.1 20240411 (Red Hat 14.0.1-0)] on linux
You can find it on my fedora pagure repo

Thursday, September 12, 2024

News : I updated to Fedora 42 .

Few days ago, I updated the Fedora to version 42 on HP Compaq 6710b laptop.
Almost over four thousand Fedora packages have been instaled and reviewed ...
See the result :
$ uname -a
Linux fedora 6.11.0-0.rc7.20240910gitbc83b4d1f086.57.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 10 15:43:53 UTC 2024 x86_64 GNU/Linux