I have a flat file where I have multiple occurrences of strings that contains single quote, e.g. hari’s and leader’s. I want to replace all occurrences of the single quote with space, i.e. all occurences of hari’s to hari s all occurences of leader’s to leader s I tried and but they ar…
Tag: linux
How to print a number in ARM assembly?
I am trying to print a number that I have stored. I’m not sure if I am close or way off. Any help would be appreciated though. Here is my code: It compiles and runs, but I don’t see anything printed. From what I understand, I need the address of where to start printing in r1, how many bytes in
check if file is open with lsof
I’m using linux mint 13 xfce and I have a file named wv.gold that I’m trying to check in bash if it’s open by any program (for instance, I opened it in sublime-text and gedit) In many forums people say that if I run lsof | grep filename I should get 0 if it’s open or 256(1) if it’…
Apache httpd vs. Tomcat 7: port 80 vs. port 8080
I had recently installed Tomcat 7 on Amazon ec2. I found that Tomcat, by default, listens on port 8080. The documentation on the internet advocates that this is because linux is better saving the lower ports to the super user. (The solution on ec2 btw is creating a Load Balancer – directing the communic…
Ubuntu GTK+3 Eclipse Link
Is there any simple tutorial on linking gtk+3 libraries with eclipse indigo cdt on ubuntu platform? As I googled, I have been trying to use the pkg-config commands but still getting same result; the SDK cannot resolve gtk methods. I downloaded libgtk3-dev and gtk3 from synaptic properly. I included all the he…
Killing a screen without a specific session #
To create a screen, I am currently doing: That works perfectly, however killing it remotely with: Will reply with: This is due to the screen having {session#}.{screenname} It will work if done as: What solutions are possible? I’m not entirely sure that you can get the session# when you start the screen.…
fprintf, error: format not a string literal and no format arguments [-Werror=format-security
when I try to compile fprintf(stderr,Usage) on Ubuntu I got this error: but when I compiled that on other linux distributions (RedHat, Fedora, SUSE) that is compiled successfully. Anyone has an idea? Answer You should use fputs(Usage, stderr); There is no need to use fprintf if you arn’t doing formattin…
Grep time command output
Using time ls, I have the following output: Now, when I try to grep only the real value line, the actual result is: My question is, how to get only the real value as output? In this case, 0m0.040s. Answer time writes its output to stderr, so you need to pipe stderr instead of stdout. But it’s also impor…
Extract pointer to data from GPtrArray
I’m using GPtrArray structure to hold pointers to chunks of dynamically allocated memory. As I need as simple as possible and correct freeing of memory I set callback g_ptr_array_new_with_free_func () which will free one element of pointer array. Thus when I call g_ptr_array_free() for all elements of a…
How to make my Python module available system wide on Linux?
I made myself a little module which I happen to use quite a lot. Whenever I need it I simply copy it to the folder in which I want to use it. Since I am lazy I wanted to install it so that I can call it from anywhere, even the interactive prompt. So I read a bit about installing