I have a webservice running on a remote machine available to me through ssh tunneling. Therefore I will be able to access the webservice through http://[local machine ip]:8888. But the problem here is, My source code trying to access the webservice through the public ip (http://[remote server ip]:7777). So I …
getting current directory in linux for argument
I’m learning Linux scripting and trying to set up a function that finds all files in the current directory. I know I could use ls but I’m wondering if there is a way to get the current directory as a command and pass it to an argument. This just prints out pwd:, which obviously isn’t it. Ans…
How do I replace single quotes with another character in sed?
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…
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…