Author Archives: adrian

Install JDK on Windows 7

Download and install Java JDK in your computer. Set up the path in Windows 7 for use your JDK, the JDK contains the Java applications for run and compile java programs in a folder called “bin”. Go to control panel -> system -> advance system settings -> environment variables -> new in User Variables. The… Read More »

Using Eclipse SVN behind a proxy

If you want to use Eclipse SVN plugin under a proxy, “server” file must be configured. The file is located in %APPDATA%/Subversion. Uncomment the following lines: #http-proxy-host=proxy1.some-domain-name.com #http-proxy-port=80 #http-proxy-username=blah #http-proxy-password=doubleblah #http-timeout=60 Keep in mind that spaces are not allowed.

Returning Eval error code

eval { require “myfile.pl”; $txt.=&mysub(); }; &error_to_file(“My error: $@”) if $@; eval { require “myfile.pl”; $txt.=&mysub(); }; &error_to_file(“My error: $@”) if $@;

Turn on/off hibernation in Windows XP

1. Right-click on the desktop and click “Properties” 2. Hit the “Screen Saver” tab 3. Then click the “Power” button under “Monitor Power” 4. Click the “Hibernation” tab, then uncheck the box next to “Enable Hibernation” 5. Press “OK” and you have just saved a load of hard drive space!

Handle files in Perl

Read a file and put its content into one variable $line=””; open (FILE, “<“, “$public_html_dir/upload/promotii.html”); @lines=<FILE>; foreach $l (@lines){ $line.=$l; } close(FILE); $line=””; open (FILE, “<“, “file.html”); @lines=<FILE>; foreach $l (@lines){ $line.=$l; } close(FILE); Write to a file if($xEditor ne “”){ open (FILE, “>”, “file.html”); print FILE “$xEditor”; close (FILE); }

Using FCKEditor in Perl

If you want to use FCK Editor in Perl you must insert the following lines: require “$serverfck/fckeditor.pl”; &FCKeditor(‘xEditor’); $BasePath=$fck_s_path; $Value=”$line”; $Width = $FckWidth; $Height = $FckHeight; &Create(); require “$serverfck/fckeditor.pl”; &FCKeditor(‘xEditor’); $BasePath=$fck_s_path; $Value=”$line”; $Width = $FckWidth; $Height = $FckHeight; &Create();

Write cookies with Apache

If you want to write cookies with Apache, you must use mod_headers. After this you can set cookies from every conf file: Header append set-cookie: “MyCookie=myValue; path=/;”