I’m trying to compile a fairly basic program under Linux and I’m having trouble with ld86. Anyone have an idea as to what auto_start is? UPDATE 3/12/2012: Seems to go away when I define my own printf()… Answer Huzzah! I have found it. When calling main() in main.c I was using parameters like…
How to automatically snapshot a volume of an Amazon EC2 instance?
I’m trying a script to backup a volume automatically. I follow this EBS-Snapshot.sh script as found on github: I have the two files for X509 authentication, the instance ID but I don’t understand the script and how to parameterise the volume that I want to backup. I don’t understand the firs…
JAVA_HOME incorrectly set. How to reset it?
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…
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…