We are using the standard pattern of registering custom signal handler for SIGSEGV with sigaction and then when segmentation fault occurs using the backtrace function to walk the stack and print it to some file. It is nice feature to have the backtrace in logs but it disables the OS writing the full dump of the crashed program which is
How to add 2 numbers together that are of different lengths in x86 linux nasm assembly
I’m very new to assembly and having difficulties in getting basic calculations to work with different length numbers. So this is my adding code, that works with numbers that are 3 or less characters long. for as long as both are the same length. for example 123 + 123 works just fine and outputs 246. But 12 + 123 does
How to Group By within Object in jq
I have this JSON Object And I want an output like this How do I achieve this with bash script and jq? This seems to be like a group by functionality, but I’m unable to figure it out. Answer Here’s a solution using jq’s –stream option:
struct is it declaration or defination or some type of Object Oriented behavior in kernel source
In r8169_main.c in linux kernel source there is a struct like this I like to in first member .name but there is no data type specified and there is . before name like .name = KBUILD_MODNAME, what is it called. is this name member defined somewhere else what this static struct means I did not seen this type of struct
can multiple scripts use inotifywait to watch the same file simultaneously?
Is there anything about the nature of inotify’s inotifywait that would result in unpredictable behavior (or predictable problems) when running two or more scripts that each uses inotifywait to watch the same file or set of files? Or is it safe/ok, technically, to have multiple scripts using inotifywait on the same files? Answer Yes, it is safe. inotify is a
Crontab skip run once a week
I have a CRON expression that will run a given command every 8 hours, beginning at 00:00. This will run a given commend 21 times a week, however, my goal is to skip one of these 21 runs on a weekly basis. What is the proper CRON expression to skip the first run on Sunday each week at 00:00 (in
Open tabs in Windows Terminal w/ Ubuntu WSL & Zsh
I’m writing a script to run on UBUNTU WSL in Windows. I use zsh as my shell, but bash could work too here. I’d like that bash script to use wt.exe (Windows Terminal) to open some new tabs. Here’s what I have so far: You’ll need Windows 10 w/ Ubuntu WSL and Windows Terminal for that to work. This bash
Run interactive Bash in dumb terminal using Python subprocess.Popen and pty
This question is similar to Run interactive Bash with popen and a dedicated TTY Python, except that I want to run Bash in a “dumb” terminal (TERM=dumb), and without putting the tty into raw mode. The code below is my attempt. The code is similar to the solution given in the linked question, with the major difference that it does
SeedLabs Firewall Lab: Implement a Simple Kernel Module, failure to build a kernel module
I’m following the steps from here at 3.1 Task 1.A: Implement a Simple Kernel Module: https://seedsecuritylabs.org/Labs_20.04/Files/Firewall/Firewall.pdf Everything was fine until I ran the make command. the hello.ko file wasn’t generated and I don’t know what’s wrong. Answer You must add the license in hello.c. e.g.
Using awk to make changes to nth character in nth line in a file
I have written an awk command awk ‘NR==5 {sub(substr($1,14,1),(substr($1,14,1) + 1)); print “test.py”}’ > test.py This is trying to change the 14th character on the 5th line of a python file. For some reason this doesn’t stop executing and I have to break it. It also deletes the contents of the file. Sample input: ` Output: Answer Get away from