The following test is in CentOS 7.1. Create the following file test.service in /usr/lib/systemd/system/ and execute systemctl daemon-reload; systemctl restart test; systemctl status test -l There is no output of the value as the ${a} does not substitute as the word hello world, until it is changed echo ${a} i…
How to Obtain Youngest Child’s PID from task_struct
I’m working on a project that involves writing a new system call for Linux 3.18.20. This system call is supposed to store various information about the currently running process in a newly defined struct. One of the fields of the struct is the PID of the process’s youngest child, and I’ve be…
Inserting strings to file names with different extensions
I have a number of files of different type in a directory: file, file0, file.txt, file.jpg etc. Some with extensions, some without. I want to rename files in a directory by inserting ‘final’ to them. So they would appear as: filefinal, file0final, filefinal.txt, filefinal.jpg etc. I imagine that t…
Setup Jupyter inside Fusion’s CentOS 7
I am trying to install Jupyter inside CentOS 7 VM (that I already had) so I can access it via port 8888 at my host Mac laptop. However, I cannot figure out the networking piece. I am changing the IP address to 200.100.x.x for convenience From Host Machine I have 2 adapters for that CentOS VM $ ifconfig gives …
Why does “cd -” behave as it does?
What does cd – exactly do ? ( the change directory command, plus a dash ) I noticed that if I run it in my /home/user folder repeatedly it outputs either /home/user or /home, this changes if I run it from a different folder. Answer pop the last directory you were from the stack of directory. It’s …
mov edx overwrites cx register
I’m trying to print Hi 10 times. This is my code. gdb reports that mov edx, 3 overwrites the cx register to some crazy value and so the loop keeps going forever. What am i doing wrong? Is it because they are the same register? How does one program in assembly with so few registers? Compiling on centos w…
How do I write this in a batch file
I am trying to convert a shell script into a batch file but I am stuck at this place. I am not quite sure how to convert this line into my batch file. I tried but I am not sure if I am right! Answer You can’t do command chaining like this in Batch. If I see that correctly, you
strange output from g_print
I get the following error when I compile my code: file.h: In function ‘add_new_set’: file.h:7:53: warning: format not a string literal and no format arguments [-Wformat-security] g_print (gtk_entry_get_text ((GtkEntry *)((struct data *) callback_params)->entry)); here’s my code: now when …
Chef – using a for loop with SQLEOH
I have a bash resource which is failing when attempting to loop through some ddl scripts. The same syntax without a for loop (and literal script name) works fine in Chef, and it all works including with the for loop in a terminal: The errors I am getting indicate a problem with the SQLEOH delimiter and unexpe…
Oracle Service Bus maven build time 30 times slower on Linux than on Windows
I currently have a OSB project with a set of 21 modules that take roughly 4 minutes to build on my local 2 core/12GB ram laptop running Windows using no threading, just a simple build install. It takes 10-20 seconds per module. When building this exact same project on my CI server running on Ubuntu, with 8 co…