Why does the setuid bit work inconsistently?

I wrote the code: // a.c #include <stdlib.h> int main () { system("/bin/sh"); return 0; } compiled with command: gcc a.c -o a.out added setuid bit on it: sudo chown root.root a.out sudo chmod 4755 a.out On Ubuntu 14.04, when I run as general

Read More ...


Why does hexdump try to read through EOF?

When run from a terminal, hexdump does not react to a single ^D at the beginning of the line, as cat, od, bc, etc. do, unless there was no input yet: prompt% hexdump -C <control-D> prompt% hexdump -C hello <control-D><control-D> # a single ^D won't do 00

Read More ...


What are nvme namespaces? How do they work?

I've recently begun supporting Linux installed on devices with built-in nvme ssds. I noticed the device files had an extra number, beyond a number identifying the drive number and the partition number. IDE/SATA/SCSI drives normally only have a drive letter and partition number. For example: /dev/nvm

Read More ...


shebang or not shebang

I want to use a program in the shebang, so I create a script named with: #!<mypgm> I also want to be able to run directly from the command prompt. <mypgm> args... So far, no issue. I want to be able to run from the command prompt with arguments. <myscript> blabla

Read More ...


SCSI: SAN or local disk?

I have a Debian 9 running. It has a SSD connected as well as a fibrechannel link to a SAN storage. As far I see both are visible as /dev/sdX devices. How can I find out what is the disk and what is the storage? Where is the storage configured in the system? More convenient way is to use lsscsi util

Read More ...


Remove everything except csv file Bash Script

I would like to delete everything from a folder except csv files I am trying with a bash script and I am getting this error: syntax error near unexpected token `(' This is my script : PATH=/tmp/ run_spark_local rm -v !($PATH*.csv) cp -r $PATH /data/logs/ I have also t

Read More ...


I need to know how to get sound in Linux to do something specific

What I want is to separate two different applications' sound output from each other, and pipe that into a sound editing program. What I need is a way to add an entry in record that outputs into the playback tab. I need two of these. I'm not sure if there are alsa (plumbing) commands to make these tw

Read More ...


How to find out if there are files in a folder and exit accordingly (in KSH)

I have a KSH ( not Bash ) script that I want to preempt with a file count check. If there's no files I want to print "EMPTY" then exit. Otherwise proceed. The problem is when I perform the file count, and it is EMPTY, then it breaks. Code: ###################################################

Read More ...


How can I use OverlayFS to "combine" multiple storage into one? Is this possible?

I've been looking into using OverlayFS. I'd like to be able to combine a bunch of already formatted, already containing data, hard drives. All hard drives are formatted with ext4. The goal is to make it so I can use all the storage as one giant location. I currently make use of MergerFS so all the f

Read More ...


Expanding Drive Space in VMware for Linux use

I use Ubuntu Linux to develop applications, but usually have a Linux admin setup the final environment. I have a Linux box (via VMWare) that houses our application and Docker containers. That works and is great. We need to now expand the main drive / volume to be over 10 TB. Originally, for some rea

Read More ...