Date : September 25th, 2008Category : Apache, Experiences, Featured, Linux, Rocking, Web, code, javascript, perlAuthor : admin
Recently, I decided to migrate the work from Apache windows to the Apache running on my Vmware fedora machine. Everything was supposed to work like a charm. Unfortunately, it did not. The perl in the cgi-bin directory was throwing internal server error 500. The apache error log indicated ‘permission denied to create a socket’, ‘premature end of the script headers’. The stuff was supposed to be retrieved from postgres sql database by the perl thingy. It appeared to me that database server is not allowing my IP address to establish a connection, as recomended by pgadmin as well. After a successful entry of my IP in the conf file of postgres database server, problem still persisted. I tried almost everything, changing the file owner to apache, suexec in apache and hell lots of other possibilities. Then in the trial process I noticed a small pop up in the corner of the window, SELinux denial. SELinux is an enhanced feature in Linux, that can put restrictions on your applications in apache making database connection, nmap, access to network filesystem and lots and lots more. After giving apache persmission to make database connections, the error was resolved and application ran smoothly.
Date : September 16th, 2008Category : Cool, Experiences, Linux, Rocking, Truth, code, javascript, perlAuthor : Rakesh
I was exporting certain attributes viz roadname, ids, ways etc which were of alphanumeric type by appending them with a ‘+’ charachter from my server side perl program to the javascript program at the client. The firebug popped up, unterminated string literal, lets see whats that …. Googling did not turned out to be of much help. I tried making the string short, taking into an array etc. Sometimes it worked, sometimes it did not. Amazed, I came to a stupid conclusion on the size of the arguments that need to be passed. Perhaps, that was not the cause.On of my appended field was having a space, and string thereafter was considered as a different argument by javascript. Due to mismatch in the number of arguments for that js function, it was breaking. Such a silly mistake !!!
.
Hence, Vaccum kills us, space kills javascript or rather any function in any damn
language.
Date : June 1st, 2007Category : Cool, Crazy, code, perlAuthor : Rakesh
Last night, i had a situation. A download was running on my Windows Server 2003 machine. But i had to retire for the bed and shutdown the machine after two hours. The command line interface permits to shutdown machine till a maximum of ten minutes* delay only. Hence, i started surfing the web for some auto shutdown timer softwares. But apart from giving fancy multicolored buttons for reboot and standby, i got nothing useful. Then i came up with the following.
File – shutdown.pl
——————————————————————–
#! /usr/bin/perl
sleep(5400); # time in seconds after which you want to shutdown.Its 5400 seconds here or 90 minutes.
system(”shutdown /s /t 00″);
———————————————————————————–
Run the program as perl shutdown.pl
And my job was done. However there might be more smarter ways to handle the situation.
__________________________________________________________________________________
*type shutdown on windows server 2003 command prompt and read carefully