Gautam's Blog

The technical blog of Gautam!

Browsing Posts in Development

I was working with gnu version of rmic. I noticed that when I compiled with it, it gave me java.lang.exception. I compiled it with Sun’s JDK and it did not throw an error.

Now, why would I get an exception while compiling? Exceptions by definition occur only during runtime. Vikram believes that there might be a problem with gnu’s implementation of Java specification.

Java

No comments

int is an primitive data type; an object. However, any object in java has .tostring() method as all objects need to implement toString method. An integer object is not an object in the strictest sense then as toString() does not exist. To get the string object, Interger.toString(int) is required.

So, is Java object oriented?

Gcc provides an option to increase the performance of your code. The optimization will increase the size of your code. I needed faster run time with the code that maintained 3 double linked lists. I had optimized the code by removing some obvious steps. When i used the options mentioned here, the speed increased quite a bit. The size of the executable was just 20 bytes more. I am willing to trade speed for that small increase.

One of my friends had suggested compiling the kernel with that option. He said, the system was faster. Hmm, gotta try that soon.

http://webdevelopment.developersnetwork.com/Articles.asp?Article=143

Perl for SysAdmin: http://builder.com.com/5100-6372-1044668.html

Network programming using Perl: http://www.metalshell.com/view/source/36/ [resolve a hostname into an ip address or an ip address into a hostname.]

Perl Tutorial

No comments

Following is an excellent Perl tutorial, keep referring to in times of need.

http://www.cs.cf.ac.uk/Dave/PERL/node1.html

Following is a way to use the crypt() command to be used in generating a password using the useradd method:

perl -e 'print crypt("password", "salt"),"\n"'


http://www.jeteye.com/jetpak/e251d8b0-3b33-1029-86c1-00304880af2f/

A server I had been monitoring had multiple installations of apache web server. The system had about 10-15 httpd.conf files. I needed to figure out the httpd.conf that was configured to start website a. Below is a shell script that I wrote at the command promt:

for i in `locate httpd.conf`; do grep -l a.com $i;done

perl -e ’s/string to be replaced/replaced string/g’ -p -i.bak

Powered by WordPress Web Design by SRS Solutions © 2012 Gautam's Blog Design by SRS Solutions