Skip to content

Editing root-owned files after “unshare -Ur”

Say I am in the initial user namespace and there is an empty root-owned file in some directory: Now I am switching to a new user namespace with unshare -Ur. In this namespace, root.txt is reported to be owned by “nobody” because original root uid(0) is not mapped to the new namespace: Then I use v…

How to add number assigned as array

I have that script that is supposed to read data from two txt files and add them. For that matter I have used array. I can read the data but there is a problem with the addition. Instead of ${dataAll[$i]}= $( ${data1[$i]}+${data2[$i]} ), I have also used ‘expr ${data1[$i]}+${data2[$i]}’ The analys…

How do i fix ksoftirqd 100% cpu

I am doing nothing and ksofttirqd uses 100% of my cpu and my pc is very slow. I looked in my /proc/interrupts and there are a lot of “local time interrupts”, “thermal event interrupts”. How do i fix it? (I run ubuntu 18.4) sensors Answer As you can see from the sensors output, your CPU…

Share Memory in Linux using C

Is it safe to use shm_unlink even there are other process currently open the shared memory? For exmaple: Process B shm_open and then Process A shm_unlink. Is it ok for Process B? Answer Yes, it is safe to call shm_unlink if another process has it opened. Per the man page for shm_unlink: The operation of shm_u…

Linux CentOS 8 – Pip3 install Mariadb

Currently i’m working on a school project where I have to use MariaDB in a Python3 assignment. I have to build a Python script that connects to a database and put information into it. So said and done, I have created a Python script: But now my real issue is starting. I’m working with a Linux Cent…