linux

Heap memory allocation in Linux

Heap memory allocation in Linux I’m confused about whether the memory allocated by Linux when a process requests ‘x’ amount of heap is actually contiguous physically or not? Here’s my understanding till now: The unit of memory allocation in Linux is page size. By default, page size = 4KB. The page is physically contiguous in …

Total answers: 1

Why can't hard links reference files on other filesystems?

Why can't hard links reference files on other filesystems? I’m aware that this article exists: Why are hard links only valid within the same filesystem? But it unfortunately didn’t click with me. https://www.kernel.org/doc/html/latest/filesystems/ext4/directory.html I’m reading operating system concepts by Galvin and found some great beneficial resources like linux kernel documentation. There can be many directory …

Total answers: 5

iptables allow host for isolated VLAN

iptables allow host for isolated VLAN I’m having a real trouble trying to do a "simple" tweak in my network. So: there are two sites, A and B and are connected via IPsec and there’s no problem in communication between them. each site has two VLANs, main and guest: main is 192.168.55.0/24 for A and …

Total answers: 1

Iptables, subnet rule overwriting ip rule

Iptables, subnet rule overwriting ip rule I want to DROP all packet that come from the subnet 192.168.112.0/24 with destination 192.168.112.0/24 but I want to allow only a specific destination to be accessible (192.168.112.253). I am using the following rules, the first (DROP) rule is working as expected dropping all packets but the second (ACCEPT) …

Total answers: 2

Redirect port using TC BPF

Redirect port using TC BPF I’m want to use TC BPF to redirect incoming traffic from port 80 to port 8080. Below is my own code, but I’ve also tried the example from man 8 tc-bpf (search for 8080) and I get the same result. #include <linux/bpf.h> #include <bpf/bpf_helpers.h> #include <bpf/bpf_endian.h> #include <linux/pkt_cls.h> #include <linux/if_ether.h> …

Total answers: 1

Tracking the source of PostgreSQL authentication failures in Linux Localhost

Tracking the source of PostgreSQL authentication failures in Linux Localhost I have these logs in my PostgreSQL database log file that appeared after I changed the database password. 2023-09-14 11:57:15.937 UTC [3401773] username@db-name FATAL: password authentication failed for user "username" 2023-09-14 11:57:15.937 UTC [3401773] username@db-name DETAIL: Password does not match for user "username" Connection matched …

Total answers: 3

Copy file from Server A to Server B

Copy file from Server A to Server B I have requirement to copy files from Server A to Server B And then move the copied files Server A to Archive folder I have written the script, but it takes the directory name differently. Copying file from Server A to Server B is working, but moving …

Total answers: 2

sudo: get sound playback running as another user

sudo: get sound playback running as another user I block all Internet traffic for my kids’ Linux accounts using iptables. Sometimes I want to allow them to use one program or another. In such cases I enable them to run that programs as another(unlimited) user via sudoers. This time I tried to enable them to …

Total answers: 2

Recovering an ext4 partition

Recovering an ext4 partition I have an external drive with an ext4 partition /dev/sda1 I use for my local borg backups. It is simply plugged in via usb port, and, mounted with an fstab generated systemd automount entry. I ran a backup yesterday in the evening without any errors, and this morning, I plugged it …

Total answers: 1

Why is the result of cat /sys/class/thermal/thermal_ zone0/temp 0?

Why is the result of cat /sys/class/thermal/thermal_ zone0/temp 0? I am customizing Linux and using kernel version 6.4.0. I don’t know why I used cat /sys/class/thermal/thermal_zone0/temp to check the CPU temperature and the result was 0? But my PC is clearly starting normally and generating heat. Did I turn off any options when make memunconfig? …

Total answers: 1

How to install slocate in Ubuntu

How to install slocate in Ubuntu I have seen several references to the slocate command [1][2] as a more secure alternative to the locate command. However I cannot install it using sudo apt install slocate. I also cannot find any references on how to install it for Ubuntu and only one reference to installing it …

Total answers: 1

There are some strange processes in the customized Linux system?

There are some strange processes in the customized Linux system? I am customizing a Linux real-time system using the Linux 6.4.0 kernel and patch-6.4.6-rt8 patch. I don’t know why, when I was executing top, I found these strange processes, such as #1 and #2, and their number showed an increasing trend. I searched with grep …

Total answers: 1

tar alternative to bsdtar –include

tar alternative to bsdtar –include I’m trying to adapt a script that uses bsdtar, which is not available on my Linux distribution. bsdtar -x -f <file> –include="SOME/FOLDER/" What is the alternative of –include in tar command? Asked By: mkrasowski || Source From old Solaris documentation: you can use something like: tar -xf <file> $(tar -tf …

Total answers: 2

Is there any specific relationship between initramfs production and bzImage production?

Is there any specific relationship between initramfs production and bzImage production? My initial problem was that the system was blocked to the initramfs shell. Later, telcoM and Tom Yandiscovered that my problem was due to a lack of drivers and mismatched versions of the subsequent drivers. Therefore, I followed their advice and resolved my problem. …

Total answers: 1

Pass result of find command as another command's multiple options

Pass result of find command as another command's multiple options I have a CLI tool that can take an option with multiple values – The syntax is like this: CLI -I path/to/file1 -I path/to/file2 … How can I pass the result of the find command to this CLI? For reference If it’s positional multiple arguments: …

Total answers: 3

Linux Groups – administration tables

Linux Groups – administration tables Using Red Hat Enterprise Linux 7.9 Shell = sh When I execute … getent group <group-name> — command 1 e.g . >>> getent group grp1 grp1:VAS:67458 usr3,usr2,usr1 >>> groups usr4 usr4: unixuser grp1 >>> getent group grp1 grp1:VAS:67458 usr4,usr3,usr2,usr1 result is not up to date, certain users are missing from …

Total answers: 1

Linux build with custom config using all RAM (8GB)?

Linux build with custom config using all RAM (8GB)? I am trying to compile the mainline Linux kernel with a custom config. This one! Running on a 64 bit system. At the last step, when linking the Kernel, it fails because it goes OOM (error 137). […] DESCEND objtool INSTALL libsubcmd_headers CALL scripts/checksyscalls.sh LD vmlinux.o …

Total answers: 2