Pages

Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, March 17, 2024

News : Flutter on Fedora 40.

Flutter transforms the development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded experiences from a single codebase.
Read more on the official webpage.
Theoretically, Flutter can be used much easier in the Fedora 40 Linux distribution than in a Windows operating system.
The Windows installation method requires more complicated steps with the use of S.D.K. and settings of Android Studio I.D.E. .
Here are the steps you need to follow for a default installation.
[mythcat@fedora ~]$ mkdir ~/FlutterProjects
[mythcat@fedora ~]$ cd FlutterProjects/
[mythcat@fedora ~]$ wget https://storage.googleapis.com/flutter_infra_release/releases
/stable/linux/flutter_linux_3.3.10-stable.tar.xz
[mythcat@fedora ~]$ tar xf flutter_linux_3.3.10-stable.tar.xz
[mythcat@fedora ~]$
...

[mythcat@fedora FlutterProjects]$ ./flutter/bin/flutter doctor

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
...

      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✗] Chrome - develop for the web (Cannot find Chrome executable at
    google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] VS Code (version 1.87.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

! Doctor found issues in 3 categories.
[mythcat@fedora FlutterProjects]$ ./flutter/bin/flutter upgrade

...

    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] VS Code (version 1.87.2)
[✓] Connected device (1 available)
[✓] Network resources

! Doctor found issues in 4 categories.

[mythcat@fedora FlutterProjects]$ ./flutter/bin/flutter config --enable-linux-desktop
Setting "enable-linux-desktop" value to "true".

You may need to restart any open editors for them to read new settings.

[mythcat@fedora FlutterProjects]$ mkdir examples
[mythcat@fedora FlutterProjects]$ cd examples/

[mythcat@fedora examples]$ ../flutter/bin/flutter create .
Creating project ....
Resolving dependencies... (5.1s)
Got dependencies.
Wrote 129 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider:
https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd .
  $ flutter run

Your application code is in ./lib/main.dart.

[mythcat@fedora examples]$ cd .
[mythcat@fedora examples]$ ls
analysis_options.yaml  ios    macos         README.md  windows
android                lib    pubspec.lock  test
examples.iml           linux  pubspec.yaml  web
[mythcat@fedora examples]$ ../flutter/bin/flutter run
The result is this simple default example:

Wednesday, February 21, 2024

News : SELinux wizzard tool !

I found today in Fedora linux this tool for SELinux with a GUI that allows creating linux security policies.
I will write a little about this system because it is a very good solution.
When I started studying selinux, it was not very well implemented and it seems that the interest of users to be protected is higher.
As you well know, the starting points are network security and data protection and kernel-level intrusions into software.
For those who don't know, SELinux is a system that allows limiting defined resources and allowing other actions or not.
I tested the tool and I can say that it solves only the standard file creation part without the possibility of selecting the SELinux bools variables.
If the one who created this tool will continue to be a very good tool.
It's currently a wizzard interface, I'd call it a Node Editor to allow the assembly of different processing blocks (nodes) into combinations that feed data to each other along connections you specify to produce complex effects.
After completing the steps in the wizard, you will have some default files.
I used the name firefox because the security of the browser is very low at the moment.
Here are some images of this tool:

Wednesday, January 31, 2024

Fedora 40 : Find version and GlibC flaw !

Because today I saw a video about the GlibC flaw that lets attackers get root on major distros, I will show an easy way to find the version of this lib with dnf and dnf5 tools:
[root@fedora var]# dnf in glibc
Last metadata expiration check: 0:04:06 ago on Wed 31 Jan 2024 10:25:13 PM EET.
Package glibc-2.38.9000-35.fc40.x86_64 is already installed.
Package glibc-2.38.9000-35.fc40.i686 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@fedora var]# dnf5 in glibc
Updating and loading repositories:
Repositories loaded.
Package "glibc-2.38.9000-35.fc40.x86_64" is already installed.
Package "glibc-2.38.9000-35.fc40.i686" is already installed.
You can see in the name is add the version: 2.38.9000-35.fc40.x86_64.
This is the video about GlibC from Bits inside by René Rebe.

Wednesday, December 27, 2023

Fedora 39 : Fixing common upgrade issues.

The most common issue is that the Linux system hangs due to disk space and upgrades.
Here's what you need to do:
Ensure you have root access by editing the boot sequence from the boot menu with the word single and entering the root password.
... start the network in the maintenance environment with the command:
# systemctl restart NetworkManager
Check if you can update with the DNF5 tool or DNF , see this webpage:
# dnf5 upgrade --refresh
If the update tool tells you that you have no space available, then you can clean up with:
# journalctl --disk-usage
# journalctl --vacuum-size=16M
The size of 16M is a relative size related to how the resource is allocated!
Another possibility would be to reallocate the space.
NOTE: If you are using a virtual disk with .vdi extension on Windows OS, then I don't have a solution.
Although virtualbox has an interface that would allow resizing the virtual disk, it didn't work for me.

Thursday, December 14, 2023

Fedora 39 : Foot - the sway terminal.

Today, I will show how to use a fast, lightweight, and minimalistic Wayland terminal emulator named Foot.
You can install it easily with the DNF5 tool :
The project can be found on this codeberg repo.
On the sawy desktop environment, you can use Win+D keys just to type a command to start an application.
You can start easily by typing foot or you can type on an open terminal, see:
[mythcat@fedora ~]$ foot
warn: wayland.c:1509: fractional scaling not available
warn: wayland.c:1512: no server-side cursors available, falling back to client-side cursors
warn: fcft.c:583: failed to get full font name
warn: fcft.c:583: failed to get full font name
I used updatedb and locate commands to find the foot.ini file and change some settings like font size, and more :

Sunday, September 3, 2023

Fedora 39 : Issues in Fedora with PyGobject and sway-tests.

Today I wanted to test this repo named sway-tests.
I followed the steps there and received an error from gi.repository.
This error is related to another issue related to PyGobject.
In Fedora Linux distro, installing PyGobject is done with pip like this:
$ pip install PyGobject
In order to have no errors, the dnf or dnf5 tool should be used like this ...
I tested the functionality of this installation with a simple example:
import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
It worked very well.
After solving this issue, I returned to the initial one and tested the sway-tests.
$ whereis sway
$ env/bin/pytest --sway=/usr/bin/sway
$ sudo env/bin/pytest --sway=/usr/bin/sway
I used the command both with and without sudo.
Both generated the same errors.
For the following command I had to install ... xorg-x11-server-Xephyr:
Xephyr is an X server which has been implemented as an ordinary X application. It runs in a window just like other X applications, but it is an X server ...
... the fixed centered black window specific to the xorg runtime appeared and somewhere on the side the terminal showed me a bunch of errors.
... obviously, I don't know how well sway-tests is implemented, now it's an archived repo, but I solved the use of PyGobject in python on the Fedora linux distribution.

Wednesday, August 9, 2023

Fedora 38 : Openbox from GitHub.

I tried to use the OpenBox desktop environment in Fedora 38 and it seems to be incomplete, see also this thread.
I try to build the Openbox desktop from the source code, see the GitHub project.
$ git clone https://github.com/danakj/openbox.git
$ cd openbox
I need to install these: gettext-devel, glib2-devel, libtool, and pango-devel.X86_64 all devel libraries with dnf tool ...
Use the next commands, you will see some errors about some deprecated libraries and source code when you use the make command.
$ ./bootstrap
$ ./configure
$ make 
The go-to openbox folder to see the result:
$ cd openbox
$ ls -lFGC
The last step is to run the Openbox after you solve these:
Failed to open the display from the DISPLAY environment variable.
Openbox-Message: A window manager is already running on screen 0.
Because you are into environment area you need to close it.
After several attempts, I managed to pass these issues and ran the command:
$ ./xinit
This is the result is this:
I don't really have skills in this field of changes in Linux distributions and I wouldn't want to give wrong indications.

Wednesday, July 26, 2023

Fedora 39 : First test with C# and Terminal.Gui.templates.

The current, stable, release of Terminal.Gui is v1.x. It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as v2.
You can find it on this GitHub project.
$ dotnet new --install Terminal.Gui.templates
$ dotnet new tui -n test001
$ cd test001
$ dotnet run

Tuesday, July 25, 2023

Fedora 39 : Install and fix error with dotnet and copr.

Copr is an easy-to-use automatic build system providing a package repository as its output.
Free/Open source software that is harder to include in Fedora (usually because it is developed in a way that makes it difficult to package while implementing the Fedora packaging guidelines) is temporarily provided in an extra COPR repository, see the official webpage.
I tried to install dotnet following a tutorial on Fedora Magazine:
# dnf copr enable @dotnet-sig/dotnet
I obviously received errors related to copr, because is not install and I used Fedora 39, since Fedora 39 is still Rawhide.
I try to install copr with dnf5:
# dnf5 install copr
I got some errors on python-request-2.28.2-2.fc39.noarch conflicts with new one requested by dnf5 and I remove this package and I let to install the new one.
I try again with same command:
# dnf5 install copr
The next command was:
$ sudo dnf copr enable @dotnet-sig/dotnet fedora-38-x86_64
This allow me to use fedora-38-x86_64 and warn me about copr.
Enabling a Copr repository. Please note that this repository is not part
of the main distribution, and quality may vary ...
The last one is to install .NET Core:
# dnf5 install dotnet
This install all packages for .NET Core with SDK version 6.0 .
I tested with a simple project:
$ dotnet new console -o mythcat_console
$ cd mythcat_console
$ dotnet run 
Hello, World!
This is the way that can use Fedora packages with copr.

Thursday, July 20, 2023

Fedora 39 : Solve copy-paste in VirtualBox.

I'm using the Fedora 39 Linux distribution on an HP laptop and I also have it installed on a VirtualBox on my work computer. Today I will show you a way to solve copy paste between content on your computer and Fedora 39 on VirtualBox.
This requires Virtual Box to be set to bridge network as in the attached image.
The next step is to have the Cockpit tool installed, see instructions here.
Open the web address created by the Cockpit tool in your computer browser and go to the Terminal section. This way you will be able to transfer text content using your computer's browser and not the VirtualBox settings.
See the next image:

Saturday, July 8, 2023

Fedora 39 : DNF5 error update.

Sometimes errors may occur when installing Fedora packages using the dnf or dnf5 utility. One of the reasons may result from the coincidence of the package installation process. If you know how to build packages, how to develop the Fedora team, and how many repositories you have set up in your Linux distribution, then such an error can be easily fixed. Here is the error:
First, install the dnf5 and dnf5-plugins with this command:
sudo dnf install dnf5 dnf5-plugins
One good way to fix error is to have defined settings in : /etc/dnf/dnf.conf in order to have a good installation flow and how to link packages to the interconnected job.
See my example that fix this error:
Some packages may conflict in the repo and you can check with the dnf info fedora_repo_package command.
For example, you can use exclude=*.noarch in the [main] area.

Tuesday, May 23, 2023

Fedora 39 : Share folder with Fedora on VirtualBox.

To share a folder called share between the Windows operating system and Fedora 39 using VirtualBox, the folder must be created and added to the settings as follows:
In VirtualBox, make sure the Fedora virtual machine is stopped.
Select the Fedora virtual machine in the list of virtual machines and click the "Settings" button on the top bar of the VirtualBox window.
In the "Settings" window of the virtual machine, select the "Shared Folders" category.
Click the "+" button on the right to add a new shared folder.
In the "Add Share" window, specify the following details:
Folder Path: Browse to and select the C:\share folder on the host.
Folder Name: You can enter a name for the shared folder.
Select the access options you want, such as "Auto-mount" and "Make Permanent".
Click the "OK" button to save the settings.
Start the Fedora virtual machine and on the Fedora virtual machine, open a terminal and run the following command to mount the shared folder:
You can see the file test.txt is visible in Fedora.

Sunday, May 21, 2023

Fedora 39 : Regular expressions with gedit editor.

Regular expressions can be used in the gedit editor using the Find and Replace option with the regular expressions checkbox selected. This can be used to remove empty lines from source code, remove comment lines, replace indexing - if using Python scripts, or replace content. Here's an example of how to remove empty lines from a text using regular expressions:

Friday, May 19, 2023

Fedora 39 : Using a stick or hard disk created in Windows.

When attached to USB, Linux distribution cannot access it.
Install these packages with the DNF utility.
sudo dnf install ntfs-3g
sudo dnf install ntfsfix
Use these commands to create a folder where it will be mounted and test if it can be mounted and where it is viewed :
sudo mkdir /mnt/mydrive
sudo mount -t ntfs-3g /dev/sdb1 /mnt/mydrive
dmesg| grep usb 
sudo mount /dev/sdb /mnt/mydrive
df -h
Fix errors with this command
sudo umount /dev/sdb1
sudo ntfsfix /dev/sdb1
It resumes the operation of mounting it in the folder named /mnt/mydrive:
sudo mount -t ntfs-3g /dev/sdb1 /mnt/mydrive
This command will mount as a superuser but can be modified as a normal user.
Create a USB folder into your home folder as normal user.
You can use these commands to use your files like a normal user:
[mythcat@fedora ~]$ sudo mount -t ntfs-3g /dev/sdb1 ~/USB
[sudo] password for mythcat: 
...
[mythcat@fedora ~]$ sudo umount /dev/sdb1

Monday, May 8, 2023

Fedora 39 : The vifm file manager ...

My monitor broke a few days ago so i'm using an old laptop. Website posts will be less frequent.
You can use the vifm file manager in Fedora 39 easy.
Use the DNF command tool to install it.
[root@fedora mythcat]# dnf install vifm
See the result of this file manager:

Monday, May 1, 2023

Fedora 39 : GPT on linux terminal.

The ChatGPT is possible in your Windows, macOS, and Linux terminal ... tgpt is a cross-platform cli (commandline) tool that lets you use ChatGPT 3.5 in Terminal without API KEYS. It communicates with the Backend of Bai chatbot. Its written in Go. You can see the source code on this GitHub project.

Saturday, April 29, 2023

Fedora 39 : Fedora 39 Cinnamon environment pre-release - upgrade.

Today I tested the new version of fedora 39 and it worked very well.
If you want to upgrade Fedora using the DNF system upgrade then you can find all information on the official webpage.
You can try a Fedora 39 Cinnamon environment pre-release from this website.
A very good feature comes with this new command remove-retired-packages.
This allow you to keep the all packages with update.

Thursday, February 2, 2023

Fedora 38 : LibreOffice with new features.

LibreOffice is a free and powerful office suite, and a successor to OpenOffice.org (commonly known as OpenOffice). Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity... see the official website.
I install easy with DNF tool on Fedora 38:
[root@fedora mythcat]# dnf install libreoffice.x86_64
Last metadata expiration check: 1:13:09 ago on Thu 02 Feb 2023 05:03:42 PM EET.
Dependencies resolved.
================================================================================
 Package                         Arch     Version               Repo       Size
================================================================================
Installing:
 libreoffice                     x86_64   1:7.5.0.2-2.fc38      rawhide    15 k
Installing dependencies:
 apache-commons-collections      noarch   3.2.2-29.fc38         rawhide   531 k
 apache-commons-lang3            noarch   3.12.0-7.fc38         rawhide   559 k
 firebird                        x86_64   4.0.2.2816-4.fc38     rawhide   5.1 M
 firebird-utils                  x86_64   4.0.2.2816-4.fc38     rawhide   2.1 M
 flute                           noarch   1.3.0-31.OOo31.fc38   rawhide    64 k
 javapackages-tools              noarch   6.1.0-7.fc38          rawhide    37 k
 libbase                         noarch   1.1.3-36.fc38         rawhide   130 k
 libfbclient2                    x86_64   4.0.2.2816-4.fc38     rawhide   860 k
 libfonts                        noarch   1.1.3-40.fc38         rawhide   177 k
 libformula                      noarch   1.1.3-37.fc38         rawhide   340 k
 libib-util                      x86_64   4.0.2.2816-4.fc38     rawhide    12 k
 liblayout                       noarch   0.2.10-30.fc38        rawhide   654 k
 libloader                       noarch   1.1.3-38.fc38         rawhide   130 k
 libreoffice-base                x86_64   1:7.5.0.2-2.fc38      rawhide   2.3 M
 libreoffice-draw                x86_64   1:7.5.0.2-2.fc38      rawhide    23 k
 libreoffice-math                x86_64   1:7.5.0.2-2.fc38      rawhide    20 k
 librepository                   noarch   1.1.3-37.fc38         rawhide    68 k
 libserializer                   noarch   1.1.2-36.fc38         rawhide    36 k
 ongres-scram                    noarch   2.1-8.fc38            rawhide    65 k
 ongres-scram-client             noarch   2.1-8.fc38            rawhide    24 k
 ongres-stringprep               noarch   1.1-6.fc38            rawhide    74 k
 pentaho-libxml                  noarch   1.1.3-36.fc38         rawhide   101 k
 pentaho-reporting-flow-engine   noarch   1:0.9.4-29.fc38       rawhide   285 k
 postgresql-jdbc                 noarch   42.5.1-2.fc38         rawhide   836 k
 sac                             noarch   1.3-41.fc38           rawhide    19 k
 velocity                        noarch   1.7-40.fc38           rawhide   386 k

Transaction Summary
================================================================================
Install  27 Packages

Total download size: 15 M
Installed size: 46 M
Is this ok [y/N]: y  
...
This software works good on my old laptop:
You can see a video from the official youtube channel with the new features:

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:

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.