Using Bash alias to keep things simple

Alias are very useful tools to create shorthand pseudonyms to run the command you want without typing the whole thing.

Display all alias names

Typing alias the whole command will

$ alias
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'

Useful Alias to consider

alias ls='ls --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'

Remove alias

Just use the command unalias

unalias ll 

Retrieving OpenMPI Configuration

If you need to find out the information on your configuration setting, you may want to use the below commands

$ ./ompi_info -all|grep 'command line'
 Configure command line: '--prefix=/build-result/hpcx-v2.16-gcc-mlnx_ofed-redhat8-cuda12-gdrcopy2-nccl2.18-x86_64/ompi' '--with-libevent=internal' '--enable-mpi1-compatibility' '--without-xpmem' '--with-cuda=/hpc/local/oss/cuda12.1.1' '--with-slurm' '--with-platform=contrib/platform/mellanox/optimized' '--with-hcoll=/build-result/hpcx-v2.16-gcc-mlnx_ofed-redhat8-cuda12-gdrcopy2-nccl2.18-x86_64/hcoll' '--with-ucx=/build-result/hpcx-v2.16-gcc-mlnx_ofed-redhat8-cuda12-gdrcopy2-nccl2.18-x86_64/ucx' '--with-ucc=/build-result/hpcx-v2.16-gcc-mlnx_ofed-redhat8-cuda12-gdrcopy2-nccl2.18-x86_64/ucc'

If you wish to look at the full configuration

$ ./ompi_info
Package: Open MPI root@hpc-kernel-03 Distribution
Open MPI: 4.1.5rc2
Open MPI repo revision: v4.1.5rc1-17-gdb10576f40
Open MPI release date: Unreleased developer copy
Open RTE: 4.1.5rc2
Open RTE repo revision: v4.1.5rc1-17-gdb10576f40
Open RTE release date: Unreleased developer copy
OPAL: 4.1.5rc2
OPAL repo revision: v4.1.5rc1-17-gdb10576f40
OPAL release date: Unreleased developer copy
MPI API: 3.1.0
Ident string: 4.1.5rc2
Prefix: /usr/local/hpcx-v2.16-gcc-mlnx_ofed-redhat8-cuda12-gdrcopy2-nccl2.18-x86_64/ompi
.....
.....
.....

Installing VASP-6.4.2 with Intel-2023.1

For full Requirements for installing VASP-6.4.2, do take a look at Installing VASP.6.X.X

Requirements Needs

Step 1: Prepare the makefile.include

Select the appropriate makefile.include from arch folder that you resemble your environment. In my case

$ cp arch/makefile.include  ./makefile.include

Step 2: Source Intel Environment

$ source /usr/local/intel/2023.1/setvars.sh
:: initializing oneAPI environment ...
   -bash: BASH_VERSION = 4.4.20(1)-release
   args: Using "$@" for setvars.sh arguments:
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vtune -- latest
:: oneAPI environment initialized ::

Step 3: Prepare the Intel Optimised BLAS95, LAPACK95 and FFTW.

Step 4: Build VASP

I like to use “-j1” as I want the compilation to stop on first error

$ make DEPS=1 -j1 all

Step 5: Test

$ make test

No rule to make target `pyamff_fortran/*.f90′, needed by `pyamff_fortran/*.o’.

If you are having this error during your compilation with VASP-6.4.2 and VTST, if you are encountering the error

error message;
No rule to make target `pyamff_fortran/*.f90', needed by `pyamff_fortran/*.o'. Stop.

Solution

Make sure you have updated the LIB in makefile inside src/

# vim /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src/makefile
LIB=lib parser pyamff_fortran

For more information, do take a look at Configuring VTST with VASP-6.4.2 with Intel 2023.1

Configuring VTST with VASP-6.4.2 with Intel 2023.1

Taken from VTST.Tools Installation Guide

The VTST•Tools has a Fortran component which can be linked into the VASP code as well as a collection of scripts.

Step 1: Download the VTST Code

Download the VTST Code (vtstcode.tgz) at http://theory.cm.utexas.edu/vtsttools/download.html 

Step 2: Building VTST code into VASP

To install, download the files in vtsttools/vtstcode, choose a version, and copy the files in the directory into your vasp source directory. The file chain.F is replaced, so back up the old version. There are other files in the package: neb.F, dynmat.F, dimer.F, lanczos.F, sd.F, cg.F, qm.F, lbfgs.F, bfgs.F, fire.F, and opt.F in and vtstcode6.4/ directories. The vtstcode6.4/ directory contains another file called ml_pyamff.F and directory named pyamff_fortran/, which interface to a machine learning package PyAMFF.

In my situation, I put it in /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src

$ cd /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src
$ tar -zxvf vtstcode-198.tgz
$ cd vtstcode-198/vtstcode6.4
$ cp -Rv * /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src

Step 3: Find the variable SOURCE in the .objects file (a hidden file in src/)

Find the variable SOURCE in the .objects file (a hidden file in src/), which defines which objects will be built, and add the following objects before chain.o:

$ cd /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src
$ ls -al .objects
$ vim .objects

Around line 126, before chain.o, insert the following

bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \
fire.o lanczos.o neb.o qm.o \
pyamff_fortran/*.o ml_pyamff.o \
opt.o

Step 4: Update the LIB in makefile inside src/

# vim /usr/local/vasp-6.4.2-vtst/vasp.6.4.2/src/makefile
LIB=lib parser pyamff_fortran

To be continued with VASP Installation later.

Microsoft leaks 38TB of private data via unsecured Azure storage

According to the Article “Microsoft leaks 38TB of private data via unsecured Azure storage

The Microsoft AI research division accidentally leaked dozens of terabytes of sensitive data starting in July 2020 while contributing open-source AI learning models to a public GitHub repository.

Almost three years later, this was discovered by cloud security firm Wiz whose security researchers found that a Microsoft employee inadvertently shared the URL for a misconfigured Azure Blob storage bucket containing the leaked information.

Microsoft linked the data exposure to using an excessively permissive Shared Access Signature (SAS) token, which allowed full control over the shared files. This Azure feature enables data sharing in a manner described by Wiz researchers as challenging to monitor and revoke.

Microsoft leaks 28TB of private data via unsecure Azure storage

What is TMPFS?

TMPFS is a filesystem that exists only in memory. When you reboot the Server, the content of the TMPFS is gone. This is perfect for mounting the /tmp directory

In your /etc/fstab

tmpfs /tmp tmpfs size=30% 0 0

The size option set the maximum size of the filesystem. In the setting above, it can take up to 30% of the total RAM. If you umount the file system, all memory is returned.

Compiling Quantum ESPRESSO-7.2 with Intel-2023.1 on Rocky Linux 8

Step 1: Download the package from Quantum ESPRESSO. You have to register and login before you can download.

# tar -zxvf qe-7.2.tar.gz

Step 2: Source Intel Environment

$ source /usr/local/intel/2023.1/setvars.sh
:: initializing oneAPI environment ...
   -bash: BASH_VERSION = 4.4.20(1)-release
   args: Using "$@" for setvars.sh arguments:
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vtune -- latest
:: oneAPI environment initialized ::

Step 3: Remember to Prepare the Intel Optimised BLAS95, LAPACK95 and FFTW. Do take a look at

Step 4: Compile the QE

Once you have loaded the Intel Configuration costly, QE will detect and configure. Compilation is very simple.

# ./configure --prefix=/usr/local/qe-2.7 ----with-scalapack=intel --enable-shared --enable-openmp | tee Configure.out
# make all
# make install

Step 5: Optional (If you wish to reconfigure again, do a clean up)

Do a clean up by using the command

# make veryclean

Linux expect and spawn id exp6 not open issue

I was having an issue with my expect script

spawn ssh licensecheck@192.168.1.0
Password:
Authentication failed.
send: spawn id exp6 not open
    while executing
.....
.....

This my code…..

#!/usr/bin/expect
set timeout 20
spawn ssh -o PubkeyAuthentication=no licensecheck@192.168.1.0

expect "Password: " {send "mypassword\r"}
expect "$ " {send "/usr/xxx/xxx/xxx/lmstat -a\r"}
expect "$ " {send "exit\r"}

Do check out whether the expression is correct. In case, I leave a space after “Password: ” After I remove, the space, the error is gone. There is also a write-up in a form. Do take a look at Linux – spawn_id: spawn id exp6 not open

Disabling Avahi-Daemon on CentOS 7

I was having a bit of difficult of turning Avahi-Daemon which is also called mDNS since I do not need the Service. When I use the command

# systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-08-28 08:46:26 +08; 14h ago
 Main PID: 36457 (avahi-daemon)
   Status: "avahi-daemon 0.6.31 starting up."
    Tasks: 2
   Memory: 676.0K
   CGroup: /system.slice/avahi-daemon.service
           ├─36457 avahi-daemon: running [hpc-r001.local]
           └─36494 avahi-daemon: chroot helper
.....
.....
.....
 

Unable to Stop ???

I tried to stop it, but the daemon did not stop….. Hmmmmm

# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon.service, but it can still be activated by:
  avahi-daemon.socket
[root@hpc-r001 ~]# systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-08-28 23:11:54 +08; 10s ago
 Main PID: 372559 (avahi-daemon)
   Status: "avahi-daemon 0.6.31 starting up."
    Tasks: 2
   Memory: 704.0K
   CGroup: /system.slice/avahi-daemon.service
           ├─372559 avahi-daemon: running [hpc-r001.local]
           └─372563 avahi-daemon: chroot helper

Unable to Disable ???

I tried to disable as well. But…… still alive?

# systemctl disable avahi-daemon
Removed symlink /etc/systemd/system/multi-user.target.wants/avahi-daemon.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.Avahi.service.
Removed symlink /etc/systemd/system/sockets.target.wants/avahi-daemon.socket.
[root@hpc-r001 ~]# systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-08-28 23:12:25 +08; 2min 32s ago
 Main PID: 372707 (avahi-daemon)
   Status: "avahi-daemon 0.6.31 starting up."
   CGroup: /system.slice/avahi-daemon.service
           ├─372707 avahi-daemon: running [hpc-r001.local]
           └─372709 avahi-daemon: chroot helper

Finally…… Mask, Disable then stop.

To prevent a service from running you need to “mask” it first

# systemctl mask avahi-daemon
Created symlink from /etc/systemd/system/avahi-daemon.service to /dev/null.
# systemctl disable avahi-daemon
# systemctl stop avahi-daemon

# systemctl status avahi-daemon
● avahi-daemon.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead) since Mon 2023-08-28 23:15:42 +08; 20min ago
 Main PID: 372707 (code=exited, status=0/SUCCESS)