As every module that is to be inserted in the kernel needs an __init function. where can I find the __init function of the original ext4 module written by linus torvalds? I want to make some changes in it. Answer I suppose you’re looking for this method : https://github.com/torvalds/linux/blob/master/fs…
Tag: linux
docker-compose up very slow but docker-compose run on linux very fast
As the title said. Docker-Compose is very slow while running a container. It keeps saying it’s trying to attach to… when i run “docker-compose up”. It takes about 10 minutes before the python script is running. On the other hand.. If I start “docker-compose run docker-build”…
Save only one string of multi-string command output
I’ve got a bash command to find the largest file in a sub-directory. I’d like to save the output to a variable to use it with other commands. bigile=$(find /path/to/directory -type f -exec du -Sh {} + | sort -rh | head -n 1) Unfortunately, this saves both the file size and the filepath. If I pass …
How to ensure a posix c socket is still valid
I,m working on an embedded linux kernel 2.6 device and need to know if previously established socket is still valid or not,Also I can not do this with usual send function and check the returned value,because if I send to the invalid socket descriptor,my application will crash and linux will shut down my proce…
free -g with sed -n plus nth character
I am trying to create a script to display just one of the numbers from the free command. In my case, the number I want is on the 2nd line of the free -g output and at character slot 43. The original output of free -g is: So far I have gotten the 2nd line to display with: I need
Node module ifx_db installation fails in linux
I am trying to install ifx_db (Node module to connect to informix DB). It is working fine in Windows but in Linux i am getting the following error. Request your inputs towards this Thanks in advance Answer FYI: The Informix node.js drive is depended on Informix Client SDK version 4.10 xC2 or above, that you n…
Tango with Django (v1.9/1.10) – Chapter 5, populate_rango issues
I will try to be concise. The background for this issue is that I’m familiar with Python, however I am BRAND NEW to django. This book is my first exposure to it and I’ve come to find the more I work through the book that online Q/A’s for django are not very general, thus making it harder to …
get pthread_t from thread id
I am unable to find a function to convert a thread id (pid_t) into a pthread_t which would allow me to call pthread_cancel() or pthread_kill(). Even if pthreads doesn’t provide one is there a Linux specific function? I don’t think such a function exists but I would be happy to be corrected. Backgr…
Group the consecutive numbers in shell
In shell, how to group the numbers in $foo as 1-3,6-8,11,13-17 Answer As an alternative, you can use this awk command: Now run it as: Here is an one-liner for doing the same: In this awk command we keep 2 variables: p for storing previous line’s number s for storing start of the range that need to be pr…
How know SSL fingerprint for some website using Linux CLI?
I’m trying update (using esp8266 microcontroller), update a DNS record hosted on DigitalOcean, using the API. How do I do to get HTTPS fingerprint using Linux CLI, for use on my code? Answer If you are using ESP (arduino IDE) library WiFiClientSecure.h, you need declare the “const” variable …