Software engineer >> Sysadmin >> Devops >> SRE

Note book to help you and me remember some tricks

Page 5 of 6

mount : System Error: No route to host

(french version of this error message: mount: /mnt/refresh : échec de l’appel système mount(2) : Aucun chemin d’accès pour atteindre l’hôte cible.) You need to install cifs-utils cifs-utils brings utilities for the management of mounting points to CIFS servers (SMB… Continue Reading →

CentOS-8 – AppStream Error: Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

Solution to CentOS 8 AppStream Error As explained here, Centos mirrors have been migrated to vault.centos.org. Then the solution is: After this you can again use the yum command but you won’t received recent updates because Centos mirrors are not… Continue Reading →

How manage background tasks in your CLI and in your shell script application

First: do you know how to run background task not attached to your user session? Running a task attached to your current user session Imagine you establish an ssh connection to your linux host, or you just log into your… Continue Reading →

Shell script function particularities: declare local variables, run in background, …

Run a function in background and get its process ID Instead of creating another script that you call from your primary script you can simply declare a function (inside your primary script or inside another file that you include), and… Continue Reading →

Shell script special variables ordered by frequency of used

$n Where n is a positive integer and takes values from 1 to a greater value not restricted. n correspond to the position of an argument givent to a script or to a function $? Exit status of the last… Continue Reading →

Ansible inventory, best practices to manage ssh key with a bastion (jump host)

Ansible ssh key connection Refer to https://nicodevlog.com/2022/05/21/public-key-authentication-on-linux-best-practices-a-more-secure-way-to-connect-to-your-hosts-without-login-and-password/ The advantages of an ssh key over a basic authentication are: no raw password (but you can encrypt passwords using ansible vault) one unique private key to connect to several nodes (but of… Continue Reading →

Public key authentication on Linux – best practices: a more secure way to connect to your hosts without login and password

Note: for the whole article, I will work with a linux user called ansible on a host called also…ansible! 🙂 ssh-keygen When you use ssh-keygen you will generate a private and public key pair. And you’ll have to choose which… Continue Reading →

Install ansible 5 inside a python virtual environment with python 3.10.4

Note: The following commands are for RockyLinux, RedHat, CentOS, on other distros it will be almost the same. I’ve made the choice to connect to a user called ansible, and inside his home directory I’ve created a directory called ansible,… Continue Reading →

Python and virtual environments on Linux OS

Install python 3.10.4 from source on Rocky Linux or CentOS The following commands are executed as a root user. Virtual Python environment You can install several virtual python environments on your Linux OS. It will allow you to deploy a… Continue Reading →

How to empty a file with cmd or powershell? (equivalent of linux: cat /dev/null > pathtofile)

cmd version: The file is now 0 byte size, and occupies 0 byte on disk. powershell version: In this case, the properties of the file show us it’s now 2 bytes size then not completely empty. And the file uses… Continue Reading →

« Older posts Newer posts »

© 2024 Software engineer >> Sysadmin >> Devops >> SRE

Up ↑