Pages

Thursday, June 10, 2021

Fedora 34 : Fix conflicts are between the version of the packages.

You can have conflicts are between the version of the packages, see this example:
[root@desk mythcat]# dnf update --refresh
file /usr/share/doc/gstreamer1-plugins-good/README from install of 
gstreamer1-plugins-good-1.19.1-1.fc34.i686 conflicts with file from package 
gstreamer1-plugins-good-1.18.4-2.fc34.x86_64
This command will fix conflicts are between the version of the packages:
[root@desk mythcat]# dnf remove --duplicates
...
 gstreamer1                          i686    1.19.1-1.fc34       updates  1.4 M
Reinstalling:
 gst-editing-services                x86_64  1.19.1-1.fc34       updates  608 k
     replacing  gst-editing-services.x86_64 1.18.4-1.fc34
 gstreamer1                          x86_64  1.19.1-1.fc34       updates  1.3 M
     replacing  gstreamer1.x86_64 1.18.4-2.fc34
 gstreamer1-plugins-bad-free         x86_64  1.19.1-1.fc34       updates  2.6 M
     replacing  gstreamer1-plugins-bad-free.x86_64 1.18.4-1.fc34
 gstreamer1-plugins-bad-free-extras  x86_64  1.19.1-1.fc34       updates  422 k
     replacing  gstreamer1-plugins-bad-free-extras.x86_64 1.18.4-1.fc34
 gstreamer1-plugins-ugly-free        x86_64  1.19.1-1.fc34       updates  103 k
     replacing  gstreamer1-plugins-ugly-free.x86_64 1.18.4-1.fc34
 gucharmap                           x86_64  13.0.8-1.fc34       updates  514 k
     replacing  gucharmap.x86_64 13.0.7-1.fc34
 gucharmap-libs                      x86_64  13.0.8-1.fc34       updates  1.2 M
     replacing  gucharmap-libs.x86_64 13.0.7-1.fc34
 kernel-headers                      x86_64  5.12.9-300.fc34     updates  1.2 M
     replacing  kernel-headers.x86_64 5.12.5-300.fc34
...
The next command will update you Linux distro:
[root@desk mythcat]# dnf update --refresh
Copr repo for dotnet owned by @dotnet-sig       5.1 kB/s | 3.3 kB     00:00    
Adobe Systems Incorporated                      7.6 kB/s | 2.9 kB     00:00    
Fedora 34 - x86_64                               58 kB/s |  26 kB     00:00    
Fedora 34 - x86_64 - Updates                     41 kB/s |  23 kB     00:00    
google-chrome                                   9.0 kB/s | 1.3 kB     00:00    
RPM Fusion for Fedora 34 - Free                  16 kB/s | 7.9 kB     00:00    
RPM Fusion for Fedora 34 - Free - Updates        18 kB/s | 7.9 kB     00:00    
RPM Fusion for Fedora 34 - Nonfree               21 kB/s | 8.0 kB     00:00    
RPM Fusion for Fedora 34 - Nonfree - Updates     13 kB/s | 8.0 kB     00:00    
The Zeek Network Security Monitor. (Fedora_33)  6.6 kB/s | 1.7 kB     00:00    
Visual Studio Code                              6.0 kB/s | 3.0 kB     00:00    
WineHQ packages                                 9.3 kB/s | 3.2 kB     00:00    
Dependencies resolved.
...
 gstreamer1-plugins-good-1.19.1-1.fc34.i686  
...

Wednesday, June 9, 2021

Fedora 34 : Programming with the ncurses library - part 003.

This is a simple example with ncurses library to see how can define an array and used with random colors:
This example is build with this command:
[mythcat@desk ncursesProject]$ gcc test_008.c -o test_008 -lncurses
This is source code:
#include <ncurses.h>
#include <stdlib.h> 

int main(void) {
    
    initscr();
    
    start_color();
    
    char colors[8][20] = {
    "COLOR_BLACK",
    "COLOR_RED",
    "COLOR_GREEN",
    "COLOR_YELLOW",
    "COLOR_BLUE",
    "COLOR_MAGENTA",
    "COLOR_CYAN",
    "COLOR_WHITE"
    };
    
    int n;
    for ( n=0 ; n<16 ; ++n )
    {
        int aleator1 = rand() % 256 + 1;
        int result1 = *colors[aleator1];
        int aleator2 = rand() % 256 + 1;
        int result2 = *colors[aleator2];
        //printw("%d",result1);
        init_pair(n, result1, result2);
        attron(COLOR_PAIR(n));
        printw("Hello word!\n");
    }
    
    refresh();

    getch();

    endwin();
}

Saturday, June 5, 2021

Fedora 34 : Neix feed reader.

neix is a simple, work in progress terminal feed reader for all common RSS/Atom feeds on the web out there.
Let't install from the GitHub repository.
[mythcat@desk ~]$ git clone https://github.com/tomschwarz/neix.git  
Cloning into 'neix'...
remote: Enumerating objects: 2574, done.
remote: Counting objects: 100% (365/365), done.
remote: Compressing objects: 100% (274/274), done.
remote: Total 2574 (delta 189), reused 198 (delta 77), pack-reused 2209
Receiving objects: 100% (2574/2574), 26.07 MiB | 6.27 MiB/s, done.
Resolving deltas: 100% (1529/1529), done.
[mythcat@desk ~]$ cd neix
[mythcat@desk neix]$ cmake .
-- The C compiler identification is GNU 11.1.1
-- The CXX compiler identification is GNU 11.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
...
-- Found Curses: /usr/lib64/libncursesw.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mythcat/neix
[mythcat@desk neix]$ make 
Scanning dependencies of target neixParser
[  5%] Building CXX object CMakeFiles/neixParser.dir/src/parser/FactoryParser.cpp.o
...
[ 89%] Built target neixFeed
Scanning dependencies of target neix
[ 94%] Building CXX object CMakeFiles/neix.dir/src/main.cpp.o
[100%] Linking CXX executable bin/neix
[100%] Built target neix
[mythcat@desk neix]$ sudo make install
[sudo] password for mythcat: 
[ 26%] Built target neixParser
[ 42%] Built target neixConfig
[ 57%] Built target neixApplication
[ 73%] Built target neixHelper
[ 89%] Built target neixFeed
[100%] Built target neix
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/neix
-- Installing: /usr/local/share/man/man1/neix.1
-- Installing: /usr/local/share/neix/neix.conf
-- Installing: /usr/local/share/neix/feeds.conf
Let's run it:
[mythcat@desk neix]$ neix 
[neix] Starting version v0.1.5
[neix] Loading configuration files
[neix] Loading feeds 
[neix] Launch TUI 
Use feeds.conf to set the list of feeds you want to read.
This is a screenshot with the result of the build:

Saturday, May 29, 2021

Fedora 34 : Upgrade to the last version Fedora 34 Linux distro.

Today I upgraded from the fedora 33 version to the new Fedora 34 Linux distro version.
Here are the commands I used to upgrade this Linux distro:
[root@desk mythcat]# dnf upgrade 
[root@desk mythcat]# dnf --refresh upgrade
[root@desk mythcat]# dnf system-upgrade reboot
The whole process will require a restart and then continue with the following commands:
[root@desk mythcat]# dnf install dnf-plugin-system-upgrade --best
[root@desk mythcat]# dnf system-upgrade download --refresh --releasever=34 --allowerasing --skip-broken
[root@desk mythcat]# dnf system-upgrade reboot
[root@desk mythcat]# rpm --rebuilddb
[root@desk mythcat]# dnf distro-sync --setopt=deltarpm=0
[root@desk mythcat]# dnf install rpmconf
[root@desk mythcat]# rpmconf -a
[root@desk mythcat]# reboot
You can find this version on the official webpage.

Tuesday, May 25, 2021

Fedora 33 : Programming with the ncurses library - part 002.

Another example with this library, see the screenshot:

#include <ncurses.h&gt 

WINDOW *win;
int startx, starty, width, height;
int cport;


WINDOW *makewin(int h, int w, int y, int x)
{
    WINDOW *lwin;

    lwin = newwin(h, w, y, x);
    box(lwin, 0 , 0);
    wrefresh(lwin);

    return lwin;
}

void dewin(WINDOW *lwin)
{
    wborder(lwin, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
    wrefresh(lwin);
    delwin(lwin);
}

void getInput(){
    win = makewin(height, width, starty, startx);
    wbkgd(win, COLOR_PAIR(1));
    mvwprintw(win, 0, 8, "Question 1 : ");
    mvwprintw(win, 2, 4, "What is your age?");
    mvwprintw(win, 3, 4, "dd/mm/yy:");
    wrefresh(win);
    wscanw(win, "%d", &cport);
}

int main()
{
    initscr();
    cbreak();
    keypad(stdscr, TRUE);
    start_color();
    init_pair(1,COLOR_WHITE, COLOR_BLACK);
    init_pair(2,COLOR_WHITE, COLOR_BLUE);
    bkgd(COLOR_PAIR(2));
    refresh();
    
    height = 6;
    width = 30;
    starty = (LINES - height) / 2;
    startx = (COLS - width) / 2;
    
    getInput();
    getch();

    dewin(win);
    endwin();
    return 0;
}

Sunday, May 23, 2021

Fedora 33 : Programming with the ncurses library - part 001.

I started learning C and C ++ many years ago. Around 2004, the virtualization and S.D.K. class system for the Windows operating system confused me and was not to my advantage. Later I realized that it is more advantageous and faster to create your own tools with other programming languages. It turned out that I'm right and today I'm going to show you how simple it is to use C programming on the Linux Fedora 33 distro.
This library is easy to install on the Fedora Linux distro:
[root@desk mythcat]# dnf install ncurses-devel
Last metadata expiration check: 2:33:29 ago on Sun 23 May 2021 07:15:17 PM EEST.
Package ncurses-devel-6.2-3.20200222.fc33.x86_64 is already installed.
Package ncurses-devel-6.2-3.20200222.fc33.i686 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
I created a folder and with the vim editor, I created my file called test_001.c for the first test.
[mythcat@desk ~]$ mkdir ncursesProject
[mythcat@desk ~]$ cd ncursesProject/
[mythcat@desk ncursesProject]$ vim test_001.c
This is the content to initiate and display a simple text with this library:
#include <ncurses.h>
 
int main(void){ 
        initscr();                      /* start curses mode */
        printw("Hello World !");        /* print Hello World */
        refresh();                      /* send to the real screen */
        getch();                        /* wait for user input */
        endwin();                       /* end curses mode */
        return 0;
} 
I used cc and gcc commands for C compilers to test this example and it works great:
[mythcat@desk ncursesProject]$ cc -o test_001 test_001.c -lncurses
[mythcat@desk ncursesProject]$ ls -l
total 32
-rwxr-xr-x 1 mythcat mythcat 25312 May 23 22:14 test_001
-rw-r--r-- 1 mythcat mythcat   386 May 23 22:14 test_001.c
[mythcat@desk ncursesProject]$ ./test_001 
[mythcat@desk ncursesProject]$ gcc -o test_001_gcc test_001.c -lncurses
[mythcat@desk ncursesProject]$ ./test_001_gcc 
#include <ncurses.h>

int main() { 
    // create the pointer to the window
    WINDOW *w;
    // define the data
    char list[4][8] = { "","Festila", "George", "Catalin"};
    char item[8];
    int ch, i = 0, width = 8;
    initscr(); // initialize Ncurses
    // create the new window with ncurses
    w = newwin( 6, 11, 0, 0 ); 
    box( w, 0, 0 ); // sets default borders for the window
    // now print all the menu items and highlight the first one
    for(i=0; i<4; i++) 
        {
        if( i != 0 ) 
            // highlights the first item.
            wattron( w, A_STANDOUT ); 
        else
            // highlights the next item.
            wattroff( w, A_STANDOUT );
            sprintf(item, "%-8s",  list[i]);
            mvwprintw( w, i+1, 2, "%s", item );
            //wrefresh( w );
        }
        wrefresh( w ); // update the terminal screen
        i = 0;
        noecho(); // disable echoing of characters on the screen
        keypad( w, TRUE ); // enable keyboard input for the window.
        curs_set(0); // hide the default screen cursor.
        
    // get the input if is not q key presed then run
    while(( ch = wgetch(w)) != 'q')
    { 
        // right pad with spaces to make the items appear with even width.
        sprintf(item, "%-8s",  list[i]); 
        mvwprintw( w, i+1, 2, "%s", item ); 

        // use a variable to increment or decrement the value based on the input.
        switch( ch ) 
        {
            case KEY_UP:
            i--; // increment 
            // stop the number of count list items -1
            i = ( i<0 ) ? 3 : i;
            break;
            case KEY_DOWN:
            i++; // increment
            // stop the number of count list items 
            i = ( i>2 ) ? 3 : i;
            break;
        }
    
        // now highlight the next item in the list.
        wattron( w, A_STANDOUT );
        sprintf(item, "%-8s",  list[i]);
        mvwprintw( w, i+1, 2, "%s", item);
        wattroff( w, A_STANDOUT );
    }
    // delete window
    delwin( w );
    // stop the window
    endwin();
}
This is the result:

Fedora 33 : Wordpress application desktop by Automattic tested on linux.

This application come for Android , Desktop and Mobile.
You can see this application on this website.
This is an screenshot with the application run it on Fedora Linux distro:
Download it unarchive and used like this:
[mythcat@desk ~]$ cd wordpress.com-linux-x64-6.14.0/
[mythcat@desk wordpress.com-linux-x64-6.14.0]$ ls -la
total 176264
drwxrwxrwx    5 mythcat mythcat      4096 Apr 30 14:23 .
drwx------. 104 mythcat mythcat     12288 May 23 12:29 ..
-rwxrwxrwx    1 mythcat mythcat    124662 Apr 30 14:23 chrome_100_percent.pak
-rwxrwxrwx    1 mythcat mythcat    187289 Apr 30 14:23 chrome_200_percent.pak
-rwxrwxrwx    1 mythcat mythcat   4743960 Apr 30 14:23 chrome-sandbox
-rwxrwxrwx    1 mythcat mythcat  10527632 Apr 30 14:23 icudtl.dat
-rwxrwxrwx    1 mythcat mythcat    249240 Apr 30 14:23 libEGL.so
-rwxrwxrwx    1 mythcat mythcat   3064616 Apr 30 14:23 libffmpeg.so
-rwxrwxrwx    1 mythcat mythcat   6990656 Apr 30 14:23 libGLESv2.so
-rwxrwxrwx    1 mythcat mythcat   3908248 Apr 30 14:23 libvk_swiftshader.so
-rwxrwxrwx    1 mythcat mythcat   6710080 Apr 30 14:23 libvulkan.so
-rwxrwxrwx    1 mythcat mythcat      1060 Apr 30 14:23 LICENSE.electron.txt
-rwxrwxrwx    1 mythcat mythcat   4562357 Apr 30 14:23 LICENSES.chromium.html
drwxrwxrwx    2 mythcat mythcat      4096 Apr 30 14:23 locales
drwxrwxrwx    3 mythcat mythcat        17 Apr 30 14:23 resources
-rwxrwxrwx    1 mythcat mythcat   5035565 Apr 30 14:23 resources.pak
-rwxrwxrwx    1 mythcat mythcat     51449 Apr 30 14:23 snapshot_blob.bin
drwxrwxrwx    2 mythcat mythcat        43 Apr 30 14:23 swiftshader
-rwxrwxrwx    1 mythcat mythcat    172276 Apr 30 14:23 v8_context_snapshot.bin
-rwxrwxrwx    1 mythcat mythcat       107 Apr 30 14:23 vk_swiftshader_icd.json
-rwxrwxrwx    1 mythcat mythcat 134100640 Apr 30 14:23 wpcom
[mythcat@desk wordpress.com-linux-x64-6.14.0]$ ./wpcom 
{"name":"calypso","hostname":"desk","pid":9931,"reqId":"066e63b4-d04c-4210-af52-6419e4a156fb","level":30,
"method":"GET","status":200,"length":"12940","url":"/post/null","duration":66.718,
"httpVersion":"1.1","env":"desktop","userAgent":"Chrome 87","rawUserAgent":"Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) WordPressDesktop/6.14.0 Chrome/87.0.4280.67 Electron/11.0.4 
Safari/537.36","remoteAddr":"127.0.0.1","msg":"request finished","time":"2021-05-23T09:48:44.683Z","v":0}
{"name":"calypso","hostname":"desk","pid":9931,"reqId":"6da5223a-07e0-4202-8ab0-e28940a54fbc","level":30, ...
I send my issue on GitHub for this application.
... more information on the official blog ...