Pages

Showing posts with label 2018. Show all posts
Showing posts with label 2018. Show all posts

Friday, December 28, 2018

Fedora 29 : The most common BIOS commands.

Fedora Distribution has many things that many overlook in the maintenance process.
Today I will show you some commands for your BIOS.
These are fairly common and are fairly recent.
First is efibootmgr:
[root@desk mythcat]# efibootmgr
EFI variables are not supported on this system.
The next one is dmidecode, see:
[root@desk mythcat]# dmidecode -t 11
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.
[root@desk mythcat]# dmidecode --type processor
# dmidecode 3.2
...
The dmidecode command can be used with the arg -t from 0 to 39, or you can use the --type with this keywords:
  • baseboard
  • bios
  • cache
  • chassis;
  • connector
  • memory
  • processor
  • slot
  • system
The last one I used with Fedora 29 is biosdecode.
The dmidecode and biosdecode commands are Linux distro independent and preinstalled in most of them.
Let's see commands that depend on hardware.
The vpddecode command for IBM and Lenovo hardware only, the vpd stands for vital product data.
The ownership command is for only Compaq hardware, to get Compaq specific ownership tag info.

Wednesday, December 12, 2018

Fedora 29 : Using pytorch on Fedora distro.

The goal of this tutorial is about how to install and start using the pytorch python module.
Another part is to show tensors without using matplotlib python module.
The reason I wrote this simple tutorial and not on my python blogger is Fedora distro.
The python module named pytorch is based on Torch, used for applications such as natural language processing.
The installation of pytorch into many operating systems can be tricky.
Let's start this tutorial using GitHub clone commands:
[mythcat@desk ~]$  git clone --recursive https://github.com/pytorch/pytorch
...
running install_scripts
Installing convert-caffe2-to-onnx script to /home/mythcat/.local/bin
Installing convert-onnx-to-caffe2 script to /home/mythcat/.local/bin
Using this commands un Fedora linux shell will install easy this python module:
[mythcat@desk ~]$  cd pytorch/
[mythcat@desk ~]$ pip install typing
[mythcat@desk ~]$ python setup.py install --user
[mythcat@desk ~]$ pip install torchvision --user
Collecting torchvision
...
You cannot use the pytorch into pytorch folder.
[mythcat@desk pytorch]$ cd ..
[mythcat@desk ~]$ python -c "import torch; print(torch.__version__)"
1.0.0a0+bf1d411
The result of this output is not an common error. You can fix if you set the paths for pytorch installation. Let's test the pytorch installation:
[mythcat@desk ~]$ python
Python 2.7.15 (default, Oct 15 2018, 15:26:09) 
[GCC 8.2.1 20180801 (Red Hat 8.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch 
>>> import torchvision
>>> import torchvision.dataset as datasets
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named dataset
>>> import torchvision.datasets as datasets
>>> print(dir(torch))
['Argument', 'ArgumentSpec', 'Block', 'BoolType', 'ByteStorage', 'ByteTensor', 'CharStorage', 'CharTensor', 'Code', 
'CompleteArgumentSpec', 'DoubleStorage', 'DoubleTensor', 'DynamicType', 'ExecutionPlanState', 'FatalError', 'FloatStorage',
 'FloatTensor', 'FloatType', 'FunctionSchema', 'Future', 'Generator', 'Gradient', 'Graph', 'GraphExecutor', 
'GraphExecutorState', 'HalfStorage', 'HalfStorageBase', 'HalfTensor', 'IODescriptor', 'IntStorage', 'IntTensor', 'IntType',
 'JITException', 'ListType',
...
>>> print(dir(datasets))
['CIFAR10', 'CIFAR100', 'CocoCaptions', 'CocoDetection', 'DatasetFolder', 'EMNIST', 'FakeData', 'FashionMNIST', 
'ImageFolder', 'LSUN', 'LSUNClass', 'MNIST', 'Omniglot', 'PhotoTour', 'SEMEION', 'STL10', 'SVHN', '__all__', 
'__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'cifar', 'coco', 'fakedata', 
'folder', 'lsun', 'mnist', 'omniglot', 'phototour', 'semeion', 'stl10', 'svhn', 'utils']
>>> x = torch.rand(76)
>>> x.size()
>>> print(x)
tensor([0.9839, 0.5844, 0.4347, 0.5883, 0.1383, 0.7701, 0.1879, 0.5604, 0.4486,
        0.6782, 0.5038, 0.1078, 0.1244, 0.0996, 0.0230, 0.5457, 0.8903, 0.7732,
        0.9948, 0.3201, 0.3149, 0.7180, 0.8811, 0.4468, 0.8169, 0.2998, 0.3900,
        0.8067, 0.0090, 0.6006, 0.8385, 0.8786, 0.3652, 0.5630, 0.1407, 0.7747,
        0.5734, 0.4998, 0.4056, 0.7473, 0.2797, 0.8852, 0.3563, 0.9421, 0.1136,
        0.7676, 0.4224, 0.4350, 0.4968, 0.4457, 0.3047, 0.6792, 0.1026, 0.3593,
        0.4147, 0.6517, 0.5916, 0.3567, 0.8584, 0.9421, 0.2091, 0.6339, 0.5428,
        0.3811, 0.9310, 0.8856, 0.0770, 0.7920, 0.4860, 0.4276, 0.4780, 0.8627,
        0.7287, 0.4340, 0.2859, 0.2213])
>>> from PIL import Image
>>> logo = np.array(Image.open('logo.png').resize((512,512)))
>>> logo_tensor = torch.from_numpy(logo)
>>> logo_tensor.size()
(512, 512, 4)
>>> img = Image.fromarray(logo)
>>> img.show()

Sunday, December 9, 2018

Fedora 29 : Python 3 and Jupyter notebook.

Today I tested the Jupyter Notebook with Fedora 29.
About the Jupyter Notebook the official website comes with this intro:
The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.
First I check with DNF tool the update and the upgrade of the Fedora 29 distro.
The next step was to install this:
# dnf install python3-pip
# dnf install python3-devel.x86_64
# pip3 install --upgrade pip
With my account shell I used this commands to create and run the Jupiter Notebook:
$ pip3 install --user virtualenv
$ mkdir my_project
$ cd my_project/
$ virtualenv my_project_env
$ source my_project_env/bin/activate
$ pip3 install jupiter
$ jupiter notebook
The last command will start your default browser and will see this:
You can see I created a new notebook with Python 3.
The result is shown into another tab webpage browser where I used few commands to install new module scipy and I check if this working well:
!pip3 install scipy
help
quickref
The result of this notebook looks like this image:

Thursday, December 6, 2018

Fedora 29 : Shotcut video editor.

Today I tested the new software video editor for Fedora 29.
This video editor is named Shotcut and come with a new released 18.11.18 available here.
This Linux tool come for many operating systems and is a good video editor
I download and unarchive this software from the official website.
The first error comes from libnsl packages but finally, all worked well.
[mythcat@desk Shotcut]$ cd Shotcut.app/
[mythcat@desk Shotcut.app]$ ll
total 80
drwxr-xr-x.  2 mythcat mythcat    89 Nov 19 01:08 bin
-rwxr-xr-x.  1 mythcat mythcat 35147 Nov 18 23:53 COPYING
-rwxr-xr-x.  1 mythcat mythcat   779 Nov 19 01:10 ffmpeg
-rwxr-xr-x.  1 mythcat mythcat   779 Nov 19 01:10 ffplay
-rwxr-xr-x.  1 mythcat mythcat   782 Nov 19 01:10 ffprobe
drwxr-xr-x.  8 mythcat mythcat  8192 Nov 19 01:10 lib
-rwxr-xr-x.  1 mythcat mythcat   773 Nov 19 01:10 melt
-rwxr-xr-x.  1 mythcat mythcat   776 Nov 19 01:10 qmelt
drwxr-xr-x. 13 mythcat mythcat   163 Nov 19 01:10 share
-rwxr-xr-x.  1 mythcat mythcat   759 Nov 19 01:10 shotcut
-rwxr-xr-x.  1 mythcat mythcat   899 Nov 19 01:10 source-me
-rw-r--r--.  1 mythcat mythcat   802 Nov 19 01:10 versions
[mythcat@desk Shotcut.app]$ ./shotcut 
bin/shotcut: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
...
[root@desk Shotcut.app]# dnf install libnsl
Last metadata expiration check: 0:23:04 ago on Thu 06 Dec 2018 12:31:08 PM EET.
...
Installed:
  libnsl-2.28-23.fc29.x86_64                                                    

Complete!
The result can be see into the next screenshot:

Monday, December 3, 2018

The saga of build Librelancer over Mono, NuGET and Cake.

I wrote this article because it is a good way to understand beyond the errors encountered for Mono, NuGet and Cake.
I started the day with Fedora 29 installing the old Librelancer game:
Librelancer is a cross-platform, open source game engine re-implementing the 2003 space trading and combat game Freelancer. The engine comes with an editor for several of the game's file formats called LancerEdit.
See the official webpage.
Some errors are temporarily fixed, see:
TERM=xterm.
This error refers an issue open on Feb 13,2018,12:52 PM GMT+2, see here.
However, this is a great way to go through Fedora installations to avoid searching for GitHub issues and issues.
The default install of Cake with the version 0.30.0 will not solve the last error:
[root@desk Librelancer]# nuget  install Cake -Version 0.30.0 
Installing 'Cake 0.30.0'.
Successfully installed 'Cake 0.30.0'. 
Let's hope that problems will solve with time.
Below are the correct steps for going through the installation until the last error.
[mythcat@desk ~]$ git clone --depth=50 --branch=master https://github.com/Librelancer/Librelancer.git 
Cloning into 'Librelancer'...
remote: Enumerating objects: 3085, done.
remote: Counting objects: 100% (3085/3085), done.
remote: Compressing objects: 100% (1414/1414), done.
remote: Total 3085 (delta 2131), reused 2295 (delta 1639), pack-reused 0
Receiving objects: 100% (3085/3085), 7.97 MiB | 2.79 MiB/s, done.
Resolving deltas: 100% (2131/2131), done.
Checking out files: 100% (863/863), done.
[mythcat@desk ~]$ cd Librelancer/
[mythcat@desk Librelancer]$ ll
total 48
-rw-rw-r--.  1 mythcat mythcat 4912 Dec  3 11:23 build.cake
-rw-rw-r--.  1 mythcat mythcat 7439 Dec  3 11:23 build.ps1
-rwxrwxr-x.  1 mythcat mythcat 3210 Dec  3 11:23 build.sh
-rw-rw-r--.  1 mythcat mythcat   33 Dec  3 11:23 cake.config
-rw-rw-r--.  1 mythcat mythcat 1029 Dec  3 11:23 CMakeLists.txt
-rw-rw-r--.  1 mythcat mythcat 2768 Dec  3 11:23 Credits.txt
drwxrwxr-x.  4 mythcat mythcat   87 Dec  3 11:23 deps
drwxrwxr-x.  4 mythcat mythcat 4096 Dec  3 11:23 editoricons
drwxrwxr-x. 12 mythcat mythcat  208 Dec  3 11:23 extern
-rw-rw-r--.  1 mythcat mythcat 1166 Dec  3 11:23 LICENSE
-rw-rw-r--.  1 mythcat mythcat 1877 Dec  3 11:23 README.md
drwxrwxr-x.  2 mythcat mythcat   75 Dec  3 11:23 scripts
drwxrwxr-x. 15 mythcat mythcat 4096 Dec  3 11:23 src
drwxrwxr-x.  2 mythcat mythcat   29 Dec  3 11:23 tools

[mythcat@desk Librelancer]$ git submodule update --init --recursive
Submodule 'extern/BulletSharpPInvoke' (https://github.com/AndresTraks/BulletSharpPInvoke) registered for path 
'extern/BulletSharpPInvoke'
Submodule 'extern/Collada141' (https://github.com/Librelancer/Collada141) registered for path 
'extern/Collada141'
Submodule 'extern/FontConfigSharp' (https://github.com/CallumDev/FontConfigSharp.git) registered for path 
'extern/FontConfigSharp'
Submodule 'extern/ImGui.NET' (https://github.com/mellinoe/ImGui.NET) registered for path 'extern/ImGui.NET'
Submodule 'extern/SharpFont' (https://github.com/Robmaister/SharpFont.git) registered for path 'extern/SharpFont'
Submodule 'extern/StbSharp' (https://github.com/rds1983/StbSharp) registered for path 'extern/StbSharp'
Submodule 'extern/bullet3' (https://github.com/bulletphysics/bullet3) registered for path 'extern/bullet3'
Submodule 'extern/cimgui' (https://github.com/Extrawurst/cimgui) registered for path 'extern/cimgui'
Submodule 'extern/lidgren-network-gen3' (https://github.com/lidgren/lidgren-network-gen3) registered for path 
'extern/lidgren-network-gen3'
Submodule 'extern/nvidia-texture-tools' (https://github.com/castano/nvidia-texture-tools) registered for path 
'extern/nvidia-texture-tools'
Cloning into '/home/mythcat/Librelancer/extern/BulletSharpPInvoke'...
Cloning into '/home/mythcat/Librelancer/extern/Collada141'...
Cloning into '/home/mythcat/Librelancer/extern/FontConfigSharp'...
Cloning into '/home/mythcat/Librelancer/extern/ImGui.NET'...
Cloning into '/home/mythcat/Librelancer/extern/SharpFont'...
...
[mythcat@desk Librelancer]$ export GITHUB_TOKEN=[secure]
Check your mono version 
[mythcat@desk Librelancer]$ mono --version
Mono JIT compiler version 4.8.0 (Stable 4.8.0.520/8f6d0f6 Wed Sep 20 21:27:10 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

[root@desk Librelancer]# rpm --import https://packages.microsoft.com/keys/microsoft.asc
[root@desk Librelancer]# wget -q https://packages.microsoft.com/config/fedora/27/prod.repo
[root@desk Librelancer]# ls
build.cake  cake.config     deps         LICENSE    scripts
build.ps1   CMakeLists.txt  editoricons  prod.repo  src
build.sh    Credits.txt     extern       README.md  tools
[root@desk Librelancer]# vim prod.repo 
[root@desk Librelancer]# mv prod.repo /etc/yum.repos.d/microsoft-prod.repo
[root@desk Librelancer]# chown root:root /etc/yum.repos.d/microsoft-prod.repo
[root@desk Librelancer]# dnf update
packages-microsoft-com-prod                      48 kB/s | 156 kB     00:03    
Last metadata expiration check: 0:00:01 ago on Mon 03 Dec 2018 11:52:11 AM EET.
Dependencies resolved.
Nothing to do.
Complete!

[root@desk Librelancer]# dnf search dotnet-sdk
Last metadata expiration check: 0:01:05 ago on Mon 03 Dec 2018 11:52:11 AM EET.
=========================== Name Matched: dotnet-sdk ===========================
dotnet-sdk-2.1.x86_64 : Microsoft .NET Core SDK 2.1.500 2.1.500
dotnet-sdk-2.1.200.x86_64 : Microsoft .NET Core SDK - 2.1.200 2.1.200
dotnet-sdk-2.1.201.x86_64 : Microsoft .NET Core SDK - 2.1.201 2.1.201
dotnet-sdk-2.1.202.x86_64 : Microsoft .NET Core SDK - 2.1.202 2.1.202
dotnet-sdk-2.1.300-rc1-008673.x86_64 : Microsoft .NET Core SDK 2.1.300 - rc1
                                     : 2.1.300-rc1-008673

[root@desk Librelancer]# dnf install dotnet-sdk-2.1.202.x86_64 
Last metadata expiration check: 0:02:18 ago on Mon 03 Dec 2018 11:52:11 AM EET.
Dependencies resolved.
================================================================================
 Package                 Arch    Version     Repository                    Size
================================================================================
Installing:
 dotnet-sdk-2.1.202      x86_64  2.1.202-1   packages-microsoft-com-prod   96 M
Installing dependencies:
 aspnetcore-store-2.0.0  x86_64  2.0.0-1     packages-microsoft-com-prod   24 M
 aspnetcore-store-2.0.3  x86_64  2.0.3-1     packages-microsoft-com-prod  7.9 M
 aspnetcore-store-2.0.5  x86_64  2.0.5-1     packages-microsoft-com-prod  1.6 M
 aspnetcore-store-2.0.6  x86_64  2.0.6-1     packages-microsoft-com-prod  9.3 M
 aspnetcore-store-2.0.7  x86_64  2.0.7-1     packages-microsoft-com-prod   24 k
 aspnetcore-store-2.0.8  x86_64  2.0.8-1     packages-microsoft-com-prod  8.5 M
 aspnetcore-store-2.0.9  x86_64  2.0.9-1     packages-microsoft-com-prod  956 k
 dotnet-host             x86_64  2.1.6-1     packages-microsoft-com-prod   45 k
 dotnet-hostfxr-2.0.9    x86_64  2.0.9-1     packages-microsoft-com-prod  182 k
 dotnet-runtime-2.0.9    x86_64  2.0.9-1     packages-microsoft-com-prod   24 M

Transaction Summary
================================================================================
Install  11 Packages

Total download size: 173 M
Installed size: 173 M
Is this ok [y/N]: y
...
Complete!

This will fix a bug : 
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception.
[mythcat@desk Librelancer]$ TERM=xterm


[mythcat@desk Librelancer]$ ./build.sh 
Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

[root@desk Librelancer]# dnf install nuget.x86_64 

The dotnet come with this:

[root@desk Librelancer]# dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.1.500
 Commit:    b68b931422

Runtime Environment:
 OS Name:     fedora
 OS Version:  29
 OS Platform: Linux
 RID:         fedora.29-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.500/

Host (useful for support):
  Version: 2.1.6
  Commit:  3f4f8eebd8

.NET Core SDKs installed:
  2.1.202 [/usr/share/dotnet/sdk]
  2.1.500 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Let's test again:
[mythcat@desk Librelancer]$ ./build.sh 
Feeds used:
  https://api.nuget.org/v3/index.json

Restoring NuGet package Cake.0.30.0.
WARNING: Unable to find version '0.30.0' of package 'Cake'.
  https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
  An error occurred while sending the request
  Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED)
  Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Unable to find version '0.30.0' of package 'Cake'.
  https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
  An error occurred while sending the request
  Error: TrustFailure (Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED)
  Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Could not restore NuGet tools.

[root@desk Librelancer]# cat /etc/ssl/certs/* >ca-bundle.crt
[root@desk Librelancer]# TERM=xterm
[root@desk Librelancer]# cert-sync ca-bundle.crt
Mono Certificate Store Sync - version 4.8.0.0
Populate Mono certificate store from a concatenated list of certificates.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Importing into legacy system store:
I already trust 0, your new list has 129
Certificate added: CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
Certificate added: C=ES, O=FNMT-RCM, OU=AC RAIZ FNMT-RCM
Certificate added: C=IT, L=Milan, O=Actalis S.p.A./03358520967, CN=Actalis Authentication Root CA
Certificate added: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
...
129 new root certificates were added to your trust store.
Import process completed.
[root@desk Librelancer]# rm ca-bundle.crt
rm: remove regular file 'ca-bundle.crt'? y

[mythcat@desk Librelancer]$ ./build.sh 
Feeds used:
  https://api.nuget.org/v3/index.json

Restoring NuGet package Cake.0.30.0.
  GET https://api.nuget.org/v3-flatcontainer/cake/0.30.0/cake.0.30.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/cake/0.30.0/cake.0.30.0.nupkg 53ms
Installing Cake 0.30.0.
Adding package 'Cake.0.30.0' to folder '/home/mythcat/Librelancer/tools'
Added package 'Cake.0.30.0' to folder '/home/mythcat/Librelancer/tools'
Install failed. Rolling back...
Error: One or more errors occurred.
    Could not load type 'NuGet.Packaging.PackageArchiveReader' from assembly 'NuGet.Packaging, 
Version=4.7.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Monday, November 26, 2018

Fedora 29 : Commands and tools that handle assembly files - part 001.

This commands and tools that handle assembly files, object files, and libraries are very useful for development. In order to test these commands and tools, we need an executable file. I used this assembly source code created for FASM assembly. This assembly source code sums a variable named rad with a size of 8 bytes:
[mythcat@desk fasm]$ vim sum.asm 
format elf64
extrn printf

section '.data' writeable align 16
rad dq 90.0
fmt db "%.30lf",0ah,0

section '.text' executable align 16
public main
main:
    push rbp
    mov rbp,rsp
    pxor xmm0,xmm0
    movsd xmm0,[rad]
    movsd xmm2,[rad]
    addsd xmm0,xmm2
    mov rax,1
    mov rdi,fmt
    call printf

    mov rsp,rbp
    pop rbp
    ret
Let's create the output with the fasm tool:
[mythcat@desk fasm]$ ./fasm sum.asm 
flat assembler  version 1.73.04  (16384 kilobytes memory)
1 passes, 784 bytes.
The nm command can list symbols from object file. Let's see:
[mythcat@desk fasm]$ nm -A sum.o
sum.o:0000000000000000 T main
sum.o:                 U printf
Using the gcc tool I created the binary executable file and I run it:
[mythcat@desk fasm]$ gcc -s sum.o -o sum -lm
[mythcat@desk fasm]$ ./sum 
180.000000000000000000000000000000
The readelf can display information from elf file, see the output:
[mythcat@desk fasm]$ readelf -h sum 
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x401040
  Start of program headers:          64 (bytes into file)
  Start of section headers:          13552 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         11
  Size of section headers:           64 (bytes)
  Number of section headers:         28
  Section header string table index: 27
The strings can display printable char sequence from object files:
[mythcat@desk fasm]$ strings sum
/lib64/ld-linux-x86-64.so.2
libm.so.6
__gmon_start__
libc.so.6
printf
__libc_start_main
GLIBC_2.2.5
H=@@@
[]A\A]A^A_
;*3$"
V@%.30lf
GCC: (GNU) 8.2.1 20181105 (Red Hat 8.2.1-5)
gcc 8.2.1 20181105
GA*GOW
GA+stack_clash
GA*cf_protection
GA+GLIBCXX_ASSERTIONS
GA*FORTIFY
GA!stack_realign
gcc 8.2.1 20181105
GA*GOW
GA+stack_clash
GA*cf_protection
GA*FORTIFY
GA+GLIBCXX_ASSERTIONS
GA!stack_realign
.shstrtab
.interp
.note.ABI-tag
.note.gnu.build-id
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.dynamic
.got
.got.plt
.data
.bss
.comment
.gnu.build.attributes
The most used is the objdump. This will come with many options for many exeecutable binary files:
[mythcat@desk fasm]$ objdump --help
objdump: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pei-x86-64 elf64-l1om elf64-k1om 
elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex 
binary ihex objdump: supported architectures: i386 i386:x86-64 i386:x64-32 i8086 i386:intel i386:x86-64:intel 
i386:x64-32:intel i386:nacl i386:x86-64:nacl i386:x64-32:nacl iamcu iamcu:intel l1om l1om:intel k1om k1om:intel plugin

The following i386/x86-64 specific disassembler options are supported for use
with the -M switch (multiple options should be separated by commas):
  x86-64      Disassemble in 64bit mode
  i386        Disassemble in 32bit mode
  i8086       Disassemble in 16bit mode
  att         Display instruction in AT&T syntax
  intel       Display instruction in Intel syntax
  att-mnemonic
              Display instruction in AT&T mnemonic
  intel-mnemonic
              Display instruction in Intel mnemonic
  addr64      Assume 64bit address size
  addr32      Assume 32bit address size
  addr16      Assume 16bit address size
  data32      Assume 32bit data size
  data16      Assume 16bit data size
  suffix      Always display instruction suffix in AT&T syntax
  amd64       Display instruction in AMD64 ISA
  intel64     Display instruction in Intel64 ISA
Report bugs to .
Let's test some features of the objdump. The arg -t can show the symbol table:
[mythcat@desk fasm]$ objdump -t sum 

sum:     file format elf64-x86-64

SYMBOL TABLE:
no symbols
The arg -d can display selected information from object files by the disassemble file:
[mythcat@desk fasm]$ objdump -d sum

sum:     file format elf64-x86-64

Disassembly of section .init:

0000000000401000 <.init>:
  401000:    f3 0f 1e fa              endbr64 
  401004:    48 83 ec 08              sub    $0x8,%rsp
  401008:    48 8b 05 e9 2f 00 00     mov    0x2fe9(%rip),%rax        # 403ff8 
  40100f:    48 85 c0                 test   %rax,%rax
  401012:    74 02                    je     401016 
  401014:    ff d0                    callq  *%rax
  401016:    48 83 c4 08              add    $0x8,%rsp
  40101a:    c3                       retq   

Disassembly of section .plt:

0000000000401020 :
  401020:    ff 35 e2 2f 00 00        pushq  0x2fe2(%rip)        # 404008 
  401026:    ff 25 e4 2f 00 00        jmpq   *0x2fe4(%rip)        # 404010 
  40102c:    0f 1f 40 00              nopl   0x0(%rax)

0000000000401030 :
  401030:    ff 25 e2 2f 00 00        jmpq   *0x2fe2(%rip)        # 404018 
  401036:    68 00 00 00 00           pushq  $0x0
  40103b:    e9 e0 ff ff ff           jmpq   401020 

Disassembly of section .text:

0000000000401040 <.text>:
  401040:    f3 0f 1e fa              endbr64 
  401044:    31 ed                    xor    %ebp,%ebp
  401046:    49 89 d1                 mov    %rdx,%r9
  401049:    5e                       pop    %rsi
  40104a:    48 89 e2                 mov    %rsp,%rdx
  40104d:    48 83 e4 f0              and    $0xfffffffffffffff0,%rsp
  401051:    50                       push   %rax
  401052:    54                       push   %rsp
  401053:    49 c7 c0 e0 11 40 00     mov    $0x4011e0,%r8
  40105a:    48 c7 c1 70 11 40 00     mov    $0x401170,%rcx
  401061:    48 c7 c7 30 11 40 00     mov    $0x401130,%rdi
  401068:    ff 15 82 2f 00 00        callq  *0x2f82(%rip)        # 403ff0 
  40106e:    f4                       hlt    
  40106f:    90                       nop
  401070:    f3 0f 1e fa              endbr64 
  401074:    c3                       retq   
  401075:    66 2e 0f 1f 84 00 00     nopw   %cs:0x0(%rax,%rax,1)
  40107c:    00 00 00 
  40107f:    90                       nop
  401080:    b8 40 40 40 00           mov    $0x404040,%eax
  401085:    48 3d 40 40 40 00        cmp    $0x404040,%rax
  40108b:    74 13                    je     4010a0 
  40108d:    b8 00 00 00 00           mov    $0x0,%eax
  401092:    48 85 c0                 test   %rax,%rax
  401095:    74 09                    je     4010a0 
  401097:    bf 40 40 40 00           mov    $0x404040,%edi
  40109c:    ff e0                    jmpq   *%rax
  40109e:    66 90                    xchg   %ax,%ax
  4010a0:    c3                       retq   
  4010a1:    66 66 2e 0f 1f 84 00     data16 nopw %cs:0x0(%rax,%rax,1)
  4010a8:    00 00 00 00 
  4010ac:    0f 1f 40 00              nopl   0x0(%rax)
  4010b0:    be 40 40 40 00           mov    $0x404040,%esi
  4010b5:    48 81 ee 40 40 40 00     sub    $0x404040,%rsi
  4010bc:    48 c1 fe 03              sar    $0x3,%rsi
  4010c0:    48 89 f0                 mov    %rsi,%rax
  4010c3:    48 c1 e8 3f              shr    $0x3f,%rax
  4010c7:    48 01 c6                 add    %rax,%rsi
  4010ca:    48 d1 fe                 sar    %rsi
  4010cd:    74 11                    je     4010e0 
  4010cf:    b8 00 00 00 00           mov    $0x0,%eax
  4010d4:    48 85 c0                 test   %rax,%rax
  4010d7:    74 07                    je     4010e0 
  4010d9:    bf 40 40 40 00           mov    $0x404040,%edi
  4010de:    ff e0                    jmpq   *%rax
  4010e0:    c3                       retq   
  4010e1:    66 66 2e 0f 1f 84 00     data16 nopw %cs:0x0(%rax,%rax,1)
  4010e8:    00 00 00 00 
  4010ec:    0f 1f 40 00              nopl   0x0(%rax)
  4010f0:    f3 0f 1e fa              endbr64 
  4010f4:    80 3d 45 2f 00 00 00     cmpb   $0x0,0x2f45(%rip)        # 404040 
  4010fb:    75 13                    jne    401110 
  4010fd:    55                       push   %rbp
  4010fe:    48 89 e5                 mov    %rsp,%rbp
  401101:    e8 7a ff ff ff           callq  401080 
  401106:    c6 05 33 2f 00 00 01     movb   $0x1,0x2f33(%rip)        # 404040 
  40110d:    5d                       pop    %rbp
  40110e:    c3                       retq   
  40110f:    90                       nop
  401110:    c3                       retq   
  401111:    66 66 2e 0f 1f 84 00     data16 nopw %cs:0x0(%rax,%rax,1)
  401118:    00 00 00 00 
  40111c:    0f 1f 40 00              nopl   0x0(%rax)
  401120:    f3 0f 1e fa              endbr64 
  401124:    eb 8a                    jmp    4010b0 
  401126:    66 2e 0f 1f 84 00 00     nopw   %cs:0x0(%rax,%rax,1)
  40112d:    00 00 00 
  401130:    55                       push   %rbp
  401131:    48 89 e5                 mov    %rsp,%rbp
  401134:    66 0f ef c0              pxor   %xmm0,%xmm0
  401138:    f2 0f 10 05 f0 2e 00     movsd  0x2ef0(%rip),%xmm0        # 404030 
  40113f:    00 
  401140:    f2 0f 10 15 e8 2e 00     movsd  0x2ee8(%rip),%xmm2        # 404030 
  401147:    00 
  401148:    f2 0f 58 c2              addsd  %xmm2,%xmm0
  40114c:    48 c7 c0 01 00 00 00     mov    $0x1,%rax
  401153:    48 bf 38 40 40 00 00     movabs $0x404038,%rdi
  40115a:    00 00 00 
  40115d:    e8 ce fe ff ff           callq  401030 
  401162:    48 89 ec                 mov    %rbp,%rsp
  401165:    5d                       pop    %rbp
  401166:    c3                       retq   
  401167:    66 0f 1f 84 00 00 00     nopw   0x0(%rax,%rax,1)
  40116e:    00 00 
  401170:    f3 0f 1e fa              endbr64 
  401174:    41 57                    push   %r15
  401176:    49 89 d7                 mov    %rdx,%r15
  401179:    41 56                    push   %r14
  40117b:    49 89 f6                 mov    %rsi,%r14
  40117e:    41 55                    push   %r13
  401180:    41 89 fd                 mov    %edi,%r13d
  401183:    41 54                    push   %r12
  401185:    4c 8d 25 74 2c 00 00     lea    0x2c74(%rip),%r12        # 403e00 
  40118c:    55                       push   %rbp
  40118d:    48 8d 2d 74 2c 00 00     lea    0x2c74(%rip),%rbp        # 403e08 
  401194:    53                       push   %rbx
  401195:    4c 29 e5                 sub    %r12,%rbp
  401198:    48 83 ec 08              sub    $0x8,%rsp
  40119c:    e8 5f fe ff ff           callq  401000 
  4011a1:    48 c1 fd 03              sar    $0x3,%rbp
  4011a5:    74 1f                    je     4011c6 
  4011a7:    31 db                    xor    %ebx,%ebx
  4011a9:    0f 1f 80 00 00 00 00     nopl   0x0(%rax)
  4011b0:    4c 89 fa                 mov    %r15,%rdx
  4011b3:    4c 89 f6                 mov    %r14,%rsi
  4011b6:    44 89 ef                 mov    %r13d,%edi
  4011b9:    41 ff 14 dc              callq  *(%r12,%rbx,8)
  4011bd:    48 83 c3 01              add    $0x1,%rbx
  4011c1:    48 39 dd                 cmp    %rbx,%rbp
  4011c4:    75 ea                    jne    4011b0 
  4011c6:    48 83 c4 08              add    $0x8,%rsp
  4011ca:    5b                       pop    %rbx
  4011cb:    5d                       pop    %rbp
  4011cc:    41 5c                    pop    %r12
  4011ce:    41 5d                    pop    %r13
  4011d0:    41 5e                    pop    %r14
  4011d2:    41 5f                    pop    %r15
  4011d4:    c3                       retq   
  4011d5:    66 66 2e 0f 1f 84 00     data16 nopw %cs:0x0(%rax,%rax,1)
  4011dc:    00 00 00 00 
  4011e0:    f3 0f 1e fa              endbr64 
  4011e4:    c3                       retq   

Disassembly of section .fini:

00000000004011e8 <.fini>:
  4011e8:    f3 0f 1e fa              endbr64 
  4011ec:    48 83 ec 08              sub    $0x8,%rsp
  4011f0:    48 83 c4 08              add    $0x8,%rsp
  4011f4:    c3                       retq 
The arg -h can show some debug sections from file:
[mythcat@desk fasm]$ objdump -h sum 

sum:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .interp       0000001c  00000000004002a8  00000000004002a8  000002a8  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  00000000004002c4  00000000004002c4  000002c4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  00000000004002e4  00000000004002e4  000002e4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .gnu.hash     0000001c  0000000000400308  0000000000400308  00000308  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00000060  0000000000400328  0000000000400328  00000328  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       00000049  0000000000400388  0000000000400388  00000388  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  00000008  00000000004003d2  00000000004003d2  000003d2  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000020  00000000004003e0  00000000004003e0  000003e0  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.dyn     00000030  0000000000400400  0000000000400400  00000400  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rela.plt     00000018  0000000000400430  0000000000400430  00000430  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         0000001b  0000000000401000  0000000000401000  00001000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          00000020  0000000000401020  0000000000401020  00001020  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         000001a5  0000000000401040  0000000000401040  00001040  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         0000000d  00000000004011e8  00000000004011e8  000011e8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       00000010  0000000000402000  0000000000402000  00002000  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 00000034  0000000000402010  0000000000402010  00002010  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     000000c8  0000000000402048  0000000000402048  00002048  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .init_array   00000008  0000000000403e00  0000000000403e00  00002e00  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 18 .fini_array   00000008  0000000000403e08  0000000000403e08  00002e08  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 19 .dynamic      000001e0  0000000000403e10  0000000000403e10  00002e10  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 20 .got          00000010  0000000000403ff0  0000000000403ff0  00002ff0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 21 .got.plt      00000020  0000000000404000  0000000000404000  00003000  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 22 .data         00000020  0000000000404020  0000000000404020  00003020  2**4
                  CONTENTS, ALLOC, LOAD, DATA
 23 .bss          00000008  0000000000404040  0000000000404040  00003040  2**0
                  ALLOC
 24 .comment      0000002c  0000000000000000  0000000000000000  00003040  2**0
                  CONTENTS, READONLY
 25 .gnu.build.attributes 00000558  0000000000406048  0000000000406048  0000306c  2**2
                  CONTENTS, READONLY
This is just a part from all commands and tools that handle assembly files.

Friday, November 16, 2018

Fedora 29 : PyQt5 with Qt5 Designer tool.

The Fedora Linux distro can provide many tools and options for programming.
For example, you can use PyQt5 python module to create applications.
The Qt Designer tool can be used to create ui type file and used it.
Let's see this example.
First, open the tool in Fedora distro:
The tool can be used to create GUI for your application.
The result is one file with the extension ui.
I create one main window and I save the file with the name: untitled.ui.
This file can be used with the PyQt5 python module:
from PyQt5 import QtWidgets, uic
import sys
app = QtWidgets.QApplication([])
# location of .ui type file create with PyQt5 designer 
win = uic.loadUi("untitled.ui")
win.show()
app.exec_()
Run this python source code and you will see the result:

Thursday, November 8, 2018

Fedora 29 : System Storage Manager tool.

This Linux tool comes with this intro:
System Storage Manager provides an easy to use command line interface to manage your storage using various technologies like lvm, btrfs, encrypted volumes and more.
Today I will show an easy way to fix the size of your size of the volume and the file system.
Fist you need to install it with dnf tool :
[root@desk mythcat]# dnf install system-storage-manager
Last metadata expiration check: 1:11:16 ago on Thu 08 Nov 2018 08:04:29 PM EET.
Package system-storage-manager-1.2-1.fc29.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Use this command to fill up to 100%:
[root@desk mythcat]# ssm resize -s +100%FREE /dev/mapper/fedora-root 
Display the information about all detected devices, pools, volumes, and snapshots, see:
[root@desk mythcat]# ssm list
-------------------------------------------------------------
Device        Free       Used      Total  Pool    Mount point
-------------------------------------------------------------
Check the file system consistency on the volume ( this cannot be use with swap ).
[root@desk mythcat]# ssm check
You can read more about this tool here.

Monday, November 5, 2018

Fedora 29 : the new Fedora 29.

It has been announced for some time to launch Fedora.
Today I have appeared on the interface the possibility to change the old Fedora 28 to Fedora 29.
The interface appeared and I had to click the Download button and then the Install button.
The download process was fast. If you do not have enough disk space then the installation will not work.
After you click the Install button, the installation process will take care of the installation.
Finally, a reset of the distribution will start the new Fedora 29.
I have not found any irregularities or operating problems.
From now on, my posts, tests, and tutorials will be with Fedora 29.

Friday, November 2, 2018

Fedora 28 : Create a ISO image with stage2 and kernel ELF .

The tutorial for today solves the problem of creating an ISO image.
This image can be run and test with QEMU tool emulator like any ISO CDROM image.
You can build your kernel with any assembler and use this steps to test it.
I used the FASM assembly tool. Into my fasm folder I create these folders:
[mythcat@desk fasm]$ mkdir -p iso/boot/grub
You need a stage2 file known like: stage2_eltorito.
This file uses the El Torito is a specification for bootable CD using BIOS functions.
The GRUB supports the no emulation mode in the El Torito specification.
El Torito file booting begins by the Boot Record of the ISO 9660 filesystem at block address 0x11.
You can get this file from your Linux distro of you can find installed into old GRUB.
Put this file into grub folder:
[mythcat@desk fasm] cp /usr/lib/grub/i386-pc/stage2_eltorito  iso/boot/grub/
Use fasm tool with your kernel and use this commands to create the ISO file:
[mythcat@desk fasm]$ ./fasm kernel.asm 
flat assembler  version 1.73.04  (16384 kilobytes memory)
2 passes, 16756 bytes.
[mythcat@desk fasm]$ cp kernel.o iso/boot/kernel.k
[mythcat@desk fasm]$ cat > iso/boot/grub/menu.lst << EOF
> default 0
> timeout 1
> title fasm multiboot
> kernel /boot/kernel.k
> EOF
[mythcat@desk fasm]$ genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4
 -boot-info-table -o mykernel.iso iso

I: -input-charset not specified, using utf-8 (detected in locale settings)
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 920
Total directory bytes: 4096
Path table size(bytes): 34
Max brk space used 24000
241 extents written (0 MB)
Now you can test the result:
[mythcat@desk fasm]$ qemu-system-i386 -cdrom mykernel.iso
This is result of my kernel:

Sunday, October 28, 2018

Fedora 28 : The edb debugger.

Today I tested one debug for assembly language.
I used FASM programming language because is very flexible.
The main goal was to find a good debugger and I try the edb debugger.
If you try to use the Fedora dnf tool then you get an older version of this debugger.
[root@desk mythcat]# dnf install edb.x86_64

Because this package is old I try to compile it from source code from github.
Let's see this steps:
[mythcat@desk fasm]$ git clone --recursive https://github.com/eteran/edb-debugger.git

Cloning into 'edb-debugger'...
remote: Enumerating objects: 192, done.
remote: Counting objects: 100% (192/192), done.
...
[root@desk mythcat]# dnf install git make qt5-devel gcc gcc-c++ boost-devel cmake capstone-devel
...
[mythcat@desk edb-debugger]$ mkdir build
[mythcat@desk edb-debugger]$ cd build

[mythcat@desk build]$ cmake ..
-- Boost version: 1.66.0
-- Checking for module 'capstone>=3.0.4'
--   Found capstone, version 3.0.5
-- Checking for module 'libgvc>=2.38.0'
--   Package 'libgvc', required by 'virtual:world', not found
-- Checking for module 'double-conversion'
-- Looking for C++ include double-conversion/double-conversion.h
-- Looking for C++ include double-conversion/double-conversion.h - not found
CMake Warning at CMakeLists.txt:56 (message):
  libdouble-conversion header wasn't found.  32- and 64-bit floating-point
  values will be showed with max_digits10 digits of precision instead of
  shortest representation.


-- Checking for module 'gdtoa-desktop'
--   Package 'gdtoa-desktop', required by 'virtual:world', not found
CMake Warning at CMakeLists.txt:113 (message):
  gdtoa-desktop package wasn't found.  80-bit floating-point values will be
  showed with max_digits10 digits of precision instead of shortest
  representation.


-- Configuring done
-- Generating done
-- Build files have been written to: /home/mythcat/fasm/edb-debugger/build

[mythcat@desk build]$ make
Scanning dependencies of target edb_autogen
...
You can see the executable file named edb into the build folder.
Just run it and the debugger starts.
Into the next image you can see a simple executable run into this debugger:

Monday, October 22, 2018

Fedora 28 : Alien, Steam and Fedora distro.

Today I tried an incurs in converting deb files into packages rpm for Fedora 28.
As you well know, the alien utility is used to solve this problem.
The Debian package I tried to convert is the Steam gaming utility.
[mythcat@desk ~]$ su
Password: 
[root@desk mythcat]# dnf search alien
Last metadata expiration check: 0:02:59 ago on Mon 22 Oct 2018 08:15:33 PM EEST.
========================= Name Exactly Matched: alien ==========================
alien.noarch : Converter between the rpm, dpkg, stampede slp, and Slackware tgz
             : file formats
[root@desk mythcat]# dnf install alien.noarch 
Last metadata expiration check: 0:05:58 ago on Mon 22 Oct 2018 08:15:33 PM EEST.

...
Complete!

[root@desk mythcat]# cd Downloads/

[root@desk Downloads]# alien --scripts -r steam_latest.deb
steam-launcher-1.0.0.56-2.noarch.rpm generated
The next step is the install process:
[root@desk Downloads]# dnf install steam-launcher-1.0.0.56-2.noarch.rpm
Last metadata expiration check: 0:17:36 ago on Mon 22 Oct 2018 08:15:33 PM EEST.
Dependencies resolved.
================================================================================
 Package              Arch         Version             Repository          Size
================================================================================
Installing:
 steam-launcher       noarch       1.0.0.56-2          @commandline       2.8 M

Transaction Summary
================================================================================
Install  1 Package

Total size: 2.8 M
Installed size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
  file / from install of steam-launcher-1.0.0.56-2.noarch conflicts with file from package filesystem-3.8-2.fc28.x86_64
  file /lib from install of steam-launcher-1.0.0.56-2.noarch conflicts with file from package filesystem-3.8-2.fc28.x86_64
  file /usr/bin from install of steam-launcher-1.0.0.56-2.noarch conflicts with file from package filesystem-3.8-2.fc28.x86_64
  file /usr/lib from install of steam-launcher-1.0.0.56-2.noarch conflicts with file from package filesystem-3.8-2.fc28.x86_64

Error Summary
-------------
The problem comes from the conversion and I try to see I have the correct packages into my Fedora 28 distro.
[root@desk Downloads]# dnf search filesystem-3.8-2.fc28.x86_64
Last metadata expiration check: 0:19:14 ago on Mon 22 Oct 2018 08:15:33 PM EEST.
No matches found.
[root@desk Downloads]# dnf search filesystem
Last metadata expiration check: 0:20:17 ago on Mon 22 Oct 2018 08:15:33 PM EEST.
======================= Name Exactly Matched: filesystem =======================
filesystem.x86_64 : The basic directory layout for a Linux system
====================== Name & Summary Matched: filesystem ======================
[root@desk Downloads]# dnf install filesystem.x86_64
Last metadata expiration check: 0:22:13 ago on Mon 22 Oct 2018 08:15:33 PM EEST.
Package filesystem-3.8-2.fc28.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
I try again to see is something new , but I got the same error.
[root@desk Downloads]# dnf install steam-launcher-1.0.0.56-2.noarch.rpm
In conclusion: Fedora distro solves a number of shortcomings in the field of package management, but the efforts of the development team do not resolve to cover user requirements. However, the alien utility remains a very important step in the development process that should be updated and optimized to implement new software. I would add here my attempts to create Fedora packets with software that works normally on this distro (Blender 3D - version 2.8).
Let's hope that the Fedora development team will resolve these issues until the next version of this distro.

Saturday, October 13, 2018

Fedora 28 : Fix XFS internal error XFS_WANT_CORRUPTED_GOTO .

It is a common kernel error created under certain predefined conditions.
...kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO...
# xfs_repair -L /dev/mapper/fedora-root
# xfs_repair -L /dev/mapper/fedora-swap
# reboot
This will fix this error.

Wednesday, October 10, 2018

Fedora 28 : Testing Blender 2.80 .

I tested the new Blender 2.80 alpha 2 version and is working well.
You can start to download it from the official download page.
The next step: unarchive the tar.bz file and run the blender from the newly created folder.
I try to create a package but seems the tool not working with the .spec file.
This is a screenshot with this Blender 3D software running in my Fedora 28.

Thursday, October 4, 2018

Fedora 28 : Strife another golang game framework.

Today I tested this 2D game framework named Strife.
You can read more about this from the official website.
The development team tells us:
  "This a work in progress. It provides a very minimal toolset for rendering shapes, images, and text as well as capturing user input."
This game framework uses SDL2 libraries.
Strife is open source and available under the MIT license.
Let's start with installation into Fedora 28 distro.
[root@desk mythcat]# dnf install SDL2-devel.x86_64
[root@desk mythcat]# dnf install SDL2_ttf-devel.x86_64 
[root@desk mythcat]# dnf install SDL2_image-devel.x86_64 
[mythcat@desk ~]$ go get github.com/felixangell/strife
[mythcat@desk ~]$ cd $GOPATH/src/github.com/felixangell/strife
I test one example from installation folder with particles:
[mythcat@desk strife]$ cd example/particles
[mythcat@desk particles]$ go run particles.go
2018/10/04 22:13:18 initializing window  1280 x 720
2018/10/04 22:13:18 dpi, default_dpi =  0 72
2018/10/04 22:13:21 Loading font  /usr/share/fonts/DejaVuSans.ttf
2018/10/04 22:13:21 Failed to load font at '/usr/share/fonts/DejaVuSans.ttf'
 ' try setting a font yourself with strife.LoadFont
resize to  1280 x 960
resize to  1280 x 960
resize to  1280 x 720
resize to  1280 x 720
closing window!
This is result of the running example:

Monday, October 1, 2018

Fedora 28 : Web development with Nikola and python.

The development team comes with this info about Nikola:
Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter Notebooks into blog posts! It also supports image galleries and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of do it (which is rebuilding only what has been changed).
I tested today with Fedora 28 and python version 2.7.15.
If you take a look at Nikola handbook, you will see all the features, options and settings you need for web development.
The installation is very simple:
[mythcat@desk ~]$ pip install Nikola --user
Collecting Nikola
...
Installing collected packages: Nikola
Successfully installed Nikola-7.8.15

[mythcat@desk ~]$ nikola init mysite
[2018-10-01T14:09:02Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:09:02Z] WARNING: bundles: Setting USE_BUNDLES to False.
Creating Nikola Site
====================

This is Nikola v7.8.15.  We will now ask you a few easy questions about your new site.
If you do not want to answer and want to go with the defaults instead, simply restart with the `-q` parameter.
--- Questions about the site ---
Site title [My Nikola Site]: my_website
Site author [Nikola Tesla]: catafest
Site author's e-mail [n.tesla@example.com]: catafest@yahoo.com
Site description [This is a demo site for Nikola.]: website with Nikola static sit
Site URL [https://example.com/]: http://example.com
    The URL does not end in '/' -- adding it.
Enable pretty URLs (/page/ instead of /page.html) that don't need web server configuration? [Y/n] y
--- Questions about languages and locales ---
We will now ask you to provide the list of languages you want to use.
Please list all the desired languages, comma-separated, using ISO 639-1 codes.  
The first language will be used as the default.
Type '?' (a question mark, sans quotes) to list available languages.
Language(s) to use [en]: en

Please choose the correct time zone for your blog. Nikola uses the tz database.
You can find your time zone here:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Time zone [Europe/Bucharest]: 
    Current time in Europe/Bucharest: 17:12:36
Use this time zone? [Y/n] y
--- Questions about comments ---
You can configure comments now.  Type '?' (a question mark, sans quotes) to list available comment systems.  
If you do not want any comments, just leave the field blank.
Comment system: 

That's it, Nikola is now configured.  Make sure to edit conf.py to your liking.
If you are looking for themes and addons, check out https://themes.getnikola.com/ and https://plugins.getnikola.com/.
Have fun!
[2018-10-01T14:12:54Z] INFO: init: Created empty site at mysite.
Now you can build and start the server with this command:
[mythcat@desk ~]$ cd mysite/
[mythcat@desk mysite]$ ls
cache  conf.py  conf.pyc  files  galleries  listings  pages  posts
[mythcat@desk mysite]$ nikola build
[2018-10-01T14:14:51Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:14:51Z] WARNING: bundles: Setting USE_BUNDLES to False.
Scanning posts........done!
.  render_posts:timeline_changes
...
[2018-10-01T14:14:52Z] WARNING: Nikola: Python 2 is old and busted. Python 3 is the new hotness.
[2018-10-01T14:14:52Z] WARNING: Nikola: Nikola is going to deprecate Python 2 support in 2017. You already have Python 3
available in your system. Why not switch?

Please check http://bit.ly/1FKEsiX for details.

.  sitemap:output/sitemap.xml
.  sitemap:output/sitemapindex.xml
.  robots_file:output/robots.txt
[mythcat@desk mysite]$ nikola serve -b 
Let's see the result of this running server:
To add a post just use this command:
[mythcat@desk mysite]$ nikola new_post
[2018-10-01T14:16:09Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:16:09Z] WARNING: bundles: Setting USE_BUNDLES to False.
Creating New Post
-----------------

Title: New post
Scanning posts........done!
[2018-10-01T14:16:24Z] INFO: new_post: Your post's text is at: posts/new-post.rst

[mythcat@desk mysite]$ nikola build
[2018-10-01T14:16:34Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:16:34Z] WARNING: bundles: Setting USE_BUNDLES to False.
Scanning posts........done!
.  render_posts:timeline_changes
The result will be this:

There are a few themes for Nikola available at the Themes Index.
[mythcat@desk mysite]$ nikola theme -l
[2018-10-01T14:21:20Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:21:20Z] WARNING: bundles: Setting USE_BUNDLES to False.
Available Themes:
-----------------
blogtxt
bnw
bootblog
bootblog-jinja
bootstrap
bootstrap-jinja
bootstrap3-gradients
bootstrap3-gradients-jinja
cadair
canterville
carpet
detox
foundation6
hack
hemingway
hpstr
hyde
jidn
lanyon
libretto
lotabout
material-theme
maupassant
mdl
monospace
oldfashioned
planetoid
readable
reveal
reveal-jinja
slidemenu
srcco.de
yesplease
zen
zen-forkawesome
zen-ipython
zen-jinja

Saturday, September 29, 2018

Fedora 28 : Integrate tinymce editor with Fedora and Django.

This is a raw tutorial about how to integrate the python module named django-tinymce with a Django project.
I used the raw word because you need to have a working Django project into your Fedora distro.
You can see my old tutorial about Django to see how to build a Django project.
About this python module, you can read more here.
The django-tinymce is a Django application that contains a widget to render a form field as a TinyMCE editor.
I have a project named trydjango with a Django application named products into my django folder.
I used activate command to activate my virtual environment:
[mythcat@desk django]$ source bin/activate
I install this python module named django-tinymce:
(django) [mythcat@desk django]$ pip install django-tinymce4-lite
Collecting django-tinymce4-lite
...
Installing collected packages: jsmin, django-tinymce4-lite
Successfully installed django-tinymce4-lite-1.7.2 jsmin-2.2.2
Let's see my folder project django named src:
(django) [mythcat@desk django]$ cd src/
(django) [mythcat@desk src]$ ll
total 136
-rw-r--r--. 1 mythcat mythcat 135168 Sep 28 12:21 db.sqlite3
-rwxrwxr-x. 1 mythcat mythcat    541 Sep 23 18:56 manage.py
drwxrwxr-x. 4 mythcat mythcat    142 Sep 26 21:45 pages
drwxrwxr-x. 4 mythcat mythcat    142 Sep 28 18:30 products
drwxrwxr-x. 3 mythcat mythcat    112 Sep 28 12:04 templates
drwxrwxr-x. 3 mythcat mythcat     93 Sep 28 12:14 trydjango
The installation is simple and star with to your settings.py and url.py file:
(django) [mythcat@desk src]$ cd trydjango/
(django) [mythcat@desk trydjango]$ vim settings.py 

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'products',
    'tinymce',
]
(django) [mythcat@desk trydjango]$ vim urls.py

from django.contrib import admin
from django.urls import path, include

from pages.views import home_view, about_view, contact_view
from products.views import product_detail_view

urlpatterns = [
    path('', home_view, name='home'),
    path('about/', about_view),
    path('contact/',contact_view),
    path('admin/',admin.site.urls),
    path('product/',product_detail_view),
    path(r'^tinymce/', include('tinymce.urls')),
This is my change I used to add the tinymce editor into my django application named products.
(django) [mythcat@desk products]$ vim models.py
from django.db import models
from tinymce.models import HTMLField

# Create your models here.
class Product(models.Model):
    title = models.CharField(max_length=120)
#    description = models.TextField(blank=True, null=True)
    description = HTMLField()
    price = models.DecimalField(decimal_places=2, max_digits=1000)
    summary = models.TextField(default='this is cool!')
You can see I used HTMLField and default come is TextField.
The result of this changes can see into the next output:

Thursday, September 27, 2018

Fedora 28 : Show a video with Google Apps Script.

It's not a tutorial specific to Fedora's distribution, but many users of this are programmers or developers and its tutorial is very useful.
The tutorial is about how to display a video in a sidebar on a Google document.
I used Google Apps Script to do this.
You can see the tutorial here.
This is a screenshot with the output of this tutorial:

Monday, September 24, 2018

Fedora 28 : Add the Fedora logo to the Google document.

I've been able to progress with Google Apps Script.
The latest tutorial with number 008.
This tutorial is about adding a logo and creating an add-on to a document in google drive.
See the full tutorial here, and result of this addon:

Sunday, September 23, 2018

Fedora 28 : Start a service daemon with Python.

In this tutorial I will starting one service using systemctl , python and systemd. First, you need to create a file named testpython.service .
[mythcat@desk system]# cd /etc/systemd/system/
[root@desk system]# vim testpython.service
This file is a configuration file for this service.
[Unit]
Description=Python Service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python /home/mythcat/test_service.py
[Install]
WantedBy=multi-user.target
Create the python file for this service. I named test_service.py .
[root@desk system]# exit
exit
[mythcat@desk system]$ cd ~
[mythcat@desk ~]$ vim test_service.py

#!/usr/bin/env python

import logging
import time

logging.basicConfig(level="INFO")

while True:
    logging.info("Hi")
    time.sleep(3)
Change permissions file for this python file and testpython.service, see:
[mythcat@desk ~]$ chmod 764 test_service.py
Because you run this service with systemd then selinux will send you error, fix that:
[mythcat@desk ~]$ chcon -t bin_t ~/test_service.py
Reload all services and start your service with this commands:
[root@desk system]# systemctl daemon-reload
[root@desk system]# systemctl start  testpython.service
[root@desk system]# systemctl status  testpython.service
● testpython.service - Python Service
   Loaded: loaded (/etc/systemd/system/testpython.service; enabled; vendor>
   Active: active (running) since Sat 2018-09-22 21:36:23 EEST; 5s ago
 Main PID: 7213 (python)
    Tasks: 1 (limit: 2102)
   Memory: 5.7M
   CGroup: /system.slice/testpython.service
           └─7213 /usr/bin/python /home/mythcat/test_service.py

Sep 22 21:36:23 desk systemd[1]: Started Python Service.
Sep 22 21:36:24 desk python[7213]: INFO:root:Hi
Sep 22 21:36:27 desk python[7213]: INFO:root:Hi
You can use the journalctl command to see the output of this service:
[root@desk system]# journalctl -u testpython.service 
-- Logs begin at Sat 2018-09-22 20:40:06 EEST, end at Sat 2018-09-22 21:31:07 EEST. --
Sep 22 20:40:06 desk python[6232]: INFO:root:Hi
Sep 22 20:40:09 desk python[6232]: INFO:root:Hi
Sep 22 20:40:12 desk python[6232]: INFO:root:Hi
Sep 22 20:40:15 desk python[6232]: INFO:root:Hi
Sep 22 20:40:18 desk python[6232]: INFO:root:Hi
Sep 22 20:40:21 desk python[6232]: INFO:root:Hi
Sep 22 20:40:24 desk python[6232]: INFO:root:Hi
Sep 22 20:40:27 desk python[6232]: INFO:root:Hi
Sep 22 20:40:30 desk python[6232]: INFO:root:Hi
Let's see the result: