I downloaded CLion from Jetbrains, and it is a .tar.gz with a shell script to run it. I decided to put it in my /opt folder, but now I can’t figure out how to run it from anywhere, and have it available in /bin (for programs like dmenu that search /bin for executables). I tried adding the path to the
Tag: linux
python ctypes C++ get back char* missing last character on linux
i have the following C++ code: which is using ifreq to get the mac address of the local PC and sticks it into a array of chars. The routine gets compiled in the “Utility.so” Then i have the following python code: and i get the following result 02:00:AC:99:00:9 when my MAC is actually: 02:00:AC:99:…
Docker — mounting a volume not behaving like regular mount
I am new to docker so I am certain I am doing something wrong. I am also not a php developer but that shouldn’t matter in this case. I am using a drupal docker image which has data at the /var/www/html directory. I am attempting to overwrite this data with a drupal site from a local directory on the hos…
How to get logs of individual argument passed to shell script from a file
I have a shell script. In this script I am reading table names for a file and executing a command. The script is working fine. I am able execute the command for all the tables in the file. shell script In this script I want to collect status logs and stdout logs. I want to collect the logs for each
Print rectangles to terminal
I’m trying to write a text editor for Linux that looks like MS-DOS EDIT. However, I’m stuck because I can’t figure out how to draw the thin rectangles around the editor screen and dialog box. I know the Linux dialog command can do something similar: How can I draw rectangles like that around…
How do I find symbol offset in .so from runtime address
I need to be able to convert an instruction pointer (from a backtrace) into a file and line number after a program has terminated. During execution, I can store any additional information I will later require for this offline analysis, but the analysis does have to happen offline. Right now, I along with emit…
Manual scaling of axis (poltting with boxes) in gnuplot
I’m trying to plot a really long list, which represents frequency of some data. The x axis goes from 1 to 1881, and the y goes from 1 to 1978. I tried plotting with the following configurations: But i get the following result: Which is clearly not good because there are these intersections of the boxes.…
How to stop backspace from appearing in nCurses using C?
I am currently writing an ncurses shell and in order to read input it is important to read it character by character and hence I am using the mvwgetch command. And incrementing a counter as it reads character by character. The problem is that whenever I press a an arrow key or a backspace their output is bein…
How do I grep or sed in a continuous stream of characters?
I have a program that output some text and then a continuous stream of characters: I want to exit this program as soon as “A” is seen in the output and I tried: However, it seems like grep doesn’t see the “A”s until the perl program exits. I also tried with sed with no luck; Any …
Is using chdir() the only way to change the working directory in Linux C?
I have been given an assignment where I have to build a custom terminal using ncurses and C, and implementation of several commands is requested. One of the commands happens to be chdir, which is meant to change the working directory, however I could not find anything more relevant in C when it comes to chang…