Install Ansible on Gentoo

Gentoo provides a package called app-admin/ansible for Ansible. To install it, just run: ❯ sudo emerge --ask app-admin/ansible Note that unlike Ansible package on CentOS/Fedora, there is no default ansible.cfg provided with the Gentoo Ansible package. ❯ ansible --version ansible 2.9.9 config file = None configured module search path = ['/home/kenno/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.7/site-packages/ansible executable location = /usr/lib/python-exec/python3.7/ansible python version = 3.7.7 (default, May 9 2020, 19:52:18) [GCC 9....

June 28, 2020 · 1 min · 78 words · kenno

How to Label Ext4 Filesystem

I have a 2TB drive, when connecting to my Fedora workstation, it’s mounted using the UUID of the partition as the following: # mount | grep sde1 /dev/sde1 on /run/media/kenno/f59ffb93-5a92-4af9-a9b5-19ca3bb8aa37 type ext4 (rw,nosuid,nodev,relatime,seclabel,uhelper=udisks2) I think it’ll look nicer if it’s mounted with a shorter name, e.g. ‘Podcast’. The filesystem for this drive is ext4. To create a label on the ext4 filesystem, we can use a program called e2label. The exact command is e2label device [ volume-label ] according to the man page....

June 20, 2020 · 1 min · 185 words · kenno

Move or toggle current window to second monitor in DWM

I’ve switched to use DWM, Dynamic Windows Manager, from GNOME on my laptop since the beginning of this month. So far I really enjoyed it. Here are some commands I needed to know since I have an external screen connected ot this machine. To change the focus to previous/next screen: Mod1 + , Mod1 + . To move applications from a screen to another, just add Shift key: Mod1 + Shift + , Mod1 + Shift + ....

June 18, 2020 · 1 min · 89 words · kenno

SELinux Non-Default Home Directory Location

On most my systems I created a user called devops with its home directory created at /srv/devops. And on Fedora or CentOS systems, those home directories have their SELinux context set correctly when created. Recently, I found out that on all 3 machines so far, the SELinux context has been reverted. ~# ls -lZ /srv total 0 drwx------. 5 devops devops system_u:object_r:var_t:s0 127 Oct 30 2019 devops It should have had the same context as the normal user kenno in /home directory:...

June 15, 2020 · 3 min · 482 words · kenno

How to Create Multiple Directories with Incrementing Numbers in Names

I need to create 20 empty directores with the following name: dvd01, dvd02, dvd03,…, dvd20. My first thought was to use for loop, but then I decided to do a quick Google search, and found something more elegant: $ mkdir dvd{01..20} That’s cool, isn’t it? Reference: How to create multiple directories with incrementing numbers in a single command?

June 9, 2020 · 1 min · 58 words · kenno