Skip to content

Bash Brace Expansion in Systemd ExecStart

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…

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…