Upgrade a rpm package on a couple of servers with a quick one-liner in Ansible

Upgrade a rpm package on a couple of servers with a quick one-liner in Ansible :

export ANSIBLE_INVENTORY=servers_list
ansible all -b --ask-become-pass -m yum "name=bash state=latest"

servers_list is the text file listing your servers.
Using the ANSIBLE_INVENTORY variable overrides the use of a generate inventory.
This one-liner makes use of the yum Ansible module.
Running sudo commands is possible with these options -b and –ask-become-pass

Network interface disabled by default in CentOS 7

After a fresh installation of CentOS 7, your main network interface may be disabled. Its name may be enp0s3.

Check its status with :

nmcli dev status

To enable it permanently, look at its configuration file at /etc/sysconfig/network-scripts/ifcfg-enp0s3 and make the change from :


Restart the network service :

systemctl restart NetworkManager

The network interface status should now be as connected :

nmcli dev status

Remote: error: insufficient permission for adding an object to repository database objects

If you push code to a git repo, you might get this error :

remote: error: insufficient permission for adding an object to repository database objects
remote: fatal: failed to write object

Make sure that the system permissions are set properly. Stackoverflow provides some good troubleshooting steps.

The commands below solve the issue :

cd /path/to/repo.git
chgrp -R groupname .
chmod -R g+rwX .

git config core.sharedRepository true

For groupname, make sure it matches the user account details that you use for logging in and pushing code to the git server.


Setting aliases in Powershell 4

In Powershell, aliases are shortcuts for cmdlets or for your own functions.
You can create one easily using New-Alias or Set-Alias cmdlets.
To make them available within any Powershell session, put them in the $Profile configuration file.
Let’s have an example :

function start_vm() {
VBoxManage startvm "devbox"

Set-Alias -name svm -value start_vm -description "Booting dev VM"

To make these new aliases available in your current session, reload your configuration file :


To list all the available aliases :




Apache HTTPD : ETag Inode Information Leakage

Apache HTTPD : ETag Inode Information Leakage

This is an error that occurs during PCI scans. To remediate it, disable the ETag feature in your Apache configuration file.

Add FileETag None to /etc/httpd/conf/httpd.conf and restart your Apache server :

echo 'FileETag None' >> /etc/httpd/conf/httpd.conf

service httpd restart

Check if the ETag information are present in the http headers sent by your Apache server  :

curl -I https://your_server_name/ -k



Sudo troubleshooting

To help you troubleshoot a user’s sudo privileges :

Current logged in user’s sudo privileges : sudo -ll

As the local root user : sudo -lU user_id

The user_id can be either a local one or a ldap-based one. sudo will look for this user_id using the nsswitch.conf settings. Make sure that winbind service runs fine to retrieve the user details from the Active Directory.