Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Category Archives: epel

How to get the active title of an X program

I have scripts that will utilise the SFDC case number, but why type it manually when the computer can do it?

Firstly, you need to have xdotool installed, for RHEL or CentOS Stream, it is in EPEL. I have tried xprop and xwininfo, but they do not accept search with WM_Class

Secondly, get the WM_Class of the X program, usually it is just the program name. If you are unsure, open that X program, then run xprog and click at the X program, then search WM_CLASS amongst the output.

Thirdly, for X program that has multiple tabs, make sure you activate the tab you want.

Now, to get the active title of firefox:

for i in $(xdotool search --onlyvisible --class firefox); do xdotool getwindowname $i; done

Two titles will be shown like:

The actual title

For me, I am only interest in the number which are in the beginning of the title, so my command is:

for i in $(xdotool search --onlyvisible --class firefox); do xdotool getwindowname $i; done | sed -rne '/^[0-9]+/ s/^([0-9]+).*$/\1/p'

Build in epel8 branch with fedpkg

This article assumes you have commit right to the package, but you don’t have the epel8 branch in

  1. PKG=<YourPackage>
  2. fedpkg clone $PKG # if you have not done this
  3. cd $PKG # if you have not done this
  4. git branch epel8
  5. # Make the branch work with epel8
  6. git commit
  7. git push –set-upstream origin epel8
  8. fedpkg build
  9. Go to bodhi and create -> New update


nodejs/npm yum repo for EL7

The nodejs and npm in EL7 is too old, so I borrowed the  to latest nodejs spec from  rawhide. Long story short, the result is at:

Please read the disclaimer and do follow the installation instruction if you choose to proceed. I don’t usually put the disclaimer like that but you need to know that:

  1. The build dependency of nodejs include openssl-1.0.2, but EL7 only shipped with 1.0.1, yet nodejs can run with openssl-1.0.1.
  2. openssl-libs is an important package, without it,  yum, curl and rpm URL install won’t work, so restore it is a bit tricky. The instruction is, however, written in the copr page.

Longer story:

To build this copr, following dependencies need to go in as well:

  1. libuv
  2. crypto-policies
  3. openssl-1.0.2

libuv is piece of cake. But crypto-policies and openssl bring the worst packager nightmare: circular dependency. After F23, crypto-policies require openssl-devel to build, yet openssl require crypto-policies to run.

I eventually dug out crypto-policies from F21 and built it, thus broke the circular dependency and finished the build.

RHEL 7 mock build with staff_selinux

By default, mock won’t work with staff_selinux mode in RHEL 7. The instruction from Fedora is mostly correct, but insufficient for staff_selinux. This is because:

  1. /usr/bin/mock is now a sym-link to /usr/bin/consolehelper, thus consolehelper permission should be also allowed.
  2. The Fedora mock policy module does not have the types like staff_consolehelper_t.

There are a lot more reasons, but long story short, I have edited a policy file (PackageMaintainers_MockTricks_mock.te) that should covered the most mock usage. My SELinux skill quickly build up by editing that file. 🙂

Time for script that setup the mock, assuming you are running as root:

# getting dependencies
yum -y install selinux-policy-devel policycoreutils-python mock

# Download policy files

# Build and install
make -f /usr/share/selinux/devel/Makefile
semodule -i PackageMaintainers_MockTricks_mock.pp

That’s it.

But just in case you are still getting SELinux AVC denials, you can get around yourself by using following scripts:

grep -E -e "(mock|consolehelper)" /var/log/audit/audit.log | audit2allow -M my_mock
semodule -i my_mock.pp

cmake-fedora-2.4.3 is released

cmake-fedora consists CMake modules and scripts that simplify and automate the release process for software package, especially for Fedora and EPEL.

Even if you are not using CMake on your packages, you can still using following scripts to simplify your package chores. For examples, if you want your packages to be build in koji and submit to bodhi in all active branches like rawhide, f23, f22, f21, simply run

cmake-fedora-fedpkg <SRPM>

It builds the SRPM on all the active branches, skip the already built ones, then submit them to bodhi.

dchen’s apache-maven is updated to 3.3.3 for el7 and el6

The repo is located at:

To install this for from yum:

cd /etc/yum.repos.d; sudo wget

Enlightenment 0.19.9 and EFL 1.15.1 is ready for RHEL and CentOS 7

I have update the Enlightenment E19 to

  • enlightenment-0.19.9
  • efl-1.15.1
  • elementry-1.15.1

And packages that depend on efl are rebuilt.

In my enlightenment repo, I also put xscreensaver and required dependency.

Note that the packages I built supports neither wayland nor SCIM.

Enlightenment 0.19.7, EFL 1.14.2 for Fedora and RHEL are available in enlightement-19-no-wayland

Enlightenment 0.19.7

EFL 1.14.2

And terminology 0.8.0 rebuild for EFL 1.14.2 are available in my enlightenment repo.

Note that the packages I built supports neither wayland nor SCIM.

Enlightenment E19 on RHEL 7

I quite like Enlightenment and Terminology. However, they are not available on RHEL 7.

Thus I’ve made a copr repo  for RHEL7.

Note that I disable couples of things to make it work in RHEL 7.

  • Wayland support: See
  • SCIM: I don’t want to port SCIM in RHEL 7, normally you can use IBus for input methods.
  • vlc: This cannot be in copr, nor do I have time to build it.
    It is a pity, as you won’t able to see some fancy features provided by EFL filemanager and terminology.

synergy-1.6.2-1 for RHEL/CentOS 7

If you want to install synergy-1.6.2 on RHEL 7,  it is in my EPEL Collection. Use following script to install it As root:

cd /etc/yum.repos.d/
yum -y install synergy

That’s it.