Fedora People

And, they are online now

Posted by Harish Pillay 9v1hp on June 03, 2018 03:01 PM

Over a week ago, I was pinged by @l00g33k on twitter with a picture of a description of a piece of code I wrote in 1982.

That lead to a meet up and reliving a time where the only high technology thing I had was a 6502-based single board computer complete with 2K of RAM. It was a wonderful meet up and @l00g33k  was kind enough to handover to me a bag with 10 copies of the newsletter that was published by the Singapore Ohio Scientific Users Group. That was the very first computer user group I joined.

Suffice to say, I did help contribute to the newsletter by way of code to be run on the Superboard ][ – all in Basic.

I’ve scanned the 10 newsletters and it is now online.

I am really pleased to read in the Vol 1 #3 (page 36) a program to generate a calendar. The code is all in Basic. Feed it a year and out comes the calendar for the whole year.

Another piece of code is in Vol 1 #5 page 36 a program to print out the world map. That code was subsequently improved upon and published by another OSUG member to include actual times of cities – something that could only be done with the addiion of a real time clock circuitry on the Superboard ][.

A third program was in Vol 1 #6 page 26 that implemented a morse code transmitter.

I was very happy then (as I am now) that the code is out there even though none of us whose code was published in the newsletters had any notion of copyright. Code was there to be freely copied and worked on. Yes, a radical idea which in 1984 got codified by Richard Stallman’s Free Software Foundation (www.fsf.org).

F27 -> Fedora 28 Upgrade

Posted by Luigi Votta on June 03, 2018 08:28 AM
sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=28
sudo dnf system-upgrade reboot
 
Notes:
I had only a samll problem in the new system: gnome-terminal didn't load.
On bugzilla.redhat searching for gnome-terminal I found a solution that solved the "locale" issue, installing "langpacks-it".

Great!

Recuperando el acceso al usuario root

Posted by Alvaro Castillo on June 02, 2018 01:00 PM

¿Qué pasa cuando nos olvidamos de la contraseña de root?

— Cariño, ¿A dónde vas?

— Pues a comprar

— ¿No me das un beso?

— Pero..., si vuelvo en un momento

— Vale, vale...

Creo que tod@s l@s que hemos tenido pareja, entendemos esa escena en la que escuchamos ese Vale vale con cierto rintintín como si estuvieran diciendo "Oye te quedas sin postre esta noche"... Pues esto es igual, pero depende de la gravedad del asunto nos puede resultar un suplicio o podemos pasar un buen rato a...

More kbuild for reproducible builds

Posted by Laura Abbott on June 01, 2018 06:00 PM

I'm still working on patches to deal with build ids for the kernel. One issue I spent way too long figuring out was that if you just do a basic make for the kernel, some local environment information will be picked up on each build. This means that the build id will not be the same between builds of the same source tree because the sha1 sum is going to be different. This has the funny effect of meaning that the problem of unique build ids is actually solved for the vmlinux itself but still not modules or the vDSO.

Among the list of common commands you learn for Linux is uname. If you run uname -a you'll see something like

Linux localhost.localdomain 4.17.0-0.rc3.git4.1.fc29.x86_64 #1 SMP
Fri May 4 19:41:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

What's most interesting for this discussion is a subset with uname -v

#1 SMP Fri May 4 19:41:58 UTC 2018

This is some version information about when this kernel was built. All this can technically be namespaced but by default these values come from generated defines at compile time, specifically UTS_VERSION. You can see how this gets generated from scripts/mkcompile_h

The timestamp is fairly obvious and the Kbuild infrastructure provides an easy override to set it to a fixed value (KBUILD_BUILD_TIMESTAMP= some string that can be passed to date -d). A bit more obtuse (at least for me) was the #1. This is a value stored in a file called .version. This gets updated every time scripts/linux-vmlinux.sh is run. It is, in fact, designed to be a release number to differentiate between builds. After too many hours of debugging it also ends up feeling like some sort of achievement for a video game ("You have managed to compile the kernel .version times while working on this particular issue.") This can also be set with KBUILD_BUILD_VERSION.

The short and sweet summary is that if I actually want to verify things with build ids I can set KBUILD_BUILD_TIMESTAMP and KBUILD_BUILD_VERSION to fixed values to get a consistent build id across compiles. It's worth noting that modules can end up with a consistent build id without setting anything extra because they (typically) don't use UTS_VERSION anywhere. Now all I need to do is finish cleaning up some patches.

Fedora 28 : Using python to create old GUI.

Posted by mythcat on June 01, 2018 05:57 PM
The asciimatics python module provides a widgets sub-package that allows you to create interactive text user interfaces.
This python module let you to create full-screen text UIs and interactive forms to ASCII animations. The python module was created to working with any platform and python version 2 and 3.
It is licensed under the Apache Software Foundation License 2.0 , see this license here .
Let see the installation process using the Fedora 28 and python version 3.6:
[root@desk mythcat]# dnf install python3
Last metadata expiration check: 2:39:44 ago on Fri 01 Jun 2018 12:51:55 PM EEST.
Package python3-3.6.5-1.fc28.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
You need also to install the asciimatics python module using pip tool:
[mythcat@desk ~]$ pip3.6 install --user asciimatics
Collecting asciimatics
Using cached https://files.pythonhosted.org/packages/.../asciimatics-1.9.0-py2.py3-none-any.whl
Requirement already satisfied: future in /usr/local/lib/python3.6/site-packages (from asciimatics)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/site-packages (from asciimatics)
Requirement already satisfied: Pillow>=2.7.0 in /usr/lib64/python3.6/site-packages (from asciimatics)
Requirement already satisfied: pyfiglet>=0.7.2 in /usr/local/lib/python3.6/site-packages (from asciimatics)
Installing collected packages: asciimatics
Successfully installed asciimatics-1.9.0
I tested some sample from the author github account and is working good.
Some samples require some extra python module and you will need to install them.

Fedora 28 : The Lynis and system security .

Posted by mythcat on June 01, 2018 05:47 PM
Lynis is a lightweight and easy open source auditing tool to evaluate current system security.
The official webpage can be found here.
I tested the version 263 and now the Fedora development team test the 264 version.
This tool will show you a detailed report of each and every aspect of system :
  • Boot and services
  • Kernel
  • Memory and processes
  • Users, groups, and authentication
  • File systems
  • Home directories
  • File permissions
  • Software: Malware
  • Security frameworks
  • Logging and files
  • SSH support
# dnf install lynis 
# lynis audit system >> lynix_out.txt
The result is a text file ( 27 Kb sized for my system ) with all infos about your current system security.

Relayer ses courriels via gmail

Posted by Didier Fabert (tartare) on June 01, 2018 05:10 PM

Afin de s’affranchir du relais SMTP de son F.A.I. on peut utiliser son compte google (gmail) pour envoyer les courriels avec son serveur de courrier postfix. C’est bon pour la planète car cela supprime les intermédiaires entre son courrier et les services de renseignements peu scrupuleux de notre vie privée. En parlant de ça, quelqu’un a déjà réussi à faire une restauration à partir de la solution NSACloudBackup ?

Il suffit de modifier un tout petit peu la configuration de postfix (qui a été le service mail par défaut de fedora et qui est toujours celui de centos).

On édite le fichier, afin de rajouter ou de modifier les entrées suivantes:

Fichier /etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587

# use tls
smtp_use_tls=yes

# use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes

# path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# list of CAs to trust when verifying server certificate
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.trust.crt

# eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain

On génère le fichier fichier contenant les identifiants.

Fichier /etc/postfix/sasl_passwd
[smtp.gmail.com]:587  <email gmail>:<motdepasse>

On transforme ce fichier dans un langage compréhensible par postfix (fichiers indexés) et on supprime la version en clair

sudo postmap /etc/postfix/sasl_passwd
sudo rm /etc/postfix/sasl_passwd

On redémarre le service postfix et le tour est joué.

sudo systemctl restart postfix

Google considère que la seule méthode d’autentification sécurisée est OAuth2, et que SASL ne l’est pas. Il faudra donc autoriser les connexions “moins sécurisée” à son compte Google sur la page https://www.google.com/settings/security/lesssecureapps.

On teste la bonne réception d’un courriel envoyé avec la commande suivante:

echo 'Test from CLI' | mail -s 'gmail relay' <mon adresse email>

PHPUnit 7.2

Posted by Remi Collet on June 01, 2018 12:31 PM

RPM of PHPUnit version 7.2 are available in remi repository for Fedora ≥ 25 and for Enterprise Linux (CentOS, RHEL...).

Documentation :

emblem-notice-24.pngThis new major version requires PHP ≥ 7.1 and is not backward compatible with previous versions, so the package is designed to be installed beside version 5 and 6.

Installation, Fedora:

dnf --enablerepo=remi install phpunit7

Installation, Enterprise Linux:

yum --enablerepo=remi install phpunit7

Notice: this tool is an essential component of PHP QA in Fedora. This version will quickly be available in Fedora 28 as soon as review #1583468 will be approuved.

2018 May Elections to Council and Mindshare: Interviews

Posted by Fedora Community Blog on June 01, 2018 09:46 AM
Fedora Elections - All interviews published

Fedora Elections are here and it’s time to vote! All candidate interviews are published.

The 2018 May cycle of Elections to Council and Mindshare is in full swing. Voting officially began on Thursday, May 31st, and ends on Wednesday, June 6th at 23:59:59 UTC. Voting takes place on the Voting application website. As part of the Elections coverage on the Community Blog, the candidates running for seats published their interviews and established their platforms here. Are you getting ready to vote and looking for this information? You can find the full list of candidates and links to their interviews below.

Candidate Interviews

Fedora Council

Mindshare Committee

Vote!

Remember, the voting period ends this upcoming Wednesday, so make sure you get your votes in before the end of the Election. You can vote on the Voting application.

The post 2018 May Elections to Council and Mindshare: Interviews appeared first on Fedora Community Blog.

Download an OS with GNOME Boxes

Posted by Fedora Magazine on June 01, 2018 08:00 AM

Boxes is the GNOME application for running virtual machines. Recently Boxes added a new feature that makes it easier to run different Linux distributions. You can now automatically install these distros in Boxes, as well as operating systems like FreeBSD and FreeDOS. The list even includes Red Hat Enterprise Linux. The Red Hat Developer Program includes a no-cost subscription to Red Hat Enterprise Linux. With a Red Hat Developer account, Boxes can automatically set up a RHEL virtual machine entitled to the Developer Suite subscription. Here’s how it works.

Red Hat Enterprise Linux

To create a Red Hat Enterprise Linux virtual machine, launch Boxes and click New. Select Download an OS from the source selection list. At the top, pick Red Hat Enterprise Linux. This opens a web form at developers.redhat.com. Sign in with an existing Red Hat Developer Account, or create a new one.

If this is a new account, Boxes requires some additional information before continuing. This step is required to enable the Developer Subscription on the account. Be sure to accept the Terms & Conditions now too. This saves a step later during registration.

 

Click Submit and the installation disk image starts to download. The download can take a while, depending on your Internet connection. This is a great time to go fix a cup of tea or coffee!

Once the media has downloaded (conveniently to ~/Downloads), Boxes offers to perform an Express Install. Fill in the account and password information and click Continue. Click Create after you verify the virtual machine details. The Express Install  automatically performs the entire installation! (Now is a great time to enjoy a second cup of tea or coffee, if so inclined.)

Once the installation is done, the virtual machine reboots and logs directly into the desktop. Inside the virtual machine, launch the Red Hat Subscription Manager via the Applications menu, under System Tools. Enter the root password to launch the utility.

Click the Register button and follow the steps through the registration assistant. Log in with your Red Hat Developers account when prompted.

Now you can download and install updates through any normal update method, such as yum or GNOME Software.

FreeDOS anyone?

Boxes can install a lot more than just Red Hat Enterprise Linux, too. As a front end to KVM and qemu, Boxes supports a wide variety of operating systems. Using libosinfo, Boxes can automatically download (and in some cases, install) quite a few different ones.

To install an OS from the list, select it and finish creating the new virtual machine. Some OSes, like FreeDOS, do not support an Express Install. In those cases the virtual machine boots from the installation media. You can then manually install.

Popular operating systems on Boxes

These are just a few of the popular choices available in Boxes today.

Ubuntu 17.10

Pop!_OS 17.10

EndlessOS 3

Fedora 28

openSUSE Tumbleweed

Debian 9

Fedora updates its osinfo-db package regularly. Be sure to check back frequently for new OS options.

How to install Stride on Fedora RHEL CentOS

Posted by Danishka Navin on June 01, 2018 07:08 AM
Stride is the complete communication solution that empowers teams to talk less and do more. It's everything teams need to stay connected but keep moving.
Stride is a new kind of messaging that: 
  • Turns conversations into action with integrated collaboration tools
  • Brings all the right people together instantly with built-in voice and video conferencing
  • Gives you the space to disconnect when needed so you can get to done, faster
Please note that Stride is not an open source tool.
Still you can use stride on Fedora, CentOS or RHEL in case if your employer asked to use stride.

01. Create yum repo file

sudo cat /etc/yum.repos.d/stride-yum-repo.repo[stride-yum-repo]
name=Repo for Atlassian Stride
baseurl=https://packages.atlassian.com/stride-yum-client
gpgcheck=0
gpgkey=https://packages.atlassian.com/stride-yum-client/repodata/repomd.xml.key


02. sudo dnf makecache --repo=stride-yum-repo

03. sudo dnf install stride

Now start stride on Fedora, CentOS or RHEL.

 PS: I have tested on Fedora 28

Fin de vie de Fedora 26

Posted by Charles-Antoine Couret on June 01, 2018 06:00 AM

C'est en ce vendredi 1er juin 2018 que Fedora 26 a été déclaré comme en fin de vie.

Qu'est-ce que c'est ?

Un mois après la sortie d'une version de Fedora n, ici Fedora 28, la version n-2 (donc Fedora 26) est déclarée comme en fin de vie. Ce mois sert à donner du temps aux utilisateurs pour faire la mise à niveau. Ce qui fait qu'en moyenne une version est officiellement maintenue pendant 13 mois. Mais comme nous pouvons le voir, cela ne reste qu'une moyenne. Fedora 26 étant sortie tardivement (juillet 2017) il n'aura eu une maintenance que de 10 mois et demi !

En effet, la fin de vie d'une version signifie qu'elle n'aura plus de mises à jour et plus aucun bogue ne sera corrigé. Pour des questions de sécurité, avec des failles non corrigées, il est vivement conseillé aux utilisateurs de Fedora 26 et antérieurs d'effectuer la mise à niveau vers Fedora 28 ou 27.

Que faire ?

Si vous êtes concernés, il est nécessaire de faire la mise à niveau de vos systèmes. Vous pouvez télécharger des images CD ou USB plus récentes.

Il est également possible de faire la mise à niveau sans réinstaller via DNF ou GNOME Logiciels.

GNOME Logiciels a également dû vous prévenir par une pop-up de la disponibilité de Fedora 27 ou 28. N'hésitez pas à lancer la mise à niveau par ce biais.

All systems go

Posted by Fedora Infrastructure Status on June 01, 2018 12:12 AM
Service 'Package Updates Manager' now has status: good: Everything seems to be working.

There are scheduled downtimes in progress

Posted by Fedora Infrastructure Status on May 31, 2018 08:56 PM
Service 'Package Updates Manager' now has status: scheduled: Down for planned outage

HandBrake FFmpeg, no more Nvidia 32 bit drivers

Posted by Simone Caronni on May 31, 2018 07:40 PM

HandBrake has been updated again to track the master branch, as it now uses FFMpeg 4 and no longer libAV 12. This could probably lead to other improvements, like NVENC/CUDA support, more formats, etc.

Starting with the Nvidia drivers version 396.24 there will be no more 32 bit support, the driver will be 64 bit only. The 32 bit libraries are still included, so Steam and other applications will keep on being supported.

In a few days, the updated drivers will be pushed in the Fedora repositories, and at the same time I will also remove the i386 folder from the repositories. Some i386 packages will still be provided in the x86_64 folder, as it is now for Fedora 28 and CentOS/RHEL 7. The packages that will be kept, are mostly multilib library packages.

The same will happen to CentOS/EPEL 6 at the moment a new 64 bit only driver series will be nominated as “Long Lived”.

Also the Spotify repository has already no more i386 support, upstream stopped providing updated clients. Judging from the web server logs, there seems to be almost no one using an i686 Fedora in conjunction with the repositories hosted here.

Plex Media Player is back!

Posted by Simone Caronni on May 31, 2018 07:29 PM

Just a small post to notify that Plex Media Player package is back. Now it does not require Conan or Python anymore for building, and you can just build it using standard tools, the dependency issues between the Plex binary packages have been resolved.

Also the TV interface is now improved, on par with what Plex currently offers for other platforms, and it’s much better in terms of performance. I also don’t get anymore the weird positioning of the PIN window.

You can still install plex-media-player-session and do the minimal configuration required (extracted from /usr/share/doc/plex-media-player/README.Fedora):

If you are planning to do an HTPC installation, and would like to have Plex Media Player starting instead of the login screen the moment you boot the
device, execute the following commands as root:

# dnf install plex-media-player-session
# systemctl set-default plex-media-player
# echo "allowed_users = anybody" >> /etc/X11/Xwrapper.config

The first command installs the required files (services, targets and PolicyKit overrides). The second command instructs the system to load by default the Plex Media Player target; that is X and the player just after. The third command allows the system to start the X server as the Plex Media Player user, otherwise only users logged in through a console or root can start it.

If you want to go back to your normal installation (let’s say Gnome), then revert back the changes:

# systemctl set-default graphical
# sed -i -e '/allowed_users = anybody/d' /etc/X11/Xwrapper.config
# rpm -e plex-media-player-session

The package is available for all supported Fedora releases.

Also, on a side note, HandBrake has been updated again to track the master branch, as it now uses FFMpeg 4 and no longer libAV 12. This could probably lead to other improvements, like NVENC/CUDA support, more formats, etc.

What is zchunk?

Posted by Jonathan Dieter on May 31, 2018 06:45 PM

Over the past few months, I’ve been working on zchunk, a compression format that is designed to allow for good compression, but, more importantly, the ability to download only the differences between an old version of the file and a new version.

The concept is similar to both zsync and casync, but it has some important differences. Let’s first look at how downloading a zchunk file works.

Downloading a chunk file

A zchunk file is basically a bunch of zstd-compressed “chunks” concatenated together with a header specifying the location, size and checksum of each chunk. Let’s take an example with only a few chunks:

 

Note that the file has three chunks, labeled A, B and C, each with a unique checksum. These checksums are stored in the header.

Now let’s imagine that we want to download a new version of the file:

 

Note that the new file has two chunks that are identical to the original file and one new chunk. The header in the new file contains the checksums of chunks A, C and D. We start by downloading just the header of the new file:

 

We then compare the chunk checksums in the old file’s header with the chunk checksums in the newly downloaded header and copy any matching chunks from the old file:

 

We finish by downloading any remaining chunks, reducing the number of http requests by combining the range requests, and then inserting the downloaded chunks into the appropriate places in the final file:

 

When we’re finished, you have a file that is byte-for-byte identical to the new file on the server:

 

Background

What inspired this format is the ridiculous amount of metadata you download every time you check for updates in Fedora. Most of the data from one day’s updates is exactly the same in the next day’s updates, but you’ll still find yourself downloading over 20MB of metadata.

When I first took a look at this problem, there were two potential solutions: casync and zsync.

casync

At first glance, casync looked like it provided exactly what we need, but real-world testing showed a couple of problems. Because casync puts each chunk into a separate file, we downloaded hundreds (and sometimes thousands) of individual files just to rebuild the original metadata file. The process of initiating each http request is expensive, and, in my testing, downloading only the changed chunks took much longer than just downloading the full file in the first place.

The more I looked at casync, the more obvious it became that it’s designed for a different use-case (delivering full filesystem images), and, while close, wasn’t quite what I needed.

zsync

zsync approaches the problem a completely different way, by requiring you to use an rsyncable compression format (gzip –rsyncable is suggested), splitting it into chunks and then storing the chunk locations in a separate index file. Unfortunately, it also sends a separate http request for each chunk that it downloads.

Add to that the fact that zsync is unmaintained and somewhat buggy, and I didn’t really feel like it was the best option. I did find out later that OpenSUSE uses zsync for their metadata, but they put all the new records at the end of their metadata files, which reduces the number of ranges (and, therefore, the number of http requests).

zchunk

After looking at the drawbacks of both formats, I decided to create a completely new file format, with one major design difference and one major implementation difference compared to both casync and zsync.

Unlike both casync and zsync, zchunk files are completely self-contained. For zsync, you need the archive and its separate index, while casync requires that each chunk be stored in separate files alongside the index. Casync’s method fit its use-case, and zsync’s method works, given that it’s meant to be a way of extending what you can do with already-created files, though it’s hobbled by the fact that you have to intentionally use special flags to make compressed files that give good deltas.

The downside of having a separate index is that you have to make sure the index stays with the file it’s pointing to, and, since we’re creating a new format, there wasn’t much point in keeping the index separate.

The implementation difference is the ability that zchunk has to combine range requests into one http request, a rarely used http feature that is part of the spec. Zsync could theoretically add this feature, but casync can’t because it downloads separate files.

Zchunk will automatically combine its range requests into the largest number that the server will handle (the nginx default is 256 range requests in a single http request, while Apache’s default is to support unlimited range requests), send them as one http request, and then split the response into the correct chunks.

The zchunk format is also designed to store optional GPG keys, so zchunk files will be able to be signed and verified without needing to store the signature in a separate file.

What still needs work in zchunk

  • The C API for downloading needs to be finalized. I’m leaning towards not actually providing an API for downloading, but rather providing functions to generate the range requests and providing a callback that re-assembles the downloaded data into the correct chunks
  • Full test cases need to be written
  • GPG signature integration needs to be written
  • Python extensions need to be written

What’s needed to get zchunk-enabled Fedora repositories

  • I’ve written patches for createrepo_c that allow it to generate zchunk metadata, but it needs some work to make sure there are test cases for all the code
  • I’ve written a patch for libsolv that allows it to read zchunk files, but I still need to submit it for review
  • I’ve started on the work to get librepo to download zchunk metadata, but I’m not finished yet.

Command line VPN connection

Posted by Adam Young on May 31, 2018 04:43 PM

I need to connect to my office via VPN. Fedora has a point and click interface, but I am trying to minimize mouse usage. So, instead I have a small bash function that does it for me.

I has an OTP that I need to enter in, so I have nmcli prompt me.

$ cat `which vpn_up `
nmcli --ask c up "Raleigh (RDU2)"

QA: the glamorous bit

Posted by Adam Williamson on May 31, 2018 04:28 PM

Of course, we all know that working in QA is more or less a 24×7 whirl of red carpets and high-end cocktail parties…but today is particularly glamorous! Here’s what I’m doing right now:

  1. Build an RPM of a git snapshot of Plymouth
  2. Put it in a temporary repo
  3. Build an installer image containing it
  4. Boot the installer image in a VM, see if it reaches anaconda
  5. Repeat, more or less ad infinitum

I just can’t take the excitement!

Passwordless access to System libvirt on Fedora 28

Posted by Adam Young on May 31, 2018 03:42 PM

I can connect to the system libvirtd on my system without password. I set this up some time ago, and forgot how, so figured I would document it.

TO check that I can connect via virsh to the libvirst unix domain socket without a password.

$ virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
- cfme-tng shut off
- generic shut off
- pagure_pagure shut off

How?  File permissions.  The socket file can be found using a command like:

$ strace virsh -c qemu:///system list --all 2>&1 | grep connect
connect(5, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
connect(5, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
connect(6, {sa_family=AF_UNIX, sun_path="/var/lib/sss/pipes/nss"}, 110) = 0
connect(7, {sa_family=AF_UNIX, sun_path="/var/run/libvirt/libvirt-sock"}, 110) = 0

It is the last line that we care about.

[ayoung@ayoung541 rippowam]$ ls -la /var/run/libvirt/libvirt-sock
srwxrwx---. 1 root libvirtd 0 May 31 09:30 /var/run/libvirt/libvirt-sock

My user account is a member of the libvirtd group.

[ayoung@ayoung541 rippowam]$ groups
ayoung wheel kvm qemu dockerroot libvirt devel openstack gss-eng-collab idm-dev-lab libvirtd docker

Dependencies between services in docker-compose

Posted by Tomas Tomecek on May 31, 2018 09:50 AM

Here’s a question: can Docker Compose wait for a service to be ready (healthy) before starting a dependant one?

Apparently I’m not the only one to be puzzled by this.

Unfortunately, it can’t (any more).

Let’s have a closer look.

The setup

We’ll have two services: one depends on the other one:

  1. This services takes long to start (in real world, this could be a database).
  2. While this service needs the first one (backend).

Sounds reasonable, right?

The implementation

Dockerfile for the first service:

FROM fedora:28

HEALTHCHECK CMD curl -v 0.0.0.0:80

CMD sleep 5 && python3 -m http.server --bind 0.0.0.0 80

And a compose file:

version: "3"
services:
  i-take-long-to-boot:
    build: .

  i-need-the-one-above:
    image: fedora:28
    command: curl -s i-take-long-to-boot:80
    depends_on: [i-take-long-to-boot]

Show time

$ docker-compose up -d; docker-compose ps
Starting dc_i-take-long-to-boot_1 ... done
Starting dc_i-need-the-one-above_1 ... done

          Name                         Command                       State           Ports
------------------------------------------------------------------------------------------
dc_i-need-the-one-above_1   curl -s i-take-long-to-boot:80   Exit 7
dc_i-take-long-to-boot_1    /bin/sh -c sleep 5 && pyth ...   Up (health: starting)

Both containers started, the first one is up and healthiness is unsure. The second service failed.

This is something I would not expect to happen: second service was started right away, even though it depends on the first one which has unknown healthiness.

When we wait a few seconds (wait for “the database” to come up), everything is all right.

$ docker-compose restart i-need-the-one-above
Restarting dc_i-need-the-one-above_1 ... done
$ docker-compose ps
          Name                         Command                  State       Ports
---------------------------------------------------------------------------------
dc_i-need-the-one-above_1   curl -s i-take-long-to-boot:80   Exit 0
dc_i-take-long-to-boot_1    /bin/sh -c sleep 5 && pyth ...   Up (healthy)

In compose version 2 there was a way to do this:

    depends_on:
      some-service:
        condition: service_healthy

But the functionality was removed in version 3.

The proposed solution from upstream is to bake reconnect logic into your application.

Conclusion

Do you like the proposed solution? I don’t. I wish orchestration systems had this logic, not my application.

Élections pour le Conseil et Mindshare cette semaine

Posted by Charles-Antoine Couret on May 31, 2018 06:00 AM

Comme le projet Fedora est communautaire, une partie du collège des organisations suivantes doit être renouvelée : Council et Mindshare. Et ce sont les contributeurs qui décident. Exceptionnellement, le collège du FESCo ne sera pas partiellement renouvelé en même temps, faute de candidatures la fenêtre de dépôts de candidatures a été élargi pour cet organe.

Chaque candidat a bien sûr un programme et un passif qu'ils souhaitent mettre en avant durant leur mandat pour orienter le projet Fedora dans certaines directions. Je vous invite à étudier les propositions des différents candidats pour cela.

J'ai voté

Pour voter, il est nécessaire d'avoir un compte FAS actif et de faire son choix sur le site du scrutin. Vous avez jusqu'au mercredi 6 juin à 2h heure française pour le faire. Donc n'attendez pas trop.

Je vais profiter de l'occasion pour résumer le rôle de chacun de ces comités afin de clarifier l'aspect décisionnel du projet Fedora mais aussi visualiser le caractère communautaire de celui-ci.

Council

Le Council est ce qu'on pourrait qualifier le grand conseil du projet. C'est donc l'organe décisionnaire le plus élevé de Fedora. Le conseil définit les objectifs à long terme du projet Fedora et participe à l'organisation de celui-ci pour y parvenir. Cela se fait notamment par le biais de discussions ouvertes et transparentes vis à vis de la communauté.

Mais il gère également l'aspect financier. Cela concerne notamment les budgets alloués pour organiser les évènements, produire les goodies, ou des initiatives permettant de remplir les dits objectifs. Ils ont enfin la charge de régler les conflits personnels importants au sein du projet, tout comme les aspects légaux liés à la marque Fedora.

Les rôles au sein du conseil sont complexes.

Ceux avec droit de vote complet

Tout d'abord il y a le FPL (Fedora Project Leader) qui est le dirigeant du conseil et de facto le représentant du projet. Son rôle est lié à la tenue de l'agenda et des discussions du conseil, mais aussi de représenter le projet Fedora dans son ensemble. Il doit également servir à dégager un consensus au cours des débats. Ce rôle est tenu par un employé de Red Hat et est choisi avec le consentement du conseil en question.

Il y a aussi le FCAIC (Fedora Community Action and Impact Coordinator) qui fait le lien entre la communauté et l'entreprise Red Hat pour faciliter et encourager la coopération. Comme pour le FPL, c'est un employé de Red Hat qui occupe cette position avec l'approbation du conseil.

Il y a deux places destinées à la représentation technique et à la représentation plus marketing / ambassadrice du projet. Ces deux places découlent d'une nomination décidée au sein des organes dédiées à ces activités : le FESCo et le Mindshare. Ces places sont communautaires mais ce sont uniquement ces comités qui décident des attributions.

Il reste deux places communautaires totalement ouvertes et dont tout le monde peut soumettre sa candidature ou voter. Cela permet de représenter les autres secteurs d'activité comme la traduction ou la documentation mais aussi la voix communautaire au sens la plus large possible. C'est pour ces places que le vote est ouvert cette semaine !

Ceux avec le droit de vote partiel

Un conseiller en diversité est nommé par le FPL avec le soutien du conseil pour favoriser l'intégration au sein du projet des populations le plus souvent discriminées. Son objectif est donc de déterminer les programmes pour régler cette problématique et résoudre les conflits associés qui peuvent se présenter.

Un gestionnaire du programme Fedora qui s'occupe du planning des différentes versions de Fedora. Il s'assure du bon respect des délais, du suivi des fonctionnalités et des cycles de tests. Il fait également office de secrétaire du conseil. C'est un employé de Red Hat qui occupe ce rôle toujours avec l'approbation du conseil.

Mindshare

Mindshare est une évolution du FAmSCo (Fedora Ambassadors Steering Committee) qu'il remplace. Il est l'équivalent du FESCo sur l'aspect plus humain du projet. Pendant que le FESCo se préoccupera beaucoup plus des empaqueteurs, la préoccupation de ce conseil est plutôt l'ambassadeur et les nouveaux contributeurs.

Voici un exemple des thèmes dont il a compétence qui viennent du FAmSCo :

  • Gérer l'accroissement des ambassadeurs à travers le mentoring ;
  • Pousser à la création et au développement des communautés plus locales comme la communauté française par exemple ;
  • Réaliser le suivi des évènements auxquels participent les ambassadeurs ;
  • Accorder les ressources aux différentes communautés ou activités, en fonction des besoin et de l'intérêt ;
  • S'occuper des conflits entre ambassadeurs.

Et ses nouvelles compétences :

  • La communication entre les équipes, notamment entre la technique et le marketing ;
  • Motiver les contributeurs à s'impliquer dans différents groupes de travail ;
  • Gérer l'arrivé de nouveaux contributeurs pour les guider, essayer de favoriser l'inclusion de personnes souvent peu représentées dans Fedora (femmes, personnes non américaines et non européennes, étudiants, etc.) ;
  • Gestion de l'équipe marketing.

Il y a 9 membres pour gérer ce nouveau comité. Un gérant, 2 proviennent des ambassadeurs, un du design et web, un de la documentation, un du marketing, un de la commops et les deux derniers sont élus. C'est pour ces deux derniers sièges que les scrutins sont ouverts.

Mindshare Election: Interview with Sumantro Mukherjee (sumantrom)

Posted by Fedora Community Blog on May 30, 2018 09:00 PM

This is a part of the Mindshare Elections Interviews series. Voting is open to all Fedora contributors. The voting period starts on Thursday, May 31st and closes promptly at 23:59:59 UTC on Wednesday, June 6th, 2018.

 

Interview with Sumantro Mukherjee (sumantrom)

  • Fedora Account: sumantrom
  • IRC:  sumantrom (found in #fedora-qa #fedora-test-day #fedora-classroom #fedora-india #fedora-meeting)
  • Fedora User Wiki Page

Questions

Is there a specific task or issue you think that Mindshare should address this term?

As Mindshare is a core group of volunteers to expand and evolve the Fedora Outreachy in accordance to the four pillars of Fedora, I believe it can achieved with increase in Fedora’s Calender Events.
For instance, we have Release Parties and Flock as calender events. Organizing FADs or some “output-driven” will help to get a better outreach and also attract contributors to participate in Fedora project with their skillsets. Building and constantly evolving a framework for attractmore developers and users to ecosystem will be something which I belive will help Mindshare to achieve it’s goals.

Please elaborate on the personal “Why” which motivates you to be a candidate for Mindshare.

I heil from APAC. It’s  vast and diverese. I was a part of FAmSCo and I was thrilled to work with Fedora Ambassdors around APAC and around the world. The biggest motivator for me is to see more new comers feel welcome and participate in the project. Working with people across the world teaches me a lot and helps me understand community dynamics in a better way.As a part of Fedora QA team, we often have onboarding calls and I feel it’s crucial for the success of the project to evolve the outreach program and that’s the reason I would like to join Mindshare ,  join hands with the subproject team and expand the outreach activities.

What are your thoughts on the impact (as an individual and then as a Mindshare group) that the group will have on the Fedora Mission?

As a individual, I will help shape some events and outreach around IoT and Fedora. I started using Samsung ARTIK with Fedora 24 and have been regularly testing on Fedora ARM. I would love to bring that experience to outreach activities and help write boilerplates and run pilot activities to increase the contributors and users to increase Fedora’s footprint in IoT landscape. Since Mediawrite offers  out of the box support for ARM it will nice to put most of the already ready pieces to use.
As a part of Mindshare, I would like to work with Fedora Ambassdors, Contributors and Users to help shape a outreach experience which will help the forthcoming people to make the most of their skillsets and contribute to the project.

The post Mindshare Election: Interview with Sumantro Mukherjee (sumantrom) appeared first on Fedora Community Blog.

Mindshare Election: Interview with Itamar Peixoto (itamarjp)

Posted by Fedora Community Blog on May 30, 2018 09:00 PM

This is a part of the Mindshare Elections Interviews series. Voting is open to all Fedora contributors. The voting period starts on Thursday, May 31st and closes promptly at 23:59:59 UTC on Wednesday, June 6th, 2018.

 

Interview with Itamar Peixoto (itamarjp)

Questions

Is there a specific task or issue you think that Mindshare should address this term?

Yes, promote fedora and make it grow’s more than now.

Please elaborate on the personal “Why” which motivates you to be a candidate for Mindshare.

Keep Mindshare in the correct path.

What are your thoughts on the impact (as an individual and then as a Mindshare group) that the group will have on the Fedora Mission?

As an individual I am promoting Fedora in Brazil and I think I am successful because our Brazilian community keeps growing continuously, working together with Mindshare we can achieve better results for the project.

The post Mindshare Election: Interview with Itamar Peixoto (itamarjp) appeared first on Fedora Community Blog.

Council Election: Interview with Till Maas (till)

Posted by Fedora Community Blog on May 30, 2018 09:00 PM

This is a part of the Council Elections Interviews series. Voting is open to all Fedora contributors. The voting period starts on Thursday, May 31st and closes promptly at 23:59:59 UTC on Wednesday, June 6th, 2018.

Interview with Till Maas (till)

  • Fedora Account: till
  • IRC: tyll (found in #fedora-releng #fedora #fedora-devel #fedora-admin #fedora-apps #fedora-social #fedora-de #epel)
  • Fedora User Wiki Page

Questions

What’s your background in Fedora? What expertise do you bring based on past experience, and what projects are you actively involved in now?

Fedora Core 4 was the start of my Fedora journey. Initially I was a user but I started with packaging, soon. Whenever there was something that I could improve, I submitted patches. This made me also contribute to infrastructure projects and release engineering. When time permits I will also represent Fedora at conferences. Recently I served FESCo for a year and I am working on restructuring cleanup tasks for packages.

What do you plan to accomplish on the Council? What are the most pressing issues facing Fedora today? What should we do about them?

I would like to bring fresh thoughts into the Council and more competition into the election process. There are rarely new candidates so I decided it is my duty to serve. In the council I would like to make sure that we honor our Friends foundation. During my time in FESCo I learned that contributors were pushed away by the toxic behavior of usual suspects. I want to be available for our friendly contributors to stand up against the toxic members. In the news, there were reports about abuse cases in Hollywood were a lot of people knew something was off but did not do anything. It seems to me that we have a similar social problem in Fedora because I am confident that a lot of contributors think of the same people when considering who I am referring to. Therefore I will support hard actions against any toxic community member.

What are your interests and accomplishments outside of Fedora? What of those things will help you in this role?

I have a broad interest and an eye for detail. In the past I worked as a Penetration Tester and gained a lot of experience in analyzing a variety of systems. I love to work on my personal growth which helps me in every role. Also I like to try out new things, go hiking and being a father.

The post Council Election: Interview with Till Maas (till) appeared first on Fedora Community Blog.

Council Election: Interview with Nick Bebout (nb)

Posted by Fedora Community Blog on May 30, 2018 09:00 PM

This is a part of the Council Elections Interviews series. Voting is open to all Fedora contributors. The voting period starts on Thursday, May 31st and closes promptly at 23:59:59 UTC on Wednesday, June 6th, 2018.

Interview with Nick Bebout (nb)

  • Fedora Account: nb
  • IRC: nb (found in fedora-admin, #fedora-noc, #fedora-ambassadors, #fedora-devel, #fedora-ops, etc.)
  • Fedora User Wiki Page

Questions

What’s your background in Fedora? What expertise do you bring based on past experience, and what projects are you actively involved in now?

I have been involved in Fedora for many years (FAS says my account was created in 2007). I’m involved in several different projects in Fedora, primarily Ambassadors, Packaging, and Infrastructure. I also occasionally work on Design Team tasks and in the past have also helped with docs and websites. I’m also a provenpackager and an Ambassadors Mentor and am currently a member of the Mindshare Commitee and the Fedora Council.

What do you plan to accomplish on the Council? What are the most pressing issues facing Fedora today? What should we do about them?

I think we need to keep working on building marketshare. I think there is an opportunity now to promote how we do have mp3 encoding in Fedora, and we have openh264 easily installable. I’ve talked to some people in the past about why they choose other distributions and one of the main things they mention is that other distributions have mp3 and other codecs installed by default and we do not. Also, I think modularity will be a big benefit to Fedora once it gets fully up and running.

What are your interests and accomplishments outside of Fedora? What of those things will help you in this role?

I work as a Systems Administrator at the University of Southern Indiana. In my work at the University I have seen how a few of our classes use Linux and I have seen opportunities that we could take to promote Fedora (and Linux in general) in the higher education market. I recently earned my LPIC-1 certification and am working on preparing for the LPIC-2. I also have a Bachelor of Science in Business Administration and Computer Information Systems from USI and am currently a student working towards my Master of Business Administration degree here at USI.

The post Council Election: Interview with Nick Bebout (nb) appeared first on Fedora Community Blog.

Mindshare Election: Interview with Nick Bebout (nb)

Posted by Fedora Community Blog on May 30, 2018 09:00 PM

This is a part of the Mindshare Elections Interviews series. Voting is open to all Fedora contributors. The voting period starts on Thursday, May 31st and closes promptly at 23:59:59 UTC on Wednesday, June 6th, 2018.

 

Interview with Nick Bebout (nb)

  • Fedora Account: nb
  • IRC: nb (found in fedora-admin, #fedora-noc, #fedora-ambassadors, #fedora-devel, #fedora-ops, etc.)
  • Fedora User Wiki Page

Questions

Is there a specific task or issue you think that Mindshare should address this term?

I think Mindshare’s first objective is to define it’s goals, since it is a new group. I think then we should work on defining our plans, given the blog post from Matthew about aligning our efforts with the objectives set forth by the Fedora Council. See question #3 for more thoughts. We have made some good progress on this at the Mindshare FAD and I would like to continue to be a member of the Mindshare committee to further work on helping move this forward.

Please elaborate on the personal “Why” which motivates you to be a candidate for Mindshare.

I have been involved in Fedora Ambassadors for many years, and I have also been involved with other projects that are part of Mindshare, such as Docs, Design, etc. I believe that outreach is a critical component to the success of Fedora. If we make an awesome distribution, but no one knows about it, then we wouldn’t have users.

What are your thoughts on the impact (as an individual and then as a Mindshare group) that the group will have on the Fedora Mission?

I think Mindshare will be a great thing for Fedora, since this will allow us to better coordinate our “outreach” related teams.

The post Mindshare Election: Interview with Nick Bebout (nb) appeared first on Fedora Community Blog.

Fedora Release Party 28 UAM AZC Slides (Spanish)

Posted by Alberto Rodriguez (A.K.A bt0) on May 30, 2018 01:43 PM

<iframe allowfullscreen="allowfullscreen" frameborder="0" height="420" scrolling="no" src="http://slides.com/albertorodriguezsanchez/prueba-2/embed" width="576"></iframe>

How to install Red Hat CDK 3.4 on Fedora 28

Posted by RHEL Developer on May 30, 2018 11:00 AM

Red Hat Container Development Kit (CDK) provides a single-node Red Hat OpenShift cluster designed to assist with containerized application development. This environment is like a production OpenShift environment, but it is designed to work on a single user’s computer. For this purpose, CDK runs Red Hat Enterprise Linux and Red Hat OpenShift Container Platform in a virtual machine.

Follow these steps to install CDK 3.4 on Fedora 28:

  1. Set up the virtualization environment.
  2. Install and configure CDK.
  3. Start CDK.

Below are details for performing these steps.

Set Up the Virtualization Environment

CDK requires Kernel-based Virtual Machine (KVM)/ libvirt virtualization technology and the KVM Docker Machine driver plug-in. Perform the following steps to download and configure the required components.

1. Download the KVM driver plug-in and make it executable:

$ sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm
$ sudo chmod +x /usr/local/bin/docker-machine-driver-kvm

2. Install KVM/libvirt:

$ sudo dnf install libvirt qemu-kvm

3. Add yourself to the libvirt group:

$ sudo usermod -a -G libvirt ${USER}

4. Update your user session to apply the group change:

$ newgrp libvirt

5. Launch libvirtd and configure it to start at boot:

$ sudo systemctl start libvirtd
$ sudo systemctl enable libvirtd

Install and Configure CDK

1. Download CDK for Linux.

Note: The following steps assume that CDK is placed in the ~/Downloads directory. The file should be named ~/Downloads/cdk-3.4.0-2-minishift-linux-amd64.

2. Create the ~/bin directory and copy CDK to it:

$ mkdir -p ~/bin
$ cp ~/Downloads/cdk-3.4.0-2-minishift-linux-amd64 ~/bin/minishift
$ chmod +x ~/bin/minishift

Note: The ~/bin directory should already be in your $PATH. You may use another directory of your choice, but we recommend placing minishift in your $PATH. If that is not possible, you can run it as ./minishift from the directory containing minishift.

3. Set up CDK:

$ minishift setup-cdk

Note: This will create the directory ~/.minishift. This directory includes the virtual machine image and related configuration files.

Start CDK

1. You must start CDK using the minishift binary.

Register the virtual machine running Red Hat Enterprise Linux:

Note: Replace $RED_HAT_USERNAME and $RED_HAT_PASSWORD with the credentials you use to install other Red Hat Enterprise Linux systems.

$ export MINISHIFT_USERNAME="$RED_HAT_USERNAME"
$ export MINISHIFT_USERNAME="$RED_HAT_PASSWORD"
$ echo "export MINISHIFT_USERNAME=\"$MINISHIFT_USERNAME\"" >> ~/.bashrc
$ echo "export MINISHIFT_PASSWORD=\"$MINISHIFT_PASSWORD\"" >> ~/.bashrc

2. Start CDK:

$ minishift start

3. Verify that CDK is running:

$ minishift status

Congratulations, CDK is now running on your Fedora 28 system!

See the CDK Getting Started Guide for more information about using CDK.

Share

The post How to install Red Hat CDK 3.4 on Fedora 28 appeared first on RHD Blog.

Fractal: a GNOME Matrix chat client

Posted by Fedora Magazine on May 30, 2018 08:00 AM

Matrix is a protocol for decentralized instant messaging that has recently grown in popularity. Matrix can be used for a wide range of communication tasks, such as group chats, video chats, sharing files, and bridging to existing IRC rooms. One of the easiest ways to use Matrix is the RiotIM web client or desktop application. However, Fractal is a Matrix desktop application designed for GNOME, so it arguably feels a lot more at home on Fedora Workstation, as seen here:

Fractal is a new project, and currently doesn’t support some Matrix functionality, including video chats. However, the core functionality of a basic text chat / messaging client works well. Additionally, it is clear that a lot of thought has been put into the user interface.  The UI is clean, neat, and easy to navigate.

Support in Matrix for end-to-end encryption is in beta. However, Fractal currently does not support encryption.

Installing Fractal

The easiest way to install Fractal on Fedora is from  Flathub. First, follow the directions in this article to set up Flathub as a third party software source.

Once Flathub is enabled as a third-party source, simply search and install Fractal from the Software app in Fedora Workstation.

 

GSoC 2018: Week 2

Posted by Amitosh Swain Mahapatra on May 30, 2018 06:14 AM

This is Status Report for Fedora App filled by participants on a weekly basis.

Status Report for Amitosh Swain Mahapatra (amitosh)

  • Fedora Account: amitosh
  • IRC: amitosh (found in #fedora, #fedora-dotnet, #fedora-summer-coding, #fedora-commops)
  • Fedora Wiki User Page: amitosh

This time, I am working on improving the Fedora Community App with the Fedora project. It’s been a week since we started off our coding on may 14.

The Fedora App is a central location for Fedora users and innovators to stay updated on The Fedora Project. News updates, social posts, Ask Fedora, as well as articles from Fedora Magazine are all held under this app.

Tasks Completed

Here is the summary of my work in the second week:

We now have offline capablilties in the app (#62). The app now caches the content from Fedora Magazine, FedoCal and Fedora Social. Every time we load the app, we refersh the cache from the API end points in the background. We no longer block the user from interacting with the app and the content also loads a lot faster. (#61)

It still has some rough edges, we will be addressing them in the following weeks.

There are only two hard things in Computer Science: cache invalidation and naming things.

– Phil Karlton

Two Hard Things from Martin Fowler

And in particularly JS, we shall modify it to:

There are only two hard things in Computer Science: 1> Cache invalidation
3> Async callbacks
2> Naming things.

And fortunately, RxJS provides an elegant solution to (3).

This week was particularly challenging and exciting. RxJS Observables and reactive programming patterns was really interesting to learn. Learn RxJS by @btroncone was a great resource that helped me to quickly grasp the concepts. Many thanks!

You can find the weekly report for Week 1 here.

What’s next ?

I’m working on creating unit tests for various services we use in our app and the integration tests for the different screens.

Tor Browser and Selenium

Posted by Kushal Das on May 30, 2018 04:39 AM

Many of us use Python Selenium to do functional testing of our websites or web applications. We generally test against Firefox and Google Chrome browser on the desktop. But, there is also a lot of people who uses Tor Browser (from Tor Project) to browse the internet and access the web applications.

In this post we will see how can we use the Tor Browser along with Selenium for our testing.

Setting up the environment

First step is to download and verify, and then extract the Tor Browser somewhere in your system. Next, download and extract geckodriver 0.17.0 somewhere in the path. For the current series of Tor Browsers, you will need this particular version of the geckodriver.

We will use pipenv to create the Python virtualenv and also to install the dependencies.

$ mkdir tortests
$ cd tortests
$ pipenv install selenium tbselenium
$ pipenv shell

The tor-browser-selenium is Python library required for Tor Browser Selenium tests.

Example code

import unittest
from time import sleep
from tbselenium.tbdriver import TorBrowserDriver


class TestSite(unittest.TestCase):
    def setUp(self):
        # Point the path to the tor-browser_en-US directory in your system
        tbpath = '/home/kdas/.local/tbb/tor-browser_en-US/'
        self.driver = TorBrowserDriver(tbpath, tbb_logfile_path='test.log')
        self.url = "https://check.torproject.org"

    def tearDown(self):
        # We want the browser to close at the end of each test.
        self.driver.close()

    def test_available(self):
        self.driver.load_url(self.url)
        # Find the element for success
        element = self.driver.find_element_by_class_name('on')
        self.assertEqual(str.strip(element.text),
                         "Congratulations. This browser is configured to use Tor.")
        sleep(2)  # So that we can see the page


if __name__ == '__main__':
    unittest.main()

In the above example, we are connecting to the https://check.torproject.org and making sure that it informs we are connected over Tor. The tbpath variable in the setUp method contains the path to the Tor Browser in my system.

You can find many other examples in the source repository.

Please make sure that you test web application against Tor Browser, having more applications which can run smoothly on top of the Tor Browser will be a great help for the community.

Cockpit 169

Posted by Cockpit Project on May 30, 2018 12:00 AM

Cockpit is the modern Linux admin interface. We release regularly. Here are the release notes from version 169.

Storage: Offer installation of NFS client support

The “NFS Mounts” pane on the Storage page now shows an “Install NFS Support” button if the necessary packages are not already available:

<iframe allowfullscreen="" frameborder="0" height="720" src="https://www.youtube.com/embed/Gaioqm7sLEo?rel=0" width="960"></iframe>

System: Request FreeIPA SSL certificate for Cockpit’s web server

When enrolling into a FreeIPA domain, an SSL certificate is requested from the IPA server and stored in /etc/cockpit/ws-certs.d/10-ipa.cert. Cockpit’s web server will then use that certificate instead of the default self-signed one. The IPA server’s certificate authority is trusted by default and accepted by web browsers, OpenSSL, curl, and other network clients.

Services: Show unit relationships

The details of a systemd service now shows dependency, ordering, and other relationships to units:

Services relationships

Provide motd help about how to access cockpit

Cockpit now provides an /etc/motd.d/cockpit motd message that explains how to enable and start Cockpit if it’s not running, or how to access it if it is running.

This requires PAM 1.3.1 and enabling the pam_motd module:

session     optional      pam_motd.so

Try it out

Cockpit 169 is available now:

SeedboxSync 2.0.0, synchronisation de votre seedbox et de votre NAS

Posted by Guillaume Kulakowski on May 29, 2018 07:51 PM

La version 2.0.0 de SeedboxSync vient d’être libérée ! C’est quoi SeedboxSync ? Imaginez que vous téléchargiez des fichiers via le protocole BitTorrent, des fichiers libres de droit, ça va de soi. Imaginez que pour une raison X ou Y vous ne puissiez pas le faire à partir de votre connexion (et donc votre IP) […]

Cet article SeedboxSync 2.0.0, synchronisation de votre seedbox et de votre NAS est apparu en premier sur Guillaume Kulakowski's blog.

Adding support for the Dell Canvas and Totem

Posted by Christian F.K. Schaller on May 29, 2018 01:28 PM

I am very happy to see that Benjamin Tissoires work to enable the Dell Canvas and Totem has started to land in the upstream kernel. This work is the result of a collaboration between ourselves at Red Hat and Dell to bring this exciting device to Linux users.

Dell Canvas 27

Dell Canvas

The Dell Canvas and totem is essentially a graphics tablet with a stylus and also a turnable knob that can be placed onto the graphics tablet. Dell feature some videos on their site showcasing the Dell Canvas being used in ares such as drawing, video editing and CAD.

So for Linux applications supporting graphic drawing tablets already the canvas should work once this lands, but where we hope to see applications developers step up is adding support in their application for the totem. I have been pondering how we could help make that happen as we would be happy to donate a Dell Canvas to help kickstart application support, I am just unsure about the best way to go ahead.
I was considering offering one as a prize for the first application to add support for the totem, but that seems to be a chicken and egg problem by definition. If anyone got any suggestions for how to get one of these into the hands of the developer most interested and able to take advantage of it?

SELinux team works to remove DAC_OVERRIDE Permissions.

Posted by Dan Walsh on May 29, 2018 01:00 PM

DAC_OVERRIDE is one of the most powerful capabilities, and most app developers don't understand when they are taking advantage of it, or how easy it is to eliminate the need.

What is DAC_OVERRIDE?

man capabilities

...

       CAP_DAC_OVERRIDE

              Bypass file read, write, and execute permission checks.  (DAC is an abbreviation of "discretionary access control".)

Looking at /usr/include/linux/capability.h

#define CAP_DAC_OVERRIDE     1

/* Overrides all DAC restrictions regarding read and search on files and directories, including ACL restrictions if [_POSIX_ACL] is defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */

Giving a process this access means it can ignore file system permission checks. Admittedly everyone thinks root can do this by default anyways, but if you can eliminate this access from a system service, you really can tighten the security.  

SELinux

SELinux ignores DAC permissions, it does not care if a a processes is running as root or any other UID.  The only part of SELinux that concerns itself with UID/GID permissions is in linux capabilities like DAC_OVERRIDE.

With SELinux we often look at what process types require DAC_OVERRIDE and try to figure out if we can rid of the access.  

Usually services that need DAC_OVERRIDE run as a root process for a short time before becoming non root.  Since they are going to run as non root they set up permissions on directories or unix domain sockets to be accessible by the UID/GID pair the service is going to run with.   Often they accidentally or intentionally remove `root UID` access, thinking this will give them better security.  IE if I only want the UID of my process to access an object, I set the object permissions such that only its UID can access it.

Lets look at an example, I create a directory named myapp, and set the ownership and group to my UID/GID 3267 (My UID), now I also set the permissions to 770.

ls -ld /var/lib/myapp
drwxrwx---. 2 dwalsh dwalsh 6 May 28 06:55 /var/lib/myapp

 Now processes running as root are NOT allowed to create any content in this directory, or to execute any content in this directory without using DAC_OVERRIDE.  (Note: It might be able to see and traverse the directory using DAC_READ_SEARCH, but that is a story for another blog).

The simplest way to allow the root process to get full access this directory would be to change the group ownership to root.

chown 3267:0 /var/lib/myapp
# ls -ld /var/lib/myapp
drwxrwx---. 2 dwalsh root 6 May 28 06:55 /var/lib/myapp

The root process gets full access to the directory using its group permissions and processes running as 'dwalsh'  get full access running as that UID using its owner permissions.  

While this does not seem that significant from a DAC point of view, after all root processes has full access to all objects owned by UID=0, in an SELinux world you would be running as myapp_t, and might only have access to the file system objects labeled my myapp_t, if we can drop the DAC_OVERRIDE permissions from SELinux we can really tighten up the security.

Lets look at a real world example via the following bugzilla. 

<figure class="aentry-post__figure aentry-post__figure--media"> </figure>

When dovecot sets up a socket for mail clients to talk to, it sets up the permssions on the socket to be:

# ls -l /var/run/dovecot/login/ipc-proxy
srw-------. 1 dovenull root 0 May 27 12:34 /var/run/dovecot/login/ipc-proxy

This permission means that only process running as the 'dovenull' user can communicate with the socket.  At somepoint when dovecot, running as dovecot_t, is coming up, the 'root' process attempts to access the ipc-proxy socket and is denied by SELinux.  

type=AVC msg=audit(1526480141.321:6579): avc:  denied  { dac_override } for  pid=19839 comm="dovecot" capability=1  scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:system_r:dovecot_t:s0 tclass=capability permissive=0

The simple thing to do from an SELinux point of view would be to add the allow rule

allow dovecot_t self:capability dac_override;

But from a security proint of view, this is lousy.  The much better solution would be to 'relax' the permissions on the socket by adding group read/write.

# ls -l /var/run/dovecot/login/ipc-proxy
srwrw-----. 1 dovenull root 0 May 27 12:34 /var/run/dovecot/login/ipc-proxy

Now root processes are allowed to access the socket via DAC permissions and no longer need to use linux capabilities to access the socket.  This would be a far more secure way of running Dovecot and really involved a minor change to the code.

When I look at containers, we allow DAC_OVERRIDE by default, because so many containers are badly written, but I think it would be great for us to be able to remove this permission by default.

podman run -d --cap-drop DAC_OVERRIDE myimage  

Or for those of you still using Docker

docker run -d --cap-drop DAC_OVERRIDE myimage  

I will talk more about this in a future blog.

Bottom Line:

In most cases the requirement for DAC_OVERRIDE is a simple programmer error in the way he sets up his application and can be fixed by adjusting the permissions/ownership on file system objects.  Loosening the SELinux constraints should be the last resort.


Customizing container types

Posted by Dan Walsh on May 29, 2018 12:34 PM

In my previous blog, I talked about about container types container_t and svirt_lxc_net_t. Today I get an email, asking about the new container_t type replacing svirt_lxc_net_t.

On 05/23/2018 11:50 PM, Dustin C. Hatch wrote:
I recently upgraded some of my Docker hosts to CentOS 7.5 and started getting "Permission Denied" errors inside of containers. I traced this down to any container that mounts and uses /etc/passwd from the host (so that UIDs inside the container map to the same username as on the host), because the SELinux policy in CentOS 7.5 does not allow the new container_t domain to read passwd_file_t.  
The old svirt_lxc_net_t domain had the nsswitch_domain attribute, while its replacement, container_t, does not. I cannot find any reference for this change, so I was wondering if it was deliberate or not. If it was deliberate, what would be the consequences if I were to make a local policy change to add that attribute back? If it was not deliberate, I would be happy to open a ticket in Bugzilla. 

First let's remove the misconception, container_t was not a new type replacing svirt_lxc_net_t, it was a rename (typealias) of the old type.  

But the more important question was, why did I remove the access `nsswitch_domain` access.  This access allowed containers to read all sorts of user information is a container escaped.  The reason it was there originally was to allow virt-sandbox to care up a host into several containers, as opposed to the way 'Docker' ran containers each as separate unigue userspaces.

When Docker experienced a CVE a couple of  years ago where a container process was able to escape to the host, a security analyst was surprised on what a container process was allowed to read by default by SELinux.  And of course reading /etc/passwd seemed to like something we should prevent.  I agreed, and decided to tighten policy by removing this ability.  I still think it is the right decision.

The emailer goes on to ask if he were to add the attibute back would that be an issue, I say no, if you use case is to allow containers to read user data out of /etc/passwd then you can/should modify the policy to allow it.  Lets look at how.

Create a TE file that looks like the following:

# cat mycontainer.te
policy_module(mycontainer, 1.0)
gen_require(`
type container_t;
')
auth_use_nsswitch(container_t)
# make -f /usr/share/selinux/devel/Makefile
# semodule -i mycontainer.pp

 Now container processes on systems with this policy module will be able to interact with the host in all the different ways that you can use nsswitch, which means you can not only read /etc/passwd, but also communicate with sssd, and remote IPA and authentication databases.  If you want to write a tighter policy that simply allows  your containers to read /etc/passwd, you could write a module like:

# cat mycontainer.te
policy_module(mycontainer, 1.0)
gen_require(`
type container_t;
')
auth_read_passwd(container_t)
# make -f /usr/share/selinux/devel/Makefile
# semodule -i mycontainer.pp

Obviously I would recommend the second one.

Bottom Line

I am trying to balance container security with the ability to run most container workloads.  When you have a use case where these conflict, SELinux has the flexibility to allow you to customize the policy.

Minecraft Fedora 28

Posted by Daniel Lara on May 29, 2018 11:41 AM
Vamos instalar o Minecraft de uma maneira fácil

Ative o repo COPR

$ sudo dnf copr enable danniel/Minecraft

Agora vamos instalar o mesmo

$ sudo dnf install  Minecraft

Pronto já esta instalado




Troika SELMATE and Home Assistant

Posted by Fabian Affolter on May 29, 2018 09:43 AM

From time to time people ask me how to do the reverse engineering of a device to integrate it into Home Assistant. Sure, reverse engineering sounds fancy and will get you a better position in the search engine’s results but let’s be honest it’s not much magic or rocket science and most of the time it’s just putting the pieces together you found. I prefer to talk about it as “using devices beyond the original purpose”.

audius provided me with a Troika SELMATE (KR15-03/WH). It’s a Bluetooth Key/Smartphone Finder. The haptics are excellent and the quality is higher than the standard for such devices.

I usually don’t need to find my keys because my Yubikey is attached and without that I’m not able to unlock my computer. Same for my Smartphone which contains the 2FA app. Both things are most of the time pretty close to me.

The Troika SELMATE can be used in two ways if the device is paired with your smartphone: One press would create a selfie and two presses are activating the alarm on the smartphone. A click on the “Alert” button in the Troika Find app let the device blink and beep. Thus, there are multiple ways to use the device beside the Troika app: simple monitoring of its state, perhaps switching a light on, use it as an alarm device, as physical part of a self-made alarm clock and so on and on 🙂

First let’s see what we can find out. There is no special hardware required. I’m using a Lenovo T460 with a built-in Bluetooth adapter and a Fedora 27 installation. The first tool we are going to use is

hcitool
 which is part of
bluez
. Perform the following command to install it.

$ sudo dnf -y install bluez

Switch the Troika SELMATE on and run a scan with

hcitool
 .

$ sudo hcitool lescan
LE Scan ...
08:7C:BE:78:C9:A0 SELFMATE
08:7C:BE:78:C9:A0 (unknown)
...

If you have other Bluetooth device like your smartphone or our mouse then they will show up as well. Make sure that the SELFMATE is not paired with your smartphone anymore. Let’s see what else is available.

$ sudo hcitool leinfo 08:7C:BE:78:C9:A0
Requesting information ...
Handle: 3586 (0x0e02)
LMP Version: 4.0 (0x6) LMP Subversion: 0x400
Manufacturer: Quintic Corp. (142)
Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Not much so far. Ok, next tool.

gatttool
  is also part of
bluez
 . Establishing a connection can be done in an interactive way.

$ sudo gatttool -b 08:7C:BE:78:C9:A0 -I
[08:7C:BE:78:C9:A0][LE]> connect
Attempting to connect to 08:7C:BE:78:C9:A0
Connection successful

The first ting we are going to do is to the characteristic handles and service UUIDs implemented by the device.

[08:7C:BE:78:C9:A0][LE]> primary
attr handle: 0x0010, end grp handle: 0x0012 uuid: 00001803-0000-1000-8000-00805f9b34fb
attr handle: 0x0013, end grp handle: 0x0015 uuid: 00001802-0000-1000-8000-00805f9b34fb
attr handle: 0x0016, end grp handle: 0x0018 uuid: 00001804-0000-1000-8000-00805f9b34fb
attr handle: 0x0019, end grp handle: 0x001c uuid: 0000ffe0-0000-1000-8000-00805f9b34fb
attr handle: 0x001d, end grp handle: 0x001f uuid: 000018f0-0000-1000-8000-00805f9b34fb
attr handle: 0x0020, end grp handle: 0x0023 uuid: 0000180f-0000-1000-8000-00805f9b34fb

Looking them up with the help of the Bluetooth services list will give us an idea about what the device is supporting.

Those two handles which are not documented.

  • 0000ffe0-0000-1000-8000-00805f9b34fb
  • 000018f0-0000-1000-8000-00805f9b34fb

The most import one seems to be “Immediate Alert”. This is the trigger to let the device beep and blink.

0x0015 is the group handle for the UUID 0x1802. Limiting the output to 0x0015 will give us the characteristic for the alarm.

[08:7C:BE:78:C9:A0][LE]> char-desc 0x0015 0x0015
handle: 0x0015, uuid: 00002a06-0000-1000-8000-00805f9b34fb

0x2a06 is the UUID for the Alert Level. There are three levels available but only two are useful with a device like a keyfinder.

  • 0x00 (No alert): Nothing
  • 0x01 (Mild alert): Beeping
  • 0x02 (High alert): Beeping and Blinking

Now, we know tht handle and the possible values. This means that we control the device in the way we want.

[08:7C:BE:78:C9:A0][LE]> char-write-cmd 0x0015 01
[08:7C:BE:78:C9:A0][LE]> char-write-cmd 0x0015 02

Like for the app…with a press you can confirm the alarm.

You can also get the battery level (Battery Service 0x180f, Battery Level 0x2a19)

[08:7C:BE:78:C9:A0][LE]> char-read-uuid 0desc 0x0022 0x0022
handle: 0x0022, uuid: 00002a19-0000-1000-8000-00805f9b34fb
[08:7C:BE:78:C9:A0][LE]> char-read-uuid 00002a19-0000-1000-8000-00805f9b34fb
handle: 0x0022 value: 63

Keep in mind that the value is HEX.

$ python3 -c "print(int('63', 16))"
99

Nice, the battery level is still at 99 %. We don’t care about Link Loss and Tx Power for now.

Next, get the button press. There are two UUID left. At the moment we don’t know much about the remain services or their settings. Without a third-party tool it’s try-and-error with going through possible values.

gatttool
  needs be in listen mode to receive the signal.

The first two approaches don’t work.

$ gatttool -b 08:7C:BE:78:C9:A0 --char-write-req --handle=0x001c --value=0000 --listen

$ gatttool -b 08:7C:BE:78:C9:A0 --char-write-req --handle=0x001c --value=0010 --listen

Here we go:

$ gatttool -b 08:7C:BE:78:C9:A0 --char-write-req --handle=0x001c --value=0100 --listen
Characteristic value was written successfully
Notification handle = 0x001b value: 01

As an example we are going to integrate the Battery level into Home Assistant. Battery level sound like a sensor. Create a file called

troika.py
  in your configuration directory for your custom components. It will become a sensor thus the path will something like that
.homeassistant/custom_components/sensor/troika.py
 . To make the Home Assistant implementation simple, the subprocess module is executing the
gatttool
 . This is not for production usage but for quick tests it sufficient. Also, if multiple platform using the same base then it should become a component.

Copy this code to your

troika.py
  file.

"""Support for Troika keyfinder's Battery status."""
import logging
import subprocess

import voluptuous as vol

from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_MAC, CONF_NAME)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity

_LOGGER = logging.getLogger(__name__)

BLE_BATTERY_HANDLE = '0x0022'

DEFAULT_NAME = 'Troika Battery'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_MAC): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Troika Battery sensor."""
    name = config.get(CONF_NAME)
    mac = config.get(CONF_MAC)

    add_devices([TroikaBattery(name, mac)], True)


class TroikaBattery(Entity):
    """Representation of a Troika Battery sensor."""

    def __init__(self, name, mac):
        """Initialize a Troika Battery sensor."""
        self._state = None
        self._mac = mac
        self._name = name

    @property
    def name(self):
        """Return the name of the sensor."""
        return self._name

    @property
    def state(self):
        """Return the state of the device."""
        return self._state

    @property
    def unit_of_measurement(self):
        """Return the unit the value is expressed in."""
        return "%"

    def update(self):
        """Get the latest data and updates the states."""
        self._state = self.get_battery()

    def get_battery(self):
        """Get the battery level from the SELFMATE."""
        command = ['gatttool', '-b', self._mac, '--char-read', '-a',
                   BLE_BATTERY_HANDLE]
        battery = subprocess.Popen(
            command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
        try:
            out, _ = battery.communicate()
            return int(out.decode().split()[2], 16)
        except subprocess.CalledProcessError:
            return None

Don’t forget to add the new sensor to your

configuration.yaml
  file:

sensor:
  - platform: troika
    mac: "08:7C:BE:78:C9:A0"

After a restart of Home Assistant the new sensor should show up. It seems that the battery is draining quickly.

Let the SELFMATE start beeping is like switching something on or off. For a home automation solution this can be done with a switch. Create a file again in the

custom_components
  directory but this time in the switch folder, e.g.,
.homeassistant/custom_components/switch/troika.py

The code for the switch is uning pretty much the same elements as the sensor.

"""Support for Troika keyfinder's Beeping mode."""
import logging
import subprocess

import voluptuous as vol

from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_MAC, CONF_NAME)
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

BLE_ALERT_HANDLE = '0x0015'

DEFAULT_NAME = 'Troika Beeping'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_MAC): cv.string,
    vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})


def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Troika SELFMATE."""
    name = config.get(CONF_NAME)
    mac = config.get(CONF_MAC)

    add_devices([TroikaBeep(name, mac)], True)


class TroikaBeep(SwitchDevice):
    """Representation of a Troika Battery sensor."""

    def __init__(self, name, mac):
        """Initialize a Troika Battery sensor."""
        self._state = None
        self._mac = mac
        self._name = name

    @property
    def name(self):
        """Return the name of the sensor."""
        return self._name

    @property
    def is_on(self):
        """Return true if device is on."""
        return self._state

    def update(self):
        """Get the latest data and updates the states."""
        return self._state

    def turn_on(self, **kwargs):
        """Turn the device on."""
        self._state = True
        alert_off = ['gatttool', '-b', self._mac, '--char-write-req', '-a',
                   BLE_ALERT_HANDLE, '-n', '01']
        alert = subprocess.Popen(
            alert_off, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
        try:
            alert.communicate()
            return alert.returncode == 0
        except subprocess.CalledProcessError:
            return None

    def turn_off(self, **kwargs):
        """Turn the device off."""
        self._state = False
        alert_off = ['gatttool', '-b', self._mac, '--char-write-req', '-a',
                   BLE_ALERT_HANDLE, '-n', '00']
        alert = subprocess.Popen(
            alert_off, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
        try:
            alert.communicate()
            return alert.returncode == 0
        except subprocess.CalledProcessError:
            return None

To use the switch add it to your

configuration.yaml
  file:

switch:
  - platform: troika
    mac: "08:7C:BE:78:C9:A0"

Implementing the button press is a bit trickier than just monitoring a value. If you want to react on a button press then Home Assistant needs to listen all the time like

gatttool
  with
--listen
 . If you are interested then I suggest that you take a look at the existing platforms for a proper integration of Bluetooth devices.

libinput-record and libinput-replay - tools to record and replay kernel devices

Posted by Peter Hutterer on May 29, 2018 05:58 AM

libinput 1.11 is just around the corner and one of the new features added are the libinput-record and libinput-replay tools. These are largely independent of libinput itself (libinput-replay is a python script) and replace the evemu-record and evemu-replay tools. The functionality is roughly the same with a few handy new features. Note that this is a debugging tool, if you're "just" a user, you may never have to use either tool. But for any bug report expect me to ask for a libinput-record output, same as I currently ask everyone for an evemu recording.

So what does libinput-record do? Simple - it opens an fd to a kernel device node and reads events from it. These events are converted to YAML and printed to stdout (or the provided output file). The output is a combination of machine-readable information and human-readable comments. Included in the output are the various capabilities of the device but also some limited system information like the kernel version and the dmi modalias. The YAML file can be passed to libinput-replay, allowing me to re-create the event device on my test machines and hopefully reproduce the bug. That's about it. evemu did exactly the same thing and it has done wonders for how efficiently we could reproduce and fix bugs.

Alas, evemu isn't perfect. It's becoming 8 years old now and its API is a bit crufty. Originally two separate tools generated two separate files (machine-readable only), two different tools for creating the device and playing events. Over the years it got more useful. Now we only have one tool each to record or replay events and the file includes human-readable comments. But we're hitting limits, its file format is very inflexible and the API is the same. So we'd have to add a new file format and the required parsing, break the API, deal with angry users, etc. Not worth it.

Thus libinput-record is the replacement for evemu. The main features that libinput-record adds are a more standardised file format that can be expanded and parsed easily, the ability to record and replay multiple devices at once and the interleaving of evdev events with libinput events to check what's happening. And it's more secure by default, all alphanumeric keys are (by default) printed as KEY_A so there's no risk of a password leaking into a file attached to Bugzilla. evemu required python bindings, for libinput-record's output format we don't need those since you can just access YAML as array in Python. And finally - it's part of libinput which means it's going to be easier to install (because distributions won't just ignore libinput) and it's going to be more up-to-date (because if you update libinput, you get the new libinput-record).

It's new code so it will take a while to iron out any leftover bugs but after that it'll be the glorious future ;)

PyQt5 thread example

Posted by Kushal Das on May 29, 2018 02:26 AM

PyQt is the Python binding for Qt library. To write Qt5 code, we use PyQt5 module. Like many others, my first introduction to GUI application development was using PyQt. Back in foss.in 2005 a talk from Sirtaj introduced me to PyQt, and later fall in love with it.

I tried to help in a GUI application after 8 years (I think), a lot of things have changed in between. But, Qt/PyQt still seems to be super helpful when it comes to ease of development. Qt has one of the best documentation out there for any Open Source project.

Many students start developing GUI tools by replacing one of the command line tool they use. Generally the idea is very simple, take some input in the GUI, and then process it (using a subprocess call) on a button click, and then show the output. The subprocess call happens over a simple method, means the whole GUI gets stuck till the function call finishes. We can fix this issue by using a QThread. In the below example, we will just write a frontend for git clone command and then will do the same using QThread.

Setting up project directory

I have used qt creator to create a simple MainWindow form and saved it as mainwindow.ui in the project directory. Then, used pipenv to create a virtualenv and also installed the pyqt5 module. Next, used the pyuic5 command to create a Python file from UI file.

The code does not have error checks, the subprocess documentation should give you enough details about how to add them.

Doing git clone without any thread

The following code creates a temporary directory, and then git clones any given git repository into that.

#!/usr/bin/python3

import sys
import tempfile
import subprocess
from PyQt5 import QtWidgets

from mainwindow import Ui_MainWindow


class ExampleApp(QtWidgets.QMainWindow, Ui_MainWindow):

    def __init__(self, parent=None):
        super(ExampleApp, self).__init__(parent)
        self.setupUi(self)
        # Here we are telling to call git_clone method when
        # someone clicks on the pushButton.
        self.pushButton.clicked.connect(self.git_clone)

    # Here is the actual method which does git clone
    def git_clone(self):
        git_url = self.lineEdit.text()  # Get the git URL
        tmpdir = tempfile.mkdtemp()  # Creates a temporary directory
        cmd = "git clone {0} {1}".format(git_url, tmpdir)
        subprocess.check_output(cmd.split())  # Execute the command
        self.textEdit.setText(tmpdir)  # Show the output to the user


def main():
    app = QtWidgets.QApplication(sys.argv)
    form = ExampleApp()
    form.show()
    app.exec_()


if __name__ == '__main__':
    main()

Doing git clone with a thread

In the below example we added a new CloneThread class, it has a run method, which gets called when the thread starts. At the end of the run, we are emitting a signal to inform the main thread that the git clone operation has finished.

#!/usr/bin/python3

import sys
import tempfile
import subprocess
from PyQt5 import QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal

from mainwindow import Ui_MainWindow


class CloneThread(QThread):
    signal = pyqtSignal('PyQt_PyObject')

    def __init__(self):
        QThread.__init__(self)
        self.git_url = ""

    # run method gets called when we start the thread
    def run(self):
        tmpdir = tempfile.mkdtemp()
        cmd = "git clone {0} {1}".format(self.git_url, tmpdir)
        subprocess.check_output(cmd.split())
        # git clone done, now inform the main thread with the output
        self.signal.emit(tmpdir)


class ExampleApp(QtWidgets.QMainWindow, Ui_MainWindow):

    def __init__(self, parent=None):
        super(ExampleApp, self).__init__(parent)
        self.setupUi(self)
        self.pushButton.setText("Git clone with Thread")
        # Here we are telling to call git_clone method when
        # someone clicks on the pushButton.
        self.pushButton.clicked.connect(self.git_clone)
        self.git_thread = CloneThread()  # This is the thread object
        # Connect the signal from the thread to the finished method
        self.git_thread.signal.connect(self.finished)

    def git_clone(self):
        self.git_thread.git_url = self.lineEdit.text()  # Get the git URL
        self.pushButton.setEnabled(False)  # Disables the pushButton
        self.textEdit.setText("Started git clone operation.")  # Updates the UI
        self.git_thread.start()  # Finally starts the thread

    def finished(self, result):
        self.textEdit.setText("Cloned at {0}".format(result))  # Show the output to the user
        self.pushButton.setEnabled(True)  # Enable the pushButton


def main():
    app = QtWidgets.QApplication(sys.argv)
    form = ExampleApp()
    form.show()
    app.exec_()


if __name__ == '__main__':
    main()

The example looks like the above GIF. You can find the source code here. You can find a bigger example in the journalist_gui of the SecureDrop project.

Fixing failed to load module "pk-gtk-module" and "canberra-gtk-module"

Posted by Robbi Nespu on May 28, 2018 04:00 PM

Peace be upon you, I recently use VMware workstation for server simulation for upcoming project but I keep seeing this scrap message as below:

Gtk-Message: Failed to load module “pk-gtk-module”: libpk-gtk-module.so: cannot open shared object file: No such file or directory

Gtk-Message: Failed to load module “canberra-gtk-module”: libcanberra-gtk-module.so: cannot open shared object file: No such file or directory

I check out which package will provide me thus two library modules that needed :

$ dnf provides libpk-gtk-module.so
PackageKit-gtk3-module-1.1.9-3.fc28.i686 : Install fonts automatically using PackageKit
Repo        : fedora
Matched from:
Provide    : libpk-gtk-module.so

$ dnf provides libcanberra-gtk-module.so
Last metadata expiration check: 4 days, 17:34:05 ago on Fri 25 May 2018 05:56:22 AM +08.
libcanberra-gtk2-0.30-16.fc28.i686 : Gtk+ 2.x Bindings for libcanberra
Repo        : fedora
Matched from:
Provide    : libcanberra-gtk-module.so

But this two package already been installed inside my machine and seems this occurs because the requested gtk modules aren’t in any of the paths defined in /etc/ld.so.conf.d/* directory.

We need to created new gtk2.cnf (follow tutorial below).

$ sudo bash -c 'cat > /etc/ld.so.conf.d/gtk2.conf << 'EOF'
/usr/lib64/gtk-2.0/modules
EOF'
$ sudo ldconfig

Now you application (e.g VMware) should never show the same as previous gtk-message again when starting.

Computing Smooth Max and its Gradients Without Over- and Underflow

Posted by Erik Erlandson on May 28, 2018 03:13 PM

In my previous post I derived the gradient and Hessian for the smooth max function. The Notorious JDC wrote a helpful companion post that describes computational issues of overflow and underflow with smooth max; values of fk don't have to grow very large (or small) before floating point limitations start to force their exponentials to +inf or zero. In JDC's post he discusses this topic in terms of a two-valued smooth max. However it isn't hard to generalize the idea to a collection of fk. Start by taking the maximum value over our collection of functions, which I'll define as (z):

eq1

As JDC described in his post, this alternative expression for smooth max (m) is computationally stable. Individual exponential terms may underflow to zero, but they are the ones which are dominated by the other terms, and so approximating them by zero is numerically accurate. In the limit where one value dominates all others, it will be exactly the value given by (z).

It turns out that we can play a similar trick with computing the gradient:

eq2

Without showing the derivation, we can apply exactly the same manipulation to the terms of the Hessian:

eq3

And so we now have a computationally stable form of the equations for smooth max, its gradient and its Hessian. Enjoy!

ManPages em pt_br Fedora 28

Posted by Daniel Lara on May 28, 2018 02:25 PM
Para quem quer suas manpages traduzidas...

Adicione o repositório:

$ sudo dnf copr enable danniel/man-pages-pt_BR

E instale:

$ sudo dnf install man-pages-pt_BR -y

Feito!

$ man cp

Fedora 26 end of life approaching

Posted by Fedora Magazine on May 28, 2018 01:20 PM

UPDATE: Date corrected to May 29.

As readers may be aware, Fedora 28 recently released to great acclaim. That means Fedora 26 hits its End of Life (EOL) status on May 29, 2018. Read more here about what this means, and what steps you can take with your older Fedora systems.

After May 29, packages in the Fedora 26 repositories no longer receive any security, bugfix, or enhancement updates. Furthermore, at that point the community adds no new packages to the F26 collection.

The Fedora Project highly recommends you upgrade all systems to Fedora 28 or Fedora 27 before the EOL date. Upgrades are an easy way to keep your system setup while you move to the latest technology.

Looking back at Fedora 26

Fedora 26 was released in July 2017. During its lifetime, the Fedora community published nearly 10,000 updates to the F26 repositories. Fedora 26 Workstation featured version 3.24 of GNOME. The release also carried numerous improvements and highlights:

  • A new partitioning tool in Anaconda for expert setup
  • DNF 2.5 with new software management capabilities
  •  The Python Classroom Lab which helps educators introduce students to the latest technology

About the Fedora Release Cycle

The Fedora Project provides updates for a particular release until a month after the second subsequent version of Fedora is released. For example, updates for Fedora 26 continue until one month after the release of Fedora 28. Fedora 27 continues to be supported up until one month after the release of Fedora 29.

Since Fedora 28 released on time on May 1, 2018, Fedora 26 reaches EOL even though it’s been around less than 11 months. So if that lifecycle seems shorter than usual to you, you’re right!

The Fedora Project wiki contains more detailed information about the entire Fedora Release lifecycle. The lifecycle includes milestones from development to release, and the post-release support period.

Seamless single-sign-on

Posted by Cockpit Project on May 28, 2018 10:00 AM

Beyond a “single pane of glass

Organizations who use several machines often run management display software in an attempt to integrate all infrastructure. ManageIQ and Foreman are great examples of this kind of software.

Managing machines from the outside is usually adequate, but sometimes it’s best to log into the machine itself and have a look around. Cockpit excels in this task. In fact, both ManageIQ and Foreman have Cockpit integration built-in.

Seamless single-sign-on

Machine management software already has administrative access over the machines (both virtual and on bare metal), so there should not be a need to type credentials a second time.

Indeed, ManageIQ currently opens Cockpit in a seamless manner, using OAuth and external authentication helpers, all without requiring additional username and passwords.

Foreman currently does not have a seamless handover; it simply provides a standard link. As a result, when Foreman opens Cockpit, you’re greeted with the log in page.

How can we improve Foreman?

It would be ideal for Foreman to also have seamless Cockpit integration.

Test it out

If you are using Foreman to manage your machines and would seamless credentials handover, we welcome you to try out the above code — and please let us know how it works for you!

Fedora 28 template is available on QubesOS

Posted by Kushal Das on May 28, 2018 04:43 AM

In case you missed the news, Fedora 28 is now available as a template in Qubes OS 4.0. Fedora 26 will end of life on 2018-06-01, means this is a good time for everyone to upgrade. Use the following command in your dom0 to install the template. The template is more than 1GB in size, means it will take some time to download.

$ sudo qubes-dom0-update qubes-template-fedora-28

After installation, remember to start the template, and update, and also install all the required applications there. Next step would be to use this template everywhere.

Btw, we do have the latest Python 3.6.5 in Fedora 28 :)

$ python3
Python 3.6.5 (default, Mar 29 2018, 18:20:46)
[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Episode 98 - When IT decisions kill people

Posted by Open Source Security Podcast on May 28, 2018 12:30 AM
Josh and Kurt talk about the NTSB report from the fatal Uber crash and what happened with Amazon's Alexa recording then emailing a private conversation. IT decisions now have real world consequences like never before.


<iframe allowfullscreen="" height="90" mozallowfullscreen="" msallowfullscreen="" oallowfullscreen="" scrolling="no" src="https://html5-player.libsyn.com/embed/episode/id/6638938/height/90/theme/custom/autoplay/no/autonext/no/thumbnail/yes/preload/no/no_addthis/no/direction/backward/render-playlist/no/custom-color/6e6a6a/" style="border: none;" webkitallowfullscreen="" width="100%"></iframe>


Show Notes


Installing and Configuring A web server in Fedora 27/28

Posted by Nisankh Acharjya on May 27, 2018 08:13 PM

Install Apache httpd

Install httpd to configure Web Server.

sudo dnf -y install httpd

Remove the Default Test Page

sudo rm -f /etc/httpd/conf.d/welcome.conf

sudo vi /etc/httpd/conf/httpd.conf<br>

# line 86: change to admin's email address

ServerAdmin

root@<domain.tld>

# line 95: change to your server's name

ServerName domain.tld:80

# line 151: change

AllowOverride All

# line 164: add file name that it can access only with directory's name

DirectoryIndex index.html index.cgi index.php

# add follows to the end

# server's response header

ServerTokens Prod

# keepalive is ON

KeepAlive On<br>


sudo systemctl start httpd<br>


sudo systemctl enable httpd<br>

sudo firewall-cmd --add-service=http --permanent

sudo firewall-cmd --reload

Now your apache httpd Webserver is ready .. you can test by creating a html page and store the html at /var/www/html/

Get the FESCo badge/FESCo nomination period extended

Posted by Till Maas on May 27, 2018 06:08 PM

rubber-stamp

There were not enough candidates for the upcoming FESCo election, therefore you still have time to nominate yourself to get the beloved FESCo badge. It would be great to see some new faces in the committee. So nominate yourself now or ask someone you know if they would like to. You have until 31 May 2018.