On a Linux system, I need to create a large file (about 10GB), uncompressible file. This file is supposed to reside in a Docker image, needed to test performance in transferring and storing large docker images on a local registry. Therefore, I need the image to be “intrinsically” large (that is: u…
Tag: linux
How to check if my input file is valid and existed in Javascript?
I am getting strings from a text file in Javascript. I just want to show a message whenever the user enters the wrong file name or invalid file name. like this: console.log(“You input is invalid”); My code to read my text file and transfer the data to my variable is as follow: I don’t know h…
Determining filesystem for block device if module not loaded
I’ve been wondering this for a while now. When using Linux and plugging in an e.g. USB stick or external storage device via USB, how does the kernel determine which filesystem is on that device, if the correct module is not currently loaded in memory? Assume that the external storage device is ext4 form…
How to use system() in a kernel module as stdlib.h cannot be used in a kernel program?
When developing a kernel module in Linux, using the C standard library isn’t allowed. However, in case I need to use some common functionality like system(), how do I implement this? Answer The answer is: you don’t. There are very, very few instances in which you would need to do something similar…
ldapsearch get a list of users (samAccountName) in a specific AD group
So what I am trying to do is get myself a list of the AD users who belong to a specific group using ldapsearch. I attempted using “memberOf=GROUP_NAME”, but still not filtering based on that and I always get all users in the AD, here is my code: Any ideas what I am doing wrong here? Why isn’…
Race condition on pthread_kill()?
Linux manual for pthread_kill() has the following paragraph: POSIX.1-2008 recommends that if an implementation detects the use of a thread ID after the end of its lifetime, pthread_kill() should return the error ESRCH. The glibc implementation returns this error in the cases where an invalid thread ID can be …
Finding the number of bytes of entered string at runtime
I’m new at learning assembly x86. I have written a program that asks the user to enter a number and then checks if it’s even or odd and then print a message to display this information. The code works fine but it has one problem. It only works for 1 digit numbers: It does not work properly for num…
grep -r –include not works but –exclude works
In bash, What’s the problem? Answer You are using curly braces incorrectly. The correct syntax would look like (Notice also the addition of the missing file name argument . at the end.) You can see what’s going wrong by putting an echo in front and examining what the shell expands the braces to.
Creating a symbolic in shared volume of docker and accessing it in host machine
I am creating a symbolic link in mounted volume of a host machine inside a docker. But I am unable to access it in host machine. Is it possible to do it. If yes how can I do that. I used the following command to mount directory Then I created a symbolic link using Now when I am trying to
How to connect to SQLPLUS and run SQL script within ssh unix?
I have the following bash script: Now, I want to run te following sql script (which is on the other device I’m accessing): How is the best practice to run the script from that path? I’ve seen a suggestion to add “/usr/mikael/myfile.sql” to the end of the command, as : Is that really go…