Pages

Wednesday, December 4, 2019

Fedora 31 : Lutris the Open Source gaming platform for Linux.

Lutris is an Open Source gaming platform for Linux. It installs and launches games so you can start playing without the hassle of setting up your games. Get your games from GOG, Steam, Battle.net, Origin, Uplay and many other sources running on any Linux powered gaming machine.
You need to create an account and you can run many games on Linux and multiple platforms, see the official website with games.
The installation process is simple to do on Fedora 31 with DNF tool:
[root@desk mythcat]# sudo dnf install lutris
Last metadata expiration check: 0:06:35 ago on Wed 04 Dec 2019 07:15:23 PM EET.
Dependencies resolved.
======================================================================================
 Package                    Arch       Version                      Repository   Size
======================================================================================
Installing:
 lutris                     x86_64     0.5.3-1.fc31                 fedora      2.0 M
...
Total download size: 129 M
Installed size: 708 M
Is this ok [y/N]: y
...
  llvm-libs-9.0.0-1.fc31.i686           ncurses-libs-6.1-12.20190803.fc31.i686       
  python3-evdev-1.1.2-4.fc31.x86_64     unixODBC-2.3.7-5.fc31.x86_64                 
  vulkan-loader-1.1.114.0-1.fc31.i686  

Complete!

Saturday, November 23, 2019

Fedora 31 : Can be better? part 002.

If you want to have a USB device with the Fedora distro then the Fedora team comes with this solution, see the webpage.
Now let's make all easier for this issue. Detect your USB device...
[mythcat@desk ~]$ lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
...
sdb               8:16   1   984M  0 disk 
└─sdb1            8:17   1   983M  0 part 
Be sure the USB drive has bootable flag enable:
[mythcat@desk Downloads]$ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is disabled now.

Command (m for help): a   
Selected partition 1
The bootable flag on partition 1 is enabled now.

Command (m for help): q
Umount your USB drive, do not remove it.
[mythcat@desk ~]$ sudo umount /dev/sdb
Copy the Fedora file image iso to the USB device with the dd command:
[mythcat@desk ~]$ sudo dd if=Fedora-Server-netinst-x86_64-31-1.9.iso of=/dev/sdb 
1331200+0 records in
1331200+0 records out
681574400 bytes (682 MB, 650 MiB) copied, 383.766 s, 1.8 MB/s
You can test it with the qemu tool:
[mythcat@desk ~]$ sudo qemu-system-x86_64 -hda /dev/sdb

Thursday, November 14, 2019

Fedora 31 : Can be better? part 001.

I started using Fedora distribution several years ago after I tried several distros (Suse, RedHat 6, Debian, Gentoo and many more).
I was pleased with the test and speed.
I must admit that from the first used version 9 (Sulfur) and until now it is very changed and unknown for many users
That's why I decided to present in this series of mini-tutorials called Can be better? various lesser-known aspects that underlie it and its more precise use.
I will not abide by a predetermined order in the use of Fedora distribution.
I will only point to useful information for any Fedora user.

Let's start the first part of this tutorial named Can be better? part 001. with a brief introduction to the Wikipedia page and the official one.
An interesting aspect of Fedora configuration is the file sysctl.conf.
You can read the manual page with this command:
man 8 sysctl
Part of this file should contain these lines:
vm.overcommit_memory=2
vm.overcommit_ratio=100
kernel.exec-shield=1
This parameter named vm.overcommit_memory can be set this way:
0: heuristic overcommit (this is the default)
1: always overcommit, never check
2: always check, never overcommit
For this parameter named vm.overcommit_ratio any value to anything less than 100 is almost always incorrect.
The last parameter named kernel.exec-shield fix NX protection also called Data Execution Prevention (DEP), to prevent buffer stacks from taking down your machine.
You can check this with:
[root@desk mythcat]# grep nx /proc/cpuinfo 

Sunday, November 10, 2019

Fedora 31 : Use bash script to see all the permissions.

This tutorial will show you how to generate all the permissions using one file named file_test.
[mythcat@desk ~]$ mkdir my_bash_scripts
[mythcat@desk ~]$ cd my_bash_scripts/
[mythcat@desk my_bash_scripts]$ vim all_permissions.sh
[mythcat@desk my_bash_scripts]$ vim all_permissions.sh
[mythcat@desk my_bash_scripts]$ chmod +x all_permissions.sh
[mythcat@desk my_bash_scripts]$ ls
all_permissions.sh
Let's see the bash script file named all_permissions.sh:
#!/bin/sh
#loops through a chmod sequence

count_perm(){
        foo=1
        touch file_test
        while [ "$foo" -ne 7778 ];do
                echo $foo >> out
                chmod $foo file_test
                ls -gG >> out
                foo=$(($foo+1))
        done
}
count_perm
egrep -v '(all_permissions.sh)|(total)|(out)' out > results
echo "use command cat results to see permissions for file_test."

exit 0
You can run the script:
[mythcat@desk my_bash_scripts]$ ./all_permissions.sh 
...
Try 'chmod --help' for more information.
chmod: invalid mode: ‘7768’
Try 'chmod --help' for more information.
chmod: invalid mode: ‘7769’
Try 'chmod --help' for more information.
use command cat results to see permissions for file_test.
[mythcat@desk my_bash_scripts]$ ls
all_permissions.sh  file_test  out  results
The out file show all permissions for files:
[mythcat@desk my_bash_scripts]$ cat out
...
7774
total 2052
-rwxrwxr-x. 1     331 Nov 10 18:22 all_permissions.sh
-rwsrwsr-T. 1       0 Nov 10 18:23 file_test
-rw-rw-r--. 1 1153701 Nov 10 18:23 r
7775
total 2052
-rwxrwxr-x. 1     331 Nov 10 18:22 all_permissions.sh
-rwsrwsr-t. 1       0 Nov 10 18:23 file_test
-rw-rw-r--. 1 1153853 Nov 10 18:23 r
7776
total 2052
-rwxrwxr-x. 1     331 Nov 10 18:22 all_permissions.sh
-rwsrwsrwT. 1       0 Nov 10 18:23 file_test
-rw-rw-r--. 1 1154005 Nov 10 18:23 r
7777
total 2052
-rwxrwxr-x. 1     331 Nov 10 18:22 all_permissions.sh
-rwsrwsrwt. 1       0 Nov 10 18:23 file_test
-rw-rw-r--. 1 1154157 Nov 10 18:23 r
The results file show the permissions:
[mythcat@desk my_bash_scripts]$ cat results 
...
7766
-rwsrwSrwT. 1       0 Nov 10 18:30 file_test
7767
-rwsrwSrwt. 1       0 Nov 10 18:30 file_test
7768
-rwsrwSrwt. 1       0 Nov 10 18:30 file_test
7769
-rwsrwSrwt. 1       0 Nov 10 18:30 file_test
7770
-rwsrws--T. 1       0 Nov 10 18:30 file_test
7771
-rwsrws--t. 1       0 Nov 10 18:30 file_test
7772
-rwsrws-wT. 1       0 Nov 10 18:30 file_test
7773
-rwsrws-wt. 1       0 Nov 10 18:30 file_test
7774
-rwsrwsr-T. 1       0 Nov 10 18:30 file_test
7775
-rwsrwsr-t. 1       0 Nov 10 18:30 file_test
7776
-rwsrwsrwT. 1       0 Nov 10 18:30 file_test
7777
-rwsrwsrwt. 1       0 Nov 10 18:30 file_test

Fedora 31 : another FASM tutorial with Linux.

Today I wrote another tutorial about FASM and assembly language on my website.
Because I used the Fedora distro I add my tutorial here.
If you want to learn assembly programming for Windows O.S. or Linux with the Intel C.P.U. then you need the FASM tool and this manual.
Today I will show you how to create a file using my Fedora 31 Linux distro and FASM tool.
The name of this file will be new_file.txt.
The assembly program will use INT 0x08 to create the file.
entry _start

filename db "new_file.txt", 0

_start:
    ; create a new file
    mov rax, 8
    mov rbx, filename
    mov rcx, 0011
    int 0x80

    ; use descriptor
    push rax

    ; close the new file
    mov rax, 6
    pop rbx
    int 0x80

    call exit

exit:
    mov rax, 1
    mov rbx, 0
    int 0x80>
The program also set the file permissions in the rcx register.
Let's see some octal permissions:
    mov rcx, 000

----------. 1 mythcat mythcat       0 Nov 10 17:40 new_file.txt
    mov rcx, 0001

---------x. 1 mythcat mythcat       0 Nov 10 17:41 new_file.txt
    mov rcx, 0011

------x--x. 1 mythcat mythcat       0 Nov 10 17:43 new_file.txt

Saturday, November 9, 2019

Fedora 31 : The new Fedora 31 Linux distro.

I tested today the new Fedora 31.
This new Fedora comes with many features.
One is the Toolbox tool that offers a familiar RPM-based environment for developing and debugging software that runs fully unprivileged using Podman.
Fedora 31 significantly improves the speed of update installation, as packages are now compressed with zstd instead of xz.
This commands let you to upgrading Fedora 30 to Fedora 31.
[root@desk mythcat]# dnf upgrade --refresh
...
[root@desk mythcat]# dnf install dnf-plugin-system-upgrade
...
[root@desk mythcat]# dnf remove xorg-x11-drv-nvidia-340xx-libs-1:340.107-4.fc30.x86_64
...
[root@desk mythcat]# dnf system-upgrade download --releasever=31
...
[root@desk mythcat]# dnf system-upgrade reboot
You can see I remove the xorg driver because system-upgrade don't let me to update.

Monday, November 4, 2019

Fedora 30 : How to remove packages without dependency.

In this tutorial, I will show you how to remove packages without dependency.
I have this software named freecad.x86_64 and I want to remove it.
If I use the dnf tool then I got this output:
[root@desk mythcat]# dnf remove freecad.x86_64 
Dependencies resolved.
==============================================================================
 Package                       Arch   Version                  Repo      Size
==============================================================================
Removing:
 freecad                       x86_64 1:0.18.3-5.fc30.1        @updates 141 M
Removing unused dependencies:
 Coin3                         x86_64 3.1.3-24.fc30            @fedora   11 M
 OCE-foundation                x86_64 0.18.3-4.fc30            @fedora   11 M
 OCE-modeling                  x86_64 0.18.3-4.fc30            @fedora   58 M
 OCE-ocaf                      x86_64 0.18.3-4.fc30            @fedora   11 M
 OCE-visualization             x86_64 0.18.3-4.fc30            @fedora  6.7 M
 SoQt                          x86_64 1.5.0-26.fc30            @fedora  1.0 M
 assimp                        x86_64 3.3.1-19.fc30            @fedora  9.7 M
 boost-python3                 x86_64 1.69.0-8.fc30            @updates 473 k
 dotconf                       x86_64 1.3-20.fc30              @fedora   61 k
 espeak-ng                     x86_64 1.49.2-6.fc30            @fedora  6.6 M
...
The package is from Nightly FreeCAD, you can enable it if you want to install later:
[root@desk mythcat]# sudo dnf copr enable @freecad/nightly
To solve this issue you need to change this file:
[root@desk mythcat]# vim /etc/dnf/dnf.conf
From clean_requirements_on_remove=True to clean_requirements_on_remove=False.
The next commands will fix and remove the package:
[root@desk mythcat]# dnf clean all
86 files removed
[root@desk mythcat]# dnf remove freecad.x86_64 
Dependencies resolved.
==============================================================================
 Package            Architecture Version                 Repository      Size
==============================================================================
Removing:
 freecad            x86_64       1:0.18.3-5.fc30.1       @updates       141 M
Removing dependent packages:
 freecad-data       noarch       1:0.18.3-5.fc30.1       @updates       194 M

Transaction Summary
==============================================================================
Remove  2 Packages

Freed space: 335 M
Is this ok [y/N]: 
...