Pages

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.