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

Upgrading STM32 Nucleo F401RE Firmware on Linux

I’ve been meaning to pick up a micro-controller and work on it again. About 5 years ago when I first encountered Arduino, I spent sleepless night learning about it, and creating things from DIY weather station, world clock, light sensor, etc. Fast forward to the current days, I almost forgot everything I learned. But we can always re-learn, or can’t we? Tonight, I found an Stm32 Nucleo F401RE micro-controller, and I want to start by updating the firmware on it (admittedly, this is the easiest thing to do)....

June 15, 2020 · 2 min · 301 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