Pages

Friday, January 15, 2021

Fedora 33 : Using the finch chat program.

Finch is a TUI (text user interface) IM client for Linux which uses libpurple.
This is very useful when you want to chat and don't have an environment to install Fedora on.
Finch is built using the ncurses toolkit, which is a library designed especially to built text user interfaces.
This program lets you sign on to Jabber, GoogleTalk, IRC, and other IM networks. 
After this was built the Pidgin application.
Let's install it with the DNF tool:
[root@desk mythcat]# dnf install finch.x86_64
...
Installed:
  finch-2.14.1-2.fc33.x86_64                             libgnt-2.14.0-3.fc33.x86_64                            

Complete!
You can find all information using the man command:
[mythcat@desk ~]$ man finch 
You can run it easy with this command:
[mythcat@desk ~]$ finch
After that, you can see the windows form for your account.
You can see one example with my IRC account:
If not you can select it by pressing the keys: Alt+A and select Accounts.
Use the Tab key and select Modify.
The new window form lets you set your account.
In the next image, you can see some settings for my IRC account.
Another important element is that this interface can be customized using the file named .gntrc.
Open it with your editor, I used vi editor:
[mythcat@desk ~]$ vi ~/.gntrc
I make these changes to use the mouse:
[general]
mouse = 1
Although the manual page says the mouse support is still experimental.
I install the GPM - a cut and paste utility and mouse server for virtual consoles.
[root@desk mythcat]# dnf install gpm.x86_64 
...
[root@desk mythcat]# systemctl status gpm
● gpm.service - Console Mouse manager
     Loaded: loaded (/usr/lib/systemd/system/gpm.service; enabled; vendor prese>
     Active: inactive (dead)
...
[root@desk mythcat]# systemctl enable gpm 
[root@desk mythcat]# systemctl status gpm 
● gpm.service - Console Mouse manager
     Loaded: loaded (/usr/lib/systemd/system/gpm.service; enabled; vendor prese>
     Active: inactive (dead) since Fri 2021-01-15 15:35:56 EET; 6min ago
   Main PID: 15241 (code=exited, status=0/SUCCESS)
        CPU: 2ms

Jan 15 15:35:32 desk systemd[1]: Starting Console Mouse manager...
Jan 15 15:35:32 desk /usr/sbin/gpm[15314]: O0o.oops(): [daemon/check_uniqueness>
Jan 15 15:35:32 desk systemd[1]: Started Console Mouse manager.
Jan 15 15:35:32 desk /usr/sbin/gpm[15314]: gpm is already running as pid 15241
The GPM can be configureted to set your mouse settings.
I restart my Fedora 33 Linux distro and works very well with the mouse.

Tuesday, December 29, 2020

Fedora 33 : Fixes and changes for wordpress - part 001.

If you have the latest version of WordPress installed, then you may encounter this error when trying to add a new page or post.
Publishing failed. The response is not a valid JSON response.
The problem is with how to edit posts.
One solution would be to install this plugin.
The process of installing the new WordPress or making changes does not allow you to add new plugins to the Plugins menu.
Download the Classic Editor plugin to unzip and then copy it to the plugins folder.
[root@desk mythcat]# cp -r -f /home/mythcat/classic-editor/ /usr/share/wordpress/wp-content/plugins/
Activate this plugin and now you can create and edit pages and posts in WordPress.

Friday, December 25, 2020

Fedora 33 : Use Visual Code on root account.

Sometimes creating or modifying files that have root permissions is required.
I use the following command to run Visual Code with these permissions:
sudo code --user-data-dir="~/.vscode-root"

Thursday, December 24, 2020

Fedora 33 : Install wordpress on Fedora distro.

For those who are celebrating the winter holidays with the Linux operating system, I have created this little tutorial...
The first step - update and upgrade the Fedora 33 Linux distro.
[root@desk mythcat]# dnf update
...
Nothing to do.
Complete!
[root@desk mythcat]# dnf upgrade
...
Nothing to do.
Complete!
Install all packages for WordPress package:
[root@desk mythcat]# dnf install @"Web Server" php-mysqlnd mariadb-server
Last metadata expiration check: 1:10:28 ago on Thu 24 Dec 2020 12:59:20 PM EET.
Package php-mysqlnd-7.4.13-1.fc33.x86_64 is already installed.
No match for group package "powerpc-utils"
No match for group package "lsvpd"
Dependencies resolved.
...
Complete!
Finds the packages providing for WordPress.
[root@desk mythcat]# dnf provides wordpress
Last metadata expiration check: 1:13:24 ago on Thu 24 Dec 2020 12:59:20 PM EET.
wordpress-5.5.1-1.fc33.noarch : Blog tool and publishing platform
Repo        : fedora
Matched from:
Provide    : wordpress = 5.5.1-1.fc33

wordpress-5.6-1.fc33.noarch : Blog tool and publishing platform
Repo        : updates
Matched from:
Provide    : wordpress = 5.6-1.fc33
Install WordPress with DNF tool:
[root@desk mythcat]# dnf install wordpress
...
  Verifying        : php-simplepie-1.5.4-3.fc33.noarch                      7/7 

Installed:
  libc-client-2007f-26.fc33.x86_64      php-IDNA_Convert-0.8.0-14.fc33.noarch   
  php-getid3-1:1.9.20-2.fc33.noarch     php-imap-7.4.13-1.fc33.x86_64           
  php-phpmailer6-6.1.8-1.fc33.noarch    php-simplepie-1.5.4-3.fc33.noarch       
  wordpress-5.6-1.fc33.noarch          

Complete!
Allow firewall in case it is running on your system.
[root@desk mythcat]# firewall-cmd --add-port=80/tcp --permanent
success
[root@desk mythcat]# firewall-cmd --reload
success
If SELinux is running, run the commands to allow database and sendmail:
[root@desk mythcat]# setsebool -P httpd_can_network_connect_db=1
[root@desk mythcat]# setsebool -P httpd_can_sendmail=1
Enable systemctl services for WordPress:
[root@desk mythcat]# systemctl start httpd
...
[root@desk mythcat]# systemctl enable httpd
...
[root@desk mythcat]# systemctl enable mariadb
...
[root@desk mythcat]# systemctl start mariadb
...
Set up the MySQL service for WordPress:
[root@desk mythcat]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n
 ... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
Create a database named mysite for WordPress:
[root@desk mythcat]# mysqladmin create mysite -u root -p 
Enter password: 
[root@desk mythcat]# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 25
Server version: 10.4.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysite             |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.000 sec)

MariaDB [(none)]> grant all privileges on mysite.* to testadmin@localhost identified by 'TESTtest!';
Query OK, 0 rows affected (0.019 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> quit;
Bye
Set WordPress default configuration file named wp-config.php:
[root@desk mythcat]# vim /etc/wordpress/wp-config.php
This source code show you to set wp-config.php for localhost install:
define( 'DB_NAME', 'mysite' );

/** MySQL database username */
define( 'DB_USER', 'testadmin' );

/** MySQL database password */
define( 'DB_PASSWORD', 'TESTtest!' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
Restart the httpd service:
[root@desk mythcat]# systemctl restart httpd
Open URL to set WordPress to set the last steps of this install process:
http://localhost/wordpress/ 

Thursday, December 17, 2020

Fedora 33 : Sigil software.

Sigil is a ePub editor for Linux and omes with powerful features like UTF-16, EPUB 2 spec, and limited EPUB 3 support.
The complete control over directly editing EPUB syntax in Code View and Table of Contents generator with multi-level heading support and metadata editor.
The user interface translated into many languages and spell checking and many plugins available.
These command will show you how can search and install this software:
[root@desk mythcat]# dnf search Sigil
Last metadata expiration check: 0:54:58 ago on Wed 16 Dec 2020 11:01:54 PM EET.
======================== Name & Summary Matched: Sigil =========================
FlightCrew-sigil-plugin.x86_64 : Sigil FlightCrew epub validator plugin
sigil-doc.noarch : Documentation for Sigil ebook editor
============================= Name Matched: Sigil ==============================
sigil.x86_64 : WYSIWYG ebook editor
[root@desk mythcat]# dnf install sigil.x86_64 
Last metadata expiration check: 0:55:32 ago on Wed 16 Dec 2020 11:01:54 PM EET.
Dependencies resolved.
================================================================================
 Package                     Arch       Version               Repository   Size
================================================================================
Installing:
 sigil                       x86_64     0.9.14-7.fc33         fedora      3.5 M
Installing dependencies:
 minizip                     x86_64     2.10.2-1.fc33         updates     112 k
 python3-cssselect           noarch     0.9.2-16.fc33         fedora       38 k
 python3-cssutils            noarch     1.0.2-9.fc33          fedora      270 k
 python3-regex               x86_64     2020.11.13-1.fc33     updates     345 k
 zipios++                    x86_64     0.1.5.9-25.fc33       fedora       78 k
Installing weak dependencies:
 FlightCrew-sigil-plugin     x86_64     0.9.1-21.fc33         fedora      336 k

Transaction Summary
================================================================================
Install  7 Packages

Total download size: 4.7 M
Installed size: 20 M
Is this ok [y/N]: y
...
  Running scriptlet: sigil-0.9.14-7.fc33.x86_64                             7/7 
  Verifying        : minizip-2.10.2-1.fc33.x86_64                           1/7 
  Verifying        : python3-regex-2020.11.13-1.fc33.x86_64                 2/7 
  Verifying        : FlightCrew-sigil-plugin-0.9.1-21.fc33.x86_64           3/7 
  Verifying        : python3-cssselect-0.9.2-16.fc33.noarch                 4/7 
  Verifying        : python3-cssutils-1.0.2-9.fc33.noarch                   5/7 
  Verifying        : sigil-0.9.14-7.fc33.x86_64                             6/7 
  Verifying        : zipios++-0.1.5.9-25.fc33.x86_64                        7/7 

Installed:
  FlightCrew-sigil-plugin-0.9.1-21.fc33.x86_64                                  
  minizip-2.10.2-1.fc33.x86_64                                                  
  python3-cssselect-0.9.2-16.fc33.noarch                                        
  python3-cssutils-1.0.2-9.fc33.noarch                                          
  python3-regex-2020.11.13-1.fc33.x86_64                                        
  sigil-0.9.14-7.fc33.x86_64                                                    
  zipios++-0.1.5.9-25.fc33.x86_64                                               

Complete!

Thursday, December 3, 2020

Fedora 33 : Create a simple AvaloniaUI window.

This tutorial is about Avalonia UI.
Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via Xorg, macOS.
I install avalonia dotnet templates from here:
[mythcat@desk CSharpProjects]$ git clone https://github.com/AvaloniaUI/avalonia-dotnet-templates --recursive
Cloning into 'avalonia-dotnet-templates'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 379 (delta 14), reused 19 (delta 7), pack-reused 342
Receiving objects: 100% (379/379), 147.23 KiB | 881.00 KiB/s, done.
Resolving deltas: 100% (202/202), done.
[mythcat@desk CSharpProjects]$ ls
aspnetapp  avalonia-dotnet-templates  HelloWorld  myapp001  MyGame001  Todo
[mythcat@desk CSharpProjects]$ dotnet new --install avalonia-dotnet-templates 
...
Create a default window example with AvaloniaUI:
[mythcat@desk CSharpProjects]$ dotnet new avalonia.app -o MyAppAvalonia
The template "Avalonia .NET Core App" was created successfully.
[mythcat@desk CSharpProjects]$ cd MyAppAvalonia/
[mythcat@desk MyAppAvalonia]$ dotnet add package Avalonia
...
[mythcat@desk MyAppAvalonia]$ dotnet add package Avalonia.Desktop
...
[mythcat@desk MyAppAvalonia]$ ls
App.xaml  App.xaml.cs  MainWindow.xaml  MainWindow.xaml.cs  MyAppAvalonia.csproj  nuget.config  Program.cs
Publish this example:
[mythcat@desk MyAppAvalonia]$ dotnet publish --configuration Release --runtime fedora.33-x64 --self-contained false
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 3.86 sec for /home/mythcat/CSharpProjects/MyAppAvalonia/MyAppAvalonia.csproj.
MyAppAvalonia -> /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/fedora.33-x64/MyAppAvalonia.dll
MyAppAvalonia -> /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/fedora.33-x64/publish/
The last step is the run:
[mythcat@desk MyAppAvalonia]$ dotnet /home/mythcat/CSharpProjects/MyAppAvalonia/bin/Release/netcoreapp3.0/
fedora.33-x64/publish/MyAppAvalonia.dll 
This will open a window build with AvaloniaUI.

Monday, November 30, 2020

Fedora 33 : Build and publish with .NET Core SDK .

In this tutorial I will show you how can use .NET Core SDK to build and run a simple MyGame001 application from the last tutorial.
Let's go to the project and get some infos:
[mythcat@desk ~]$ cd CSharpProjects/
[mythcat@desk CSharpProjects]$ cd MyGame001/
[mythcat@desk MyGame001]$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.109
 Commit:    32ced2d411

Runtime Environment:
 OS Name:     fedora
 OS Version:  33
 OS Platform: Linux
 RID:         fedora.33-x64
 Base Path:   /usr/lib64/dotnet/sdk/3.1.109/

Host (useful for support):
  Version: 3.1.9
  Commit:  774fc3d6a9

.NET Core SDKs installed:
  3.1.109 [/usr/lib64/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.9 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.9 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
The next command will create MyGame001.dll.
[mythcat@desk MyGame001]$ dotnet publish --configuration Release --runtime fedora.33-x64 --self-contained false
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 50.58 ms for /home/mythcat/CSharpProjects/MyGame001/MyGame001.csproj.
  MyGame001 -> /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/MyGame001.dll
  MyGame001 -> /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/publish/
Now you can run it with dotnet command:
[mythcat@desk MyGame001]$ dotnet /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/MyGame001.dll
You can simply run it like an Linux application:
[mythcat@desk MyGame001]$ /home/mythcat/CSharpProjects/MyGame001/bin/Release/netcoreapp3.1/fedora.33-x64/publish/MyGame001