Pages

Tuesday, April 17, 2018

Fedora 28 : GoLang first example .

This tutorial is about GoLang IDE . About this IDE you can read more here - my intro article about this IDE.
I try to used with the platform-native GUI library for Go named andlabs/ui.
First, after you install the IDE you can check the settings on menu Settings: Using this tool with Fedora 28 is easy.
About the first install of andlabs/ui then this come with this error:
[mythcat@desk ~]$ go get github.com/andlabs/ui
# pkg-config --cflags gtk+-3.0
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
pkg-config: exit status 1
That tell us is need to install some packages from Fedora repo:
# dnf install gtk3-devel
I used this source code to test the andlabs/ui:
package main

import (
   "github.com/andlabs/ui"
)

func main() {
   err := ui.Main(func() {
      input := ui.NewEntry()
      button := ui.NewButton("Greet")
      greeting := ui.NewLabel("")
      box := ui.NewVerticalBox()
      box.Append(ui.NewLabel("Enter your name:"), false)
      box.Append(input, false)
      box.Append(button, false)
      box.Append(greeting, false)
      window := ui.NewWindow("Hello", 200, 100, false)
      window.SetMargined(true)
      window.SetChild(box)
      button.OnClicked(func(*ui.Button) {
         greeting.SetText("Hello, " + input.Text() + "!")
      })
      window.OnClosing(func(*ui.Window) bool {
         ui.Quit()
         return true
      })
      window.Show()
   })
   if err != nil {
      panic(err)
   }
}
First time was run well and after I restart the IDE I got this error:
# gui_test
/usr/lib/golang/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
gcc: error: /home/mythcat/go/src/github.com/andlabs/ui/libui_linux_amd64.a: No such file or directory

The problem come from GoLang IDE settings and andlabs/ui.
I remove and install again the andlabs/ui and now working well.
The result of this source code come with this output:

Saturday, April 14, 2018

Fedora 28 : The VS Code on Fedora.

The Visual Studio Code is an editor for development and includes the features you need for highly productive source code editing.
You can use this editor with many Linux distros.
Today I tested with Fedora 28 distro version.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/
vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then use dnf to check and install this editor.
#dnf check-update
#dnf install code
Next step is to install extensions for Python, Golang, PHP, C# and more.

Saturday, April 7, 2018

Fedora 28 : Golang by JetBrains .

This I.D.E. is a commercial and a free 30-day trial.
The price varies :
  • € 199.00 /1st year
  • € 159.00 /2nd year
  • € 119.00 /3rd yr onwards
JetBrains s.r.o. is a software development company whose tools are targeted towards software developers and project managers. 
... 
JetBrains, creator of the leading Java IDE - IntelliJ IDEA - is a cutting-edge software vendor specializing in the creation of intelligent development tools.

The development team come with this infos about the Golang I.D.E. :
GoLand is a new commercial IDE by JetBrains aimed at providing an ergonomic environment for Go development.
... 
The new IDE extends the IntelliJ platform with the coding assistance and tool integrations specific for the Go language.

You can download it from here.
The tree command show install files:
[mythcat@desk bin]$ tree
.
├── format.sh
├── fsnotifier
├── fsnotifier64
├── fsnotifier-arm
├── goland64.vmoptions
├── goland.png
├── goland.sh
├── goland.vmoptions
├── idea.properties
├── inspect.sh
├── libyjpagent-linux64.so
├── libyjpagent-linux.so
├── log.xml
├── printenv.py
└── restart.py

0 directories, 15 files

Some screenshots with this  linux tool:





Sunday, April 1, 2018

Fedora 27 : Fix your distro with systemctl .

This is a simple tutorial about systemctl tool and how to fix one simple error show by status. The help of this cmmand can be found with:
# man systemctl
Let's see how we can see this errors and how this working. First let's see the status for systemctl command (:
# systemctl status
The output is this:
    ● laptop
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: Sun 2018-04-01 10:44:37 EEST; 58min ago
   CGroup: /
           ├─user.slice
           │ └─user-1000.slice
           │   ├─user@1000.service
           │   │ └─init.scope
           │   │   ├─929 /usr/lib/systemd/systemd --user
           │   │   └─931 (sd-pam)
           │   └─session-1.scope
           │     ├─ 748 login -- mythcat
           │     ├─ 936 -bash
           │     ├─ 982 sudo su
           │     ├─ 986 su
           │     ├─ 987 bash
           │     └─9879 systemctl status
           ├─init.scope
           │ └─1 /usr/lib/systemd/systemd --switched-root --system --deserialize 24
           └─system.slice
             ├─irqbalance.service
             │ └─655 /usr/sbin/irqbalance --foreground
             ├─lvm2-lvmetad.service
             │ └─578 /usr/sbin/lvmetad -f -t 3600
             ├─firewalld.service
             │ └─698 /usr/bin/python3 -Es /usr/sbin/firewalld --nofork --nopid
 ...
Detect the problem from list all failed units:
# systemctl list-units --state=failed
I find the rngd module is the problem. To fix this issue just use this commands:
# systemctl daemon-reload
# systemctl status rngd 
# systemctl stop rngd
# systemctl disable rngd
# systemctl enable rngd
# systemctl start rngd
The next step is reboot and check again if systemctl come with errors.

Saturday, March 31, 2018

Testing the Fedora SOAS.

These are some of the most beautiful projects I appreciate and that's why I'm writing about them.
First is a Fedora Spin with the abbreviations SOAS from Sugar on a Stick.
This Fedora Spin is lightweight and made to run off of a flash drive, or a live CD.
Originally Red Hat and Pentagram developed SoaS as part of the One Laptop Per Child project.
About One Laptop Per Child project you can read here.
They tell us about this project at official web page:
Sugar on a Stick is a Fedora-based operating system featuring the award-winning Sugar Learning Platform and designed to fit on an ordinary USB thumbdrive ("stick").
Let's see some screenshots:

News: Yahoo hit QupZilla.

Like most, you already know as an XFCE environment installation comes with QupZilla web browser.
The QupZilla web browser is a lightweight multiplatform web browser written in Qt Framework and using its web rendering engine QtWebEngine.
If you using Fedora 28 you can get the Falkon web browser.
The Wikipedia tells us about Falkon browser "(formerly QupZilla[3]) is a free and open-source web browser, intended for general users. Falkon is licensed under GPLv3."
The Falkon browser working well with Yahoo.

About QupZilla web browser.

I used this web browser with Fedora 27 distro and then I tested with new Fedora 28.
Same problem from both distros with the Yahoo mail and the QupZilla web browser.
After authenticating when you access the mail button, a message that redirects us to use other browsers.
Is it okay or bad?
Most users would like to have no such issues.

Thursday, March 29, 2018

Fedora 27 : Tips and tricks with hugo framework .

he most important fact in learning development is knowing the information flow and how to drain it knowing the elements and stages of information processing of the content.
That's why I wrote this article succinctly to show you how simple basics of exemplification can correctly complete and help the user to modify and create content.
I will show you how to follow steps into hugo framework and website development with hugo.
You need to read the basic of hugo terms from documentation if you want to learn all about hugo or take some helpful information.
First use --verbose flag gives extra information that will be helpful when we debug or build your hogo website.
You need to know your hugo version because is the old versions has bad issues, check it with:
$ hugo version
The next command is to see and debug your work:
$ hugo --verbose 
How hugo framework works when you start for the first time with hugo development.
Now, the first place that Hugo will look for rules and files is in the layouts/ directory so it will always find the skin.
If you start with hugo then you can change the default.
This files name skins are the files responsible for the look and feel of your site.
You have two ways to create a skin:
  • create it in the layouts/ directory;
  • create it in a sub-directory of the themes/ directory.
A skin in layouts/ folder can’t be customized without updating the templates and static files that it is built from.
The skin created in themes/ folder , can be and that makes it easier for other people to use it.
In my example tutorial , I add this text to themes/test_themes_001/layouts/index.html.
The result of running hugo server command will rput this text on your browser at 127.0.0.1:13131, see command:
$ hugo server --buildDrafts
The hugo command come with many features like :
  • --buildDrafts this include content marked as draft ( see files with draft:true from .md file);
  • --ignoreCache this ignores the cache directory if you use it;
Using --verbose let you to see your errors.
For example a bad template or configuration can come with this error:
 ...Unable to locate layout for "taxonomyTerm" ...
This show you what term created by you is not on your hugo development area.
I make just few changes to show you how the hugo working. First I create the website named hugo_website_001. I used hugo command to add some pages first_test.md and new.md and a theme named test_theme_001, see:
$ hugo new site hugo_website_001
$ cd hugo_website_001
$ hugo new theme test_theme_001
$ hugo new first_test.md
$ hugo new new.md
$ tree 
.
├── archetypes
│   └── default.md
├── config.toml
├── content
│   ├── first_test.md
│   └── new.md
├── data
├── fpaste_hugo.txt
├── layouts
├── public
│   ├── categories
│   │   └── index.xml
│   ├── css
│   ├── index.html
│   ├── index.xml
│   ├── js
│   ├── sitemap.xml
│   └── tags
│       └── index.xml
├── static
└── themes
    └── test_theme_001
        ├── archetypes
        │   └── default.md
        ├── layouts
        │   ├── 404.html
        │   ├── _default
        │   │   ├── list.html
        │   │   └── single.html
        │   ├── index.html
        │   ├── index.html.save
        │   └── partials
        │       ├── footer.html
        │       └── header.html
        ├── LICENSE.md
        ├── static
        │   ├── css
        │   └── js
        └── theme.toml

19 directories, 20 files
$ 
Let's see files for settings - the toml file type. First is the config.toml file:
baseURL = "http://localhost.com"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "test_theme_001"
contentdir ="content"
publishdir = "public"
The next file is the theme.toml .

# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example

name = "Test_theme_001"
license = "MIT"
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE.md"
description = "first theme with hugo"
homepage = "http://example.com/"
tags = ["tags","categories"]
features = []
min_version = "0.31"

[author]
  name = "catafest"
  homepage = "free-tutorials.org"

# If porting an existing theme
[original]
  name = ""
  homepage = ""
  repo = ""
I will show a minimal example to understand the changes you need to make to run well with hugo framework and the my custom theme.
I show next how this changes into files is show by hugo on browser.
The basic file load is the index.html from themes/test_theme_001/layouts folder with tag h2 and text Some text !, see:

Some text !


{{ partial "header.html" . }}
This file load another file from partials folder and is named header.html with tag p and this text:
This is a custom header
Let's run the hugo server :
hugo server --theme=test_theme_001 --buildDrafts --ignoreCache --disableFastRender
This is result is this: