Pages

Showing posts with label Fedora 37. Show all posts
Showing posts with label Fedora 37. Show all posts

Tuesday, January 31, 2023

Fedora 37 : Lite editor.

lite is a lightweight text editor written mostly in Lua — it aims to provide something practical, pretty, small and fast, implemented as simply as possible; easy to modify and extend, or to use without doing either.
I install with DNF tool:
# dnf install lite-xl.x86_64
...
Installed:
  lite-xl-2.1.1-2.fc38.x86_64                                                   

Complete!
... and works very well:

Monday, December 26, 2022

Fedora 37 : SeLinux alert detection from Trend Micro HouseCall.

If you use the tool from Trend Micro HouseCall for Home Networks, then it is possible that the SELinux tool from Fedora Linux will warn you with an alert.
It can be easily fixed with the following commands.
[root@fedora mythcat]# ausearch -c 'journal-offline' --raw | audit2allow -M my-journaloffline
******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i my-journaloffline.pp

[root@fedora mythcat]# semodule -X 300 -i my-journaloffline.pp
libsemanage.semanage_get_lock: Could not get direct transaction lock at /var/lib/selinux/targeted/semanage.trans.LOCK. (Resource temporarily unavailable).
Because I got an access error to the resource, I used some Linux commands that checked the status of my selinux, I searched and stopped the process that doesn't let me access the resource and restarted the command:
[root@fedora mythcat]# cat /etc/selinux/config


SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted




[root@fedora mythcat]# ps aux | grep semodule
root        3974  4.2  5.2 211904 209952 pts/0   T    13:29   0:17 semodule -X 300 -i my-journaloffline.pp
root        4032  0.0  0.0 222424  2288 pts/0    S+   13:36   0:00 grep --color=auto semodule
[root@fedora mythcat]# kill -9 3974
[root@fedora mythcat]# semodule -X 300 -i my-journaloffline.pp
[1]+  Killed                  semodule -X 300 -i my-journaloffline.pp
[root@fedora mythcat]# semodule -X 300 -i my-journaloffline.pp
This is how the Selinux alert appears in the environment of the Fedora 37 Linux distribution.

Saturday, November 19, 2022

Fedora 37 : Vala development in Fedora 37.

Yesterday I tested the Vala programming language on the Fedora 37 linux distribution. The basic idea was that most linux distribution environments use the GTK+ toolkit that Gnome developed. Development with GTK+ can be done with various programming languages: c, python, rust... The main reason why I tested the implementation of the Vala programming language was that Gnome developed it.
For the installation, I used the DNF utility with the following commands to install the packages necessary for the operation of the development in Vala
$sudo dnf groupinstall "Development Tools" "Development Libraries"
$ sudo dnf install vala
The first command installs the tools that are essential to perform tasks such as installing packages from source code.
The second command only installs the Vala package.
To test the written program we will need to use the Valac compiler and then run it as a simple executable in Linux.
$valac --pkg gtk+-3.0 test.vala 
$ ./test

(test:6198): GLib-GObject-CRITICAL **: 14:34:11.454: g_value_set_boxed: assertion 'G_VALUE_HOLDS_BOXED (value)' failed 
The error is about the implementation of Vala in Fedora, I don't have an answer of this but in other Linux distributions this is not show.
If you want to use WebKit2GTK+ Extensions then you need to compile it.
valac test.vala  --pkg gtk+-3.0 --pkg webkit2gtk-4.0
Is a more easy way to developm application but you need to know well how to deal with GTK and GObject structure.

Tuesday, September 20, 2022

Fedora 37 : Use radiotray-ng to simple radio player.

Radiotray-NG is a simple radio player for Ubuntu that runs from the system tray.
You can use this command to install the package.
dnf install radiotray-ng
After installation, you will see an icon on the tray area.
Use this to select the radio and this will play it.
The project can be found on GitHub.
.

Saturday, September 10, 2022

Fedora 37 : Starting with the conda tool.

In this tutorial, I will show the first steps for working with conda tool on Fedora 37.
Conda is an open-source package management system and environment management system that runs on Windows, macOS, Linux, and z/OS. Conda quickly installs, runs, and updates packages and their dependencies. Conda easily creates, saves, loads, and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language., see the official webpage.
I used the DNF tool to install this tool.
[root@fedora mythcat]# dnf install conda
By default, Conda is configured to activate the base environment when I open a fresh terminal session and you can set it to false.

[mythcat@fedora ~]$ conda config --set auto_activate_base false
For the changes to be applied, run the source command with the .bashrc file as an argument.

[mythcat@fedora ~]$ source ~/.bashrc
After installation, the conda can be activated with the base environment.

[mythcat@fedora ~]$ conda activate
(base) [mythcat@fedora ~]$ conda deactivate
[mythcat@fedora ~]$
Let's start a new project environment named test001 with this command:

[mythcat@fedora ~]$ conda create -n test001 python=3.9
...
  zlib               pkgs/main/linux-64::zlib-1.2.12-h5eee18b_3
Proceed ([y]/n)? y
Downloading and Extracting Packages
libffi-3.3           | 50 KB     | ##################################### | 100%
...
setuptools-63.4.1    | 1.1 MB    | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate test001
#
# To deactivate an active environment, use
#
#     $ conda deactivate
The next step is to activate this with the next command and list installed packages in a conda environment.

[mythcat@fedora ~]$ conda activate test001
(test001) [mythcat@fedora ~]$ conda list
If you want to see all environments then use the next command:

(test001) [mythcat@fedora ~]$ conda env list
# conda environments:
#
test001               *  /home/mythcat/.conda/envs/test001
base                     /usr
The basic usage of conda is to install packages, you can see how to install the scipy package with the next command:

(test001) [mythcat@fedora ~]$ conda install scipy
Using the conda tool.
Also, you can update a package like the pip tool, see the next command:

(test001) [mythcat@fedora ~]$ conda update
CondaValueError: no package names supplied
# Example: conda update -n myenv scipy 
You can deactivate/deactivate the environment with these commands:

(test001) [mythcat@fedora ~]$ conda deactivate
[mythcat@fedora ~]$ conda activate test001
(test001) [mythcat@fedora ~]$ 
You can export the conda environment into YML file type:

(test001) [mythcat@fedora ~]$ conda env export > test001.yml
(test001) [mythcat@fedora ~]$ ls test001.yml
test001.yml 
With this file, you can create a new environment in another area, and see the next commands for deactivating and creating the new environment.

(test001) [mythcat@fedora ~]$ conda deactivate
[mythcat@fedora ~]$ ls
Desktop    Downloads     Music     Public     test001.yml
Documents  kernel-tests  Pictures  Templates  Videos
[mythcat@fedora ~]$ conda env create -f test001.yml
CondaValueError: prefix already exists: /home/mythcat/.conda/envs/test001
Because I try to create in the same place as the old environment I got this error.
You need to use the YML file in another place.
Another option is to clone one environment.

[mythcat@fedora ~]$ conda create --name test001_new_clone --clone test001
Source:      /home/mythcat/.conda/envs/test001
Destination: /home/mythcat/.conda/envs/test001_new_clone
Packages: 34
...
You can see all environments with this command:

[mythcat@fedora ~]$ conda info --env
# conda environments:
#
test001                  /home/mythcat/.conda/envs/test001
test001_new_clone        /home/mythcat/.conda/envs/test001_new_clone
base                  *  /usr
These commands shown are just the beginning of working with the conda utility. It has many more development options.

Wednesday, August 24, 2022

Fedora 37 : Kernel Test Days.

The main goal of a Kernel Test Day is to test a new kernel on many different machines as possible ...
To test the kernel and help the Fedora development team you need to run one tool from Fedora.
I used DNF to install the fedora python package.
[root@fedora kernel-tests]# dnf install python3-fedora.noarch
...
Installed:
  python3-fedora-1.1.1-7.fc37.noarch                                            
  python3-kitchen-1.2.6-14.fc37.noarch                                          
  python3-lockfile-1:0.12.2-8.fc37.noarch                                       
  python3-munch-2.5.0-10.fc37.noarch                                            
  python3-openidc-client-0.6.0-17.20220119git0e2ed81.fc37.noarch                

Complete!
I install the Development Tools group for development issues.
[mythcat@fedora kernel-tests]$ sudo dnf -y groupinstall "Development Tools"
I clone the kernel-tests tool from the GitHub repository.
[mythcat@fedora ~]$ git clone https://pagure.io/kernel-tests.git
Cloning into 'kernel-tests'...
Into the folder kernel-tests set your user and password to send data to the Fedora development team.
[mythcat@fedora ~]$ cd kernel-tests/
[mythcat@fedora kernel-tests]$ cp config.example .config
[mythcat@fedora kernel-tests]$ vi .config
Set the SELinux settings, if this is enabled.
[mythcat@fedora kernel-tests]$ sudo semanage boolean -m --on selinuxuser_execheap
I run both tests, like in the documentation area.
See these results of my tests on HP Compaq 6710b laptop:
[mythcat@fedora kernel-tests]$ sudo ./runtests.sh
[sudo] password for mythcat:
Test suite called with default
./default/cachedrop                                              PASS    
./default/insert_leap_second                                     PASS    
./default/libhugetlbfs                                           SKIP    
./default/memfd                                                  PASS    
./default/modsign                                                PASS    
./default/mq-memory-corruption                                   PASS    
./default/paxtest                                                SKIP    
./default/posix_timers                                           PASS    
./default/selinux-dac-controls                                   PASS    
./default/stack-randomness                                       PASS    
./default/sysfs-perms                                            WARN    
./default/timer-overhead                                         PASS    

Test suite complete                                              WARN    

Your log file is being submitted...
Upload successful!
The following information is not submitted with your log;
it is for informational purposes only.
Vulnerability status:
/sys/devices/system/cpu/vulnerabilities/itlb_multihit:KVM: Mitigation: VMX unsupported
/sys/devices/system/cpu/vulnerabilities/l1tf:Mitigation: PTE Inversion
/sys/devices/system/cpu/vulnerabilities/mds:Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: PTI
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data:Not affected
/sys/devices/system/cpu/vulnerabilities/retbleed:Not affected
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Mitigation: usercopy/swapgs barriers and __user pointer sanitization
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Retpolines, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected
/sys/devices/system/cpu/vulnerabilities/srbds:Not affected
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort:Not affected

[mythcat@fedora kernel-tests]$ sudo ./runtests.sh -t performance
Test suite called with performance
Using config in CONFIG.fedora
Sun Aug 21 05:19:23 PM EEST 2022
Latency measurements
Sun Aug 21 05:21:46 PM EEST 2022
Calculating file system latency
Sun Aug 21 05:21:48 PM EEST 2022
Local networking
Sun Aug 21 05:25:29 PM EEST 2022
Bandwidth measurements
Sun Aug 21 05:34:57 PM EEST 2022
Calculating context switch overhead
Sun Aug 21 05:35:20 PM EEST 2022
./performance/lmbench3                                           PASS    

Test suite complete                                              PASS    

Your log file is being submitted...
Upload successful!
The following information is not submitted with your log;
it is for informational purposes only.
Vulnerability status:
/sys/devices/system/cpu/vulnerabilities/itlb_multihit:KVM: Mitigation: VMX unsupported
/sys/devices/system/cpu/vulnerabilities/l1tf:Mitigation: PTE Inversion
/sys/devices/system/cpu/vulnerabilities/mds:Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: PTI
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data:Not affected
/sys/devices/system/cpu/vulnerabilities/retbleed:Not affected
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Mitigation: usercopy/swapgs barriers and __user pointer sanitization
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Retpolines, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected
/sys/devices/system/cpu/vulnerabilities/srbds:Not affected
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort:Not affected

Monday, August 22, 2022

Fedora 37 : Install PyQt5 and PyQt6 on Fedora.

In this tutorial, I will show you how to install PyQt5 and PyQt6 on Fedora 37 Distro Linux.
I used the DNF tool on the sudo user.
To install PyQt5 I used this command:
[root@fedora mythcat]# dnf install python3-qt5.x86_64
Last metadata expiration check: 2:20:40 ago on Wed 17 Aug 2022 09:42:57 PM EEST.
Dependencies resolved.
...
Installed:
  openal-soft-1.22.2-2.fc37.x86_64                                              
  python-qt5-rpm-macros-5.15.6-7.fc37.noarch                                    
  python3-pyqt5-sip-12.11.0-2.fc37.x86_64                                       
  python3-qt5-5.15.6-7.fc37.x86_64                                              
  python3-qt5-base-5.15.6-7.fc37.x86_64                                         
  qt5-qtconnectivity-5.15.5-2.fc37.x86_64                                       
  qt5-qtlocation-5.15.5-3.fc37.x86_64                                           
  qt5-qtmultimedia-5.15.5-2.fc37.x86_64                                         
  qt5-qtsensors-5.15.5-2.fc37.x86_64                                            
  qt5-qtserialport-5.15.5-2.fc37.x86_64                                         
  qt5-qtsvg-5.15.5-2.fc37.x86_64                                                
  qt5-qttools-common-5.15.5-2.fc37.noarch                                       
  qt5-qttools-libs-designer-5.15.5-2.fc37.x86_64                                
  qt5-qttools-libs-help-5.15.5-2.fc37.x86_64                                    
  qt5-qtwebchannel-5.15.5-2.fc37.x86_64                                         
  qt5-qtwebsockets-5.15.5-2.fc37.x86_64                                         
  qt5-qtxmlpatterns-5.15.5-2.fc37.x86_64                                        

Complete!
If you want to use PyQt6 then you need to use the sip solution.
Let's search and install it with the DNF tool.
[root@fedora mythcat]# dnf search qt6 | grep python
Last metadata expiration check: 1:02:01 ago on Sun 21 Aug 2022 04:43:24 PM EEST.
python3-pyqt6-sip.x86_64 : The sip module support for PyQt6
[root@fedora mythcat]# dnf install python3-pyqt6-sip.x86_64
Last metadata expiration check: 1:02:24 ago on Sun 21 Aug 2022 04:43:24 PM EEST.
Dependencies resolved.
...
Installed:
  python3-pyqt6-sip-13.3.0-3.fc37.x86_64                                        

Complete!
I used the python command and I import PyQt5 and PyQt6
[mythcat@fedora ~]$ python
Python 3.11.0rc1 (main, Aug  9 2022, 00:00:00) [GCC 12.1.1 20220810 (Red Hat 12.1.1-4)] on linux
...
The python modules are installed and working well.

Monday, August 15, 2022

Fedora 37 : About DNF tool.

DNF's name tool comes from Dandified YUM.
You can find all about this tool in the Fedora documentation area.
As you know the YUM is in use on older systems and comes from Yellowdog Updater, Modified.
All of these tools need to have sudo that gives you administrative access to your system.
When you run the DNF tool this will checks for metadata automatically whenever you begin a system update or otherwise install software from repositories.
For this reason, the update and upgrade commands perform the same function.
Let's see the basic usage of the DNF tool:
Search a fedora package named FedoraPackage in the repositories.
sudo dnf search FedoraPackage
Install the FedoraPackage package if exist in the repository.
sudo dnf install FedoraPackage
If you want to uninstall the package FedoraPackage use this:
sudo dnf remove FedoraPackage
I can reinstall the package FedoraPackage
sudo dnf reinstall FedoraPackage -y
To automatically remove unneeded dependencies, use:
sudo dnf autoremove
The DNF can find out which package provides a particular file.
sudo dnf provides /etc/httpd/conf/httpd.conf
The detailed information of a package can be viewed with:
sudo dnf info httpd
The DNF history contains all actions that have been performed by the DNF command.
sudo dnf history
I can view further information about a transaction by specifying its ID:
sudo  dnf history info 13
I can undo this transaction if we want:
sudo dnf history undo 13 -y
I can redo with:
sudo dnf history redo 13 -y
The DNF will cache data to the /var/cache/dnf directory and I clean it with:
dnf clean all
I have the option to manually make the cache so that future actions will be quicker.
sudo time dnf makecache
The DNF tool gives me the ability to list all packages that are currently installed on our Linux system:
sudo dnf list installed
Packages that are related to each other may be grouped together into a package group.
sudo dnf grouplist
I can install it with this command:
sudo dnf groupinstall "Web Server" -y
I can check if an update is available
sudo dnf check-update
I can ignore an update for the FedoraPackage package with this command:
sudo dnf update -x FedoraPackage
I can use it for automatic tasks such as updating regularly via cron jobs.
sudo  dnf install dnf-automatic -y
I can install security only
sudo dnf updateinfo list sec
I can see displays information for enabled repositories only:
sudo dnf repolist
I can see all of the repositories
sudo dnf repolist all
Set update testing with:
sudo dnf config-manager --set-enable updates-testing
Disable update testing:
sudo dnf config-manager --set-disable updates-testing
You can list packages from a specified repository, for instance, FedoraPackage:
sudo dnf repository-packages FedoraPackage list
To display only a list of those packages available from the specified repository, add the available option.
sudo dnf repository-packages fedora list available
To display only a list of those packages installed from the specified repository, add the installed option
sudo dnf repository-packages fedora list installed
To add and enable a new repository like Grafana, run the following command.
Open a new file named grafana.repo:
sudo nano /etc/yum.repos.d/grafana.repo
Add this in the grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
sudo dnf config-manager --add-repo /etc/yum.repos.d/grafana.repo
To enable the DNF repository
sudo dnf --enablerepo=grafana install grafana
To disable a DNF repository
sudo dnf --disablerepo=fedora-extras install grafana 
To permanently disable a particular repository
sudo dnf config-manager --set-disabled grafana
These are just a few basic ways to use the DNF utility.

Fedora 37 : First test with the Fedora Cinnamon spin.

The Fedora Cinnamon spin provides advanced innovative features and a traditional user experience.
I install this Fedora Spin from the official website.
I installed it again without an update.
It seemed faster than the old distro 36 with the Mate environment.
Here is a screenshot of Fedora 37 on the HP C6710b laptop.