HOWTO: Install Ansible Semaphore on CentOS 7.X (no docker)

I wrote a little ago about how to install Ansible Semaphore as a docker. It’s been raining a lot since them, and now it’s time to finish what I started and install it for real. It’s not so complicated. Unfortunately the result didn’t deliver. Below you have my installation log and my setup, together with a relevant output.

## > wget https://github.com/ansible-semaphore/semaphore/releases/\
> download/v2.8.75/semaphore_2.8.75_linux_amd64.rpm
--DATE-- https://github.com//semaphore_2.8.75_linux_amd64.rpm
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://XXX
Saving to: - semaphore_2.8.75_linux_amd64.rpm
100%[==========================>] 11,696,811 34.3MB/s in 0.3s
DATE (34.3 MB/s) -Β  semaphore_2.8.75_linux_amd64.rpm
saved [11696811/11696811]
## > yum install semaphore_2.8.75_linux_amd64.rpm
Loaded plugins: fastestmirror, langpacks, nvidia
Examining semaphore_2.8.75_linux_amd64.rpm:
semaphore-2.8.75-1.x86_64
Marking semaphore_2.8.75_linux_amd64.rpm
to be installed
Resolving Dependencies
--> Running transaction check
---> Package semaphore.x86_64 0:2.8.75-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================
Package Arch Version Repository Size
============================
Installing:
semaphore x86_64 2.8.75-1 semaphore_2.8.75_linux_amd64 31 M
Transaction Summary
================================
Install 1 Package
Total size: 31 M
Installed:
semaphore.x86_64 0:2.8.75-1
Complete!
## > semaphore setup
Hello! You will now be guided through a setup to:

1. Set up configuration for a MySQL/MariaDB database
2. Set up a path for your playbooks (auto-created)
3. Run database Migrations
4. Set up initial semaphore user & password

What database to use:
1 - MySQL
2 - BoltDB
3 - PostgreSQL
(default 1):

db Hostname (default 127.0.0.1:3306):
db User (default root):
db Password: MYPASSWORD
db Name (default semaphore):
Playbook path (default /tmp/semaphore):
Web root URL (optional, see Web-root-URL):
Enable email alerts? (yes/no) (default no): yes
Mail server host (default localhost):
Mail server port (default 25):
Mail sender address (default semaphore@localhost): XXX
Enable telegram alerts? (yes/no) (default no):
Enable slack alerts? (yes/no) (default no):
Enable LDAP authentication? (yes/no) (default no):
Config output directory (default /root/Downloads):

Running: mkdir -p /XXX/semaphore..
Configuration written to /XXX/semaphore/config.json..
Pinging db..

Running db Migrations..
Executing migration v0.0.0 (at DATE)...
Creating migrations table
[12/0]8]
Executing migration v1.0.0 (at DATE)...
[4/87]
... some other migrations...
Executing migration v2.8.58 (at DATE)...
[1/57]
Migrations Finished

> Username: root
> Email: my.email@domain.org
WARN[0075] no rows in result set level=Warn
> Your name: MYNAME
> Password: MYPASSWORD

You are all setup Juan!
Re-launch this program pointing to the configuration file

./semaphore server --config /XXX/semaphore/config.json

To run as daemon:

nohup ./semaphore server \
--config /XXX/semaphore/config.json &

You can login with my.email@domain.org or root.

Now let’s run it.

## > semaphore server --config /XXX/semaphore/config.json
MySQL root@127.0.0.1:3306 semaphore
Tmp Path (projects home) /XXX/ansible/semaphore
Semaphore v2.8.75
Interface
Port :3000
Server is running
WARN[0037] write IP:3000->IP:41248: write: broken pipe level=Warn
INFO[322969] Task 1 added to queue
INFO[322970] Set resource locker with TaskRunner 1
INFO[322970] Stopped preparing TaskRunner 1
INFO[322970] Release resource locker with TaskRunner 1
INFO[322975] Task 1 removed from queue

The INFO entries are produced after running my first task successfully. It takes a little to configure it (you need to write an inventory, an environment, choose a key and define your repositories). Everything is fine from now on. Unfortunately it’s relying on repositories and quite complex playbooks, so it’s not going to be my choice. I want something that even a monkey with a keyboard can use. I’ll keep you informed of the results of my search πŸ™‚

Β 

HOWTO : fix clock skew on date (when running it on a cron job)

Preliminaries: the date command works but it shows a different output when running as a cronjob than when running as a script. That is:

## > date=$(date +"%Y-%m-%d %H:%M:%S")
## > echo $date
2023-03-27 20:04:49
... wait for the cron each minute to run...
## > more date.log
2023-03-27 14:05:49

Such a precise skew directly points to a wrong timezone. Let’s configure it.

## > timedatectl 
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.
Local time: Mon 2023-03-27 14:12:29 EDT
Universal time: Mon 2023-03-27 18:12:29 UTC
RTC time: Mon 2023-03-27 18:12:29
Time zone: America/New_York (EDT, -0400)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2023-03-12 01:59:59 EST
Sun 2023-03-12 03:00:00 EDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2023-11-05 01:59:59 EDT
Sun 2023-11-05 01:00:00 EST

We are NOT in NY! Unfortunately, I hope. I found the fix here. I set the zone to Berlin and restart the crons just in case:

## > timedatectl set-timezone Europe/Berlin
## > systemctl restart crond
## > systemctl restart rsyslog

After this all the times are right, except mine πŸ˜€

A static file server docker : static-file-server

Imagine you want to share a folder with someone in your intranet and you have no mood to deal with samba or run around with memory sticks. If you have dockers on your machine, just start a static-file-server instance and give the link http://localhost:8080/ to your friends, family, or clients. You get it. πŸ™‚

The github docker page is here. To run the docker ofer “/my/folder/” just do as indicated:

docker run -d \
-v /my/folder:/web \
-p 8080:8080 \
halverneus/static-file-server:latest

The result: a bunch of network links to the content of “/my/folder/”. No stuff attached, no html, no CSS, nothing. Which is why it loosk so nice if you ask me πŸ™‚

HOWTO: install Chrome in CentOS 7.X

We need to have a browser up to date. And some things don’t run unless we have Chrome (picture taken from here). Unfortunately, the browser is not available by default on CentOS 7.X, so you cannot simply yum install it πŸ™‚ . How can you enjoy it? I found the solution on this linuxize post. In two steps.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

yum localinstall google-chrome-stable_current_x86_64.rpm

After that, I get the icon in the corresponding menu (the internet menu) and I can call it from command line if needed. And enjoy the latest technology πŸ™‚

HOWTO: install NVIDIA and CUDA on Fedora 37

I come back to Fedora after… 6 years of so… with Scientific Linux first, then with CentOS. It feels nice to come back to it after such a long time! The installation went smootly and I ended up with kernel 6.1.14, which is, very modern in comparison with the one I’m using in CentOS (3.10.0) and slightly more modern than the Ubuntu one (5.15.0). Actually the picture above corresponds to kernel 5.12.8, but the feeling is the same. I took the pic from the installation guide I have followed. Basically the install is done in the same way than 6 years ago. Allow me to ellaborate.

  1. Get the cuda package. I got cuda_12.0.1_525.85.12_linux.run
  2. Try to run it and check the errors on /var/log/cuda-installer.log and /var/log/nvidia-installer.log.
  3. Install the missing packages (maybe kernel-devel and similar)
  4. Blackliust the nouveau drivers echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
  5. Edit /etc/default/grub. My grub line looks like this : GRUB_CMDLINE_LINUX="rhgb quiet rd.driver.blacklist=nouveau nvidia-drm.modeset=1"
  6. Adjist grub. grub2-mkconfig -o /boot/grub2/grub.cfg
  7. Remove nouveau. yum remove xorg-x11-drv-nouveau
  8. Make initramfs backup first. mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
  9. Generate a new initramfs. dracut /boot/initramfs-$(uname -r).img $(uname -r)
  10. Reboot, go to init 3 (no graphics) and try again the installer.

As you see, pretty easy but with a lot of steps. I need to cook up a better way. Maybe with ansible. I’ll keep you posted. BTW, you can download Fedora for Workstations here. BTW2: sorry but the dragons are fighting, maybe they will come back soon πŸ˜‰

Error: cannot find -lmkl_intel_lp64 while compiling on Ubuntu 20.04

Ubuntu 20 is escalating positions as the heir of CentOS 7, and I started experiencing compatibility issues. I was compiling relion with the next options

cmake -DAMDFFTW=ON -DCUDA_ARCH=86 -DCUDA=ON -DCudaTexture=ON 
-DFORCE_OWN_FLTK=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc
-DMPI_C_COMPILER=/usr/bin/mpicc
-DMPI_C_LIBRARIES=/usr/lib/x86_64-linux-gnu/openmpi/lib/
-DMPI_C_INCLUDE_PATH=/usr/lib/x86_64-linux-gnu/openmpi/include/
-DCUDA_ARCH=61 -DCUDA=ON -DCudaTexture=ON -DMKLFFT=ON
-DFORCE_OWN_FLTK=ON -DGUI=ON
-DCMAKE_INSTALL_PREFIX=/XXX/relion_local/
-D CMAKE_BUILD_TYPE=Release ..

when I found this error

[ 59%] Linking CXX executable ../../bin/relion_tomo_tomo_ctf
/usr/bin/ld: cannot find -lmkl_intel_lp64
/usr/bin/ld: cannot find -lmkl_sequential
/usr/bin/ld: cannot find -lmkl_core
collect2: error: ld returned 1 exit status
make[2]: *** [src/apps/CMakeFiles/tomo_ctf.dir/build.make:102:
bin/relion_tomo_tomo_ctf] Error 1
make[1]: *** [CMakeFiles/Makefile2:352:
src/apps/CMakeFiles/tomo_ctf.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I’m using the default package install locations, no modules or anything fancy. So it looks like some libraries are missing. Of course I try to find them with ldconfig -p | grep ‘mkl’ but they are obviously not there. Let’s install them:

# apt-get install libmkl*intel* libmkl*se* libmkl*core*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libmkl-intel-thread' for glob 'libmkl*intel*'
Note, selecting 'libmkl-blacs-intelmpi-ilp64' for glob 'libmkl*intel*'
Note, selecting 'libmkl-intel-ilp64' for glob 'libmkl*intel*'
Note, selecting 'libmkl-blacs-intelmpi-lp64'
for glob 'libmkl*intel*'
Note, selecting 'libmkl-intel-lp64' for glob 'libmkl*intel*'
Note, selecting 'libmkl-sequential' for glob 'libmkl*se*'
Note, selecting 'libmkl-core' for glob 'libmkl*core*'
Note, selecting 'libmkl-cdft-core' for glob 'libmkl*core*'
The following additional packages will be installed:
libmkl-def libmkl-locale libmkl-vml-def
The following NEW packages will be installed:
libmkl-blacs-intelmpi-ilp64 libmkl-blacs-intelmpi-lp64
libmkl-cdft-core libmkl-core libmkl-def
libmkl-intel-ilp64 libmkl-intel-lp64
libmkl-intel-thread libmkl-locale
libmkl-sequential libmkl-vml-def

0 upgraded, 11 newly installed, 0 to remove and 19 not upgraded.
Need to get 38,4 MB of archives.
After this operation, 204 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

You may need to run apt-get install mklibs in addition. Of course it depends on what you have been doing with your system so far, since this will call some python libraries also. After getting those packages, make and make install run without errors. Time to ask the user to test it…

ERROR : /usr/share/Modules/init/sh: No such file or directory on Ubuntu 22.04

We started the migration to a new Linux flavour – in principle Ubuntu– and therefore we started also to experience the first issues. We have a very established software module method, with the module definitions being loaded from a network location. We can install software modules, but after every folder needed and every other adjustment is made we see this:

$ > ssh user@new-server
Last login: DATE from other-server.org
-bash: /usr/share/Modules/init/sh: No such file or directory

I have a machine “other-server” to check how the modules are working. And I find that the folder “Modules” is missing in Ubuntu. The content of the folder modules in the same location seems to be the same, so I do

root@new-server:/usr/share# ln -s /usr/share/modules Modules

And try logging again. With this result:

$ > ssh user@new-server
user@new-server's password:
Last login: DATE from other-server.org
user@new-server ~ $ > module avail
/PATH/modulecmd:
error while loading shared libraries:
libtcl8.5.so: cannot open shared object file:
No such file or directory

So there’s now a library problem. Let’s try to fix it very quickly. I localize a similar library

root@new-server:~# ls /usr/lib/*/*libtcl*
/usr/lib/x86_64-linux-gnu/libtcl8.6.so
/usr/lib/x86_64-linux-gnu/libtcl8.6.so.0
/usr/lib/x86_64-linux-gnu/libtclenvmodules.so
root@new-server:~#
cp /usr/lib/x86_64-linux-gnu/libtcl8.6.so /usr/lib/libtcl8.5.so
root@new-server:~# ldconfig

And the error is gone. We can do this because the libraries are not so different…. I have no idea of the side effects. Let’s hope there are not so many πŸ˜‰!

WordPress multisite: more than one WP site in one server

I don’t have so much mood to write lately. I guess I’ve been busy thinking or something like that. Anyway, here I am again. (B)logging the last thing I did, that is to transform a single WP install onto a multisite install.I will be following this guide to arrive to the desired multisite configuration.

I start with an installed version (so no docker) on CentOS 7. I deactivate the plugins, then edit /var/www/html/wp-config.php as indicated.

Add this code before the /* That's all, stop editing! Happy blogging. */ line:

/* Multisite */
define('WP_ALLOW_MULTISITE', true);

I save the edits on the wp-config.php, and restart httpd service. Unfortunately I don’t get the Network Setup Menu as in the guide (maybe you get it) but I don’t worry about it and continue. After that I will regret, and I will need to edit various other files to achieve what I want. Here you have the details about the file modifications needed. But basicallyt I have installed phpMyAdmin also. For that I have installed and configured mod_rewrite for apache and fixed a package error problem with php 7.4 install on CentOS 7.9. In brief

yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php74

And of course, I have given permission to access phpmyadmin on this server. But at the end, as usual I manage to get what I want. Or should I say you managed to get what you wanted? 🧐. Because what I want is to write about what I think, not about what I do. And I’m not in the mood πŸ˜”. See you around…

HOWTO: Install WordPress in debian 11 (no docker)

Previously I have installed WP on CentOS 7.X, now I have tried in another system, Debian GNU/Linux 11 (bullseye). I have followed this tutorial from Cloud Infrastructure Services basically cut’n’copying until Step 5, replacing :

In other words, replace the generic entries. I test the apache configuration

# apache2ctl configtest
Syntax OK

Then I go to http://IP_ADDRESS and create the root user, etc. Like it is written here, on the howto install WP on Debian. It was very easy, as it was for CentOS 😎! Note that in one of the tutorial we use an apache server, and in the last one it’s an NGINX Virtual Host. Happy wordpressing! 😁.

A LimeSurvey in a docker: make it a quick and dirty

You may need to ask your colleagues about something at one point, I’m sure about it. But I’m sure about also that you don’t have time, neither hardware, to program an entire survey or to install the software in a specific server. Since I’m lazy also, as you know, I looked for a docker solution until I found one that does the job. The basic principles of a lime survey you get on this post. This will work if your docker station has a mysql database – you will be asked to connect to the database. If you don’t have, or you don’t want to use it, we need a compose with a mysql docker.

It is worth to mention all the docker images I found. I hope it saves you googling time! 😁😁. So here you have the crramirez limesurvey image, with a pseudo-docker compose. And here you have the martialblog limesurvey, with a lot of possible customisations. Me, I’m a simple person. I don’t want to play with customisation, I want to download a compose file and get the thing working out of the box. This goal you can achieve with the acspri limesurvey. In short (or TLTR) 😁😁😁: make a folder and copy this into a docker-compose.yml file.

version: '2'
services:
limesurvey:
image: acspri/limesurvey
ports:
- 8082:80
environment:
LIMESURVEY_DB_PASSWORD: example
LIMESURVEY_ADMIN_USER: admin
LIMESURVEY_ADMIN_PASSWORD: password
LIMESURVEY_ADMIN_NAME: Lime Administrator
LIMESURVEY_ADMIN_EMAIL: lime@lime.lime
volumes:
- ./plugins:/var/www/html/plugins
- ./upload:/var/www/html/upload
- ./config:/var/www/html/application/config
mysql:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example

As usual, careful with the formattingΒ if you cut’n’paste from above. Once you have this file in a folder in the computer with dockers up and running, just type

docker-compose up -d

And access to:

Frontend (what you send to the people)

http://localhost:8082/

Backend (to create the survey)

http://localhost:8082/index.php/admin

I’m not going to dig more, since now it’s time to write the survey. Don’t forget to check how to configure the default answers and how to export the results. If anyone is interested, that is not always the case 😩😩😩.