Data::Printer Perl module on Debian Buster

To see what’s inside a variable or a Perl object, Data::Dumper is often used.
For inspecting objects, its features are limited.
Data::Printer helps you dump your Perl data structures in a complete, colored and human-friendly way.
This module is not part of the Perl core modules.
To install it on Debian Buster :

apt install libdata-printer-perl

Start using it. Its syntax is simple and pretty straightforward.
For objects, it provides public/private methods details that Data::Dumper does not.

More details on Metacpan for Data::Printer

Auto-closing HTML tags in Vim on Debian Buster

Debian provides deb packages for Vim and Vim scripts. Vim scripts are a set of addons to vim to automate repetitive tasks or adding new functionalities to the Vim editor.

This addon, closetag.vim, will be installed and enabled and ready for use when editing an HTML file.

Debian provide a central way to manage Vim addons, vim-addons-manager, system-wide or a per-user configuration.
To install it :

apt install vim-addon-manager vim-scripts

To enable it just for you :

vim-addons install closetag

A local copy of closetag.vim is created in ~/.vim/macros

To enable it in your Vim editor :

:let g:closetag_html_style=1
:source ~/.vim/macros/closetag.vim

The auto-closing function is available in insert mode by typing Ctrl-_

More infos :

https://github.com/vim-scripts/closetag.vim
http://www.vim.org/scripts/script.php?script_id=13

Debian Packaging Policy for Vim

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 :

ONBOOT=no
to
ONBOOT=yes

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 :

.$Profile

To list all the available aliases :

Get-Alias

or

gal

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