When I try to run mvn (Apache Maven, that is), I keep getting error “JAVA_HOME” not set. I follow the instructions to set the JAVA_HOME variable as follow; In the terminal: That looks correct, right? Then how come I still getting the incorrect JAVA_HOME error? Answer JAVA_HOME typically should onl…
Tag: linux
Tomcat 6 log4j – linux – safely remove catalina.out
Adding log4j [1] in tomcat 6.0.x forces tomcat to produce logs in “catalina” file. However, the default catalina.out is still produced and populated with logs. So, questions: Is it safe to delete catalina.out file (while server running)? If yes, could this deletion be added to tomcat startup scrip…
Find files and print only their parent directories
I have the following commands. Wherever the .user.log file is present, we need to print the parent directories (i.e hht and wee1.) How can this be done? Answer Am I missing something here. Surely all this regex and/or looping is not necessary, a one-liner will do the job. Also “for foo in $()” sol…
rsync over SSH preserve ownership only for www-data owned files
I am using rsync to replicate a web folder structure from a local server to a remote server. Both servers are ubuntu linux. I use the following command, and it works well: The usernames for the local system and the remote system are different. From what I have read it may not be possible to preserve all file …
Linux readw and readl endianness
May anyone please explain the endianness of returned values by readw and readl. I am currently using PowerPC arch. Thanks and Best Regards! Answer “readw” and “readl” return the value of the underlying architecture. As it happens, a PowerPC can be either big- or little endian. AFAIK, m…
Use grep to match a pattern in a line only once
I have this: Which gives this: I understand whats happening. How do I stop grep from trying to continue matching after 1 successful match? How do I get only Answer You need to do the grouping: (…) followed by the exact number of occurrence: {<n>} to do the job: Hope it helps. Cheers!!
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
I tried to restart my Apache server on CentOS 5.0 and got this message: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName Here is the /etc/hosts file: Here is the /etc/sysconfig/network file: I also have this in the Apache httpd.conf file: Howev…
Is there any profiler that works with -fomit-frame-pointer on x86_64?
SysProf doesn’t properly generate call stack without it, GProf isn’t accurate at all. And also, are profilers that work without -fno-omit-frame-pointer as accurate as those that rely on it? Answer There are none that I’m aware of. With frame pointers, walking a stack is a fairly simple exerc…
using electric fence in a c++ program
I’ve been experimenting with Electric Fence lately and I can’t figure out how to use it with c++ code. Here’s an example: I compiled it with And I don’t see Electric Fence banner at the start and can’t find EF symbols in the executable (using nm command). But if I modify a progra…