Saturday, October 5, 2013

Thunderbird backup and restore

I have been using Thunderbird as a mail client for a while now. Have been also not-so-regularly backing up the mail profile. Found out recently how convenient Thunderbird makes it to backup and restore mail, contacts & even calendar.
I will not go details of how to restore the profile, mails and contacts because there is tons of help available on:
MozillaZine
Thunderbird Help

But in short, the mail folders, contacts, preferences, calendar data are simple, and mostly single, data files that can be easily replaced and Thunderbird will happily recognize and use them when it starts. Oh, you have to remember to close any open Thunderbird session before replacing files physically.

Another useful program to remember is "thunderbird.exe -ProfileManager" which you can run from Windows start menu > Run... option. It lets you manage & switch between multiple profiles.

Thank you Mozilla for a great product! And who says there is no free lunch?? :-)

Thursday, May 16, 2013

Joomla installation hangs during Configuration

If you are installing Joomla 2.5.6 on IIS (I have 5.1 on WinXP), there is a strong possibility that the installation may get stuck during the Configuration stage. Chances are the folder in which you are trying to install is NOT shared & writeable. Go to Windows Explorer and make the folder Shared & Writeable. Then try the configuration stage again and it should go through.

Monday, April 8, 2013

WordPress: Remove link from author name in Recent comments



In the Recent comments section, the author name is linked to his/her website while the actual comment title is linked to the comment page. Lot of times, site visitors click on the author name instead of comment title - thinking THAT is the comment link. They end up on the author's website instead.
So we decided to de-link (or unlink) the author name. Here's what we did:

1. We changed 2 files in the wp-includes folder: default-widgets.php and comment-template.php

2. In comment-template file, we made a copy of the function: get_comment_author_link, and pasted it as a new function: get_comment_author_name. The new function has following code:

function get_comment_author_name( $comment_ID = 0 ) {
$author = get_comment_author($comment_ID);

$return = $author;
return apply_filters('get_comment_author_link', $return);
}

3. In default-widgets file, we located the function widget() and replaced the get_comment_author_link call with get_comment_author_name as below:

foreach ( (array) $comments as $comment)
 {
$output .=  '
  • ' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_name(), '' . get_the_title($comment->comment_post_ID) . '') . '
  • ';

    }

    4. That's it. We uploaded the changed files and the author names did not have links any more.


    Tuesday, February 5, 2013

    Restoring Joomla 1.5 site from hack

    One of our clients got their Joomla 1.5 site hacked. The site started giving PHP errors. When they upgraded PHP, the home page was restored but all other pages were leading to "Page not found" message. After a couple of days of effort, we were able to restore the website. Here are the findings:

    Signature images found
    "hacked by Hmei7" logo image (Indonesian Hacker) and sejeal.jpg

    Suspicious files found in the listed locations
    /images/stories/susu.php
    /images/stories/0day.php
    /images/x.txt
    /tmp/x.txt
    /tmp/m.txt
    /tmp/zzzzx.php

    Original files modified during the attack
    /.htaccess (most important)
    /configuration.php
    /index.php
    /index.html

    Here is a list of some other files that may be found in the folders. Their locations are random though!
    susu.php, x.txt, 000-aaz.gif, 0day.php, c99.php, config.root, css.php, en-gt.php, index.old.php, lib.php, maroc.php, r57.php, rc.php, story.php, tar.tmp, toy.php, web1.php, wh.php, Wos.php, xxu.php, xxx.php, s.php, user.pl, 404.php, cpanelhorde5.txt

    How we restored the site
    1. Created a PHP script to automate the task of locating the suspicious files (see list above).
    2. Removed all the suspicious files.
    3. Checked configuration.php, index.php, index.html, css.php and .htaccess to see if they were modified. In our case, configuration file was modified, so we checked each and every variable value and changed the incorrect ones. We also restored the .htaccess from another installation and modified it so that SEF URLs were working again.
    4. If configuration.php and index.php file are changed then best way is to delete and restore them from backup. Or check inside configuration.php for the values of $host, $db, $user, $dbprefix, $log_path, $tmp_path, $offline, $password variables. If the values are not correct, then modify them with help from your hosting provider.
    5. If '/.htaccess' is modified, then delete and restore it from backup. Do not try to edit this file because small changes in .htaccess can badly affect your website. If the file was not backed up, you can use this file from another Joomla installation but the exact same version.

    Not all files will be affected on every site and there may be more files affected than in this list. Only those files with write permission will be changed by the hacker's script.

    Simple ways to making your Joomla site hackproof
    --Regularly upgrade to latest Joomla version
    --Take regular backups
        --Zip up the entire Joomla folder
        --Export Joomla DB as a zip file
        --Store both zips offline (preferably in 2 places) and also online, but outside public_html folder

    Saturday, September 15, 2012

    Problem in saving translation in FaLang

    Problem: While creating multilingual pages in Joomla 2.5 using FaLang extension, translated matter is not saved or displayed on the page. Sometimes you can use an alternative browser and save the text, but this is not consistent.

    Solution: This is really a workaround rather than a solution.

    1. On the control panel of FaLang, click on Translation. Here you will see all the articles to be translated. By default all the articles go into 'Translation incomplete' state, indicated by a yellow bulb icon and into 'Published' mode.
    2. Use the appropriate filters to view articles. (Select: Language, Select: Content elements)
    3. Open the article. You need to 'Un-publish' it and change 'State' to 'Translation not existing '. You can do this in the tab named- 'Publishing' which appears at the top right side of the page.
    4. Save the article and close the file.
    5. Open the file again. Edit the Publishing tab. Select language, Click on 'Published' – checkbox. In the left section of the page there are blank form fields for Title and Alias. Write Translation of Title and Alias. Go to field: Article Text. Paste your translated content.
    6. Save the file.
    Now the translation will be saved and you should see it in your Joomla pages!

    Saturday, June 13, 2009

    PHP mail() returns False on website hosted at Yahoo

    Noticed this problem when I used my favorite form2mail script on a website hosted at Yahoo. (small business hosting). The mail function was always returning False. After debugging the problem I reached the conclusion that it was something in the additional_headers argument that was causing the error. If I removed that argument, the mail function would work.

    Then I came across this Yahoo article which explains why I was getting the problem.

    Yahoo correctly tries to enforce that the From: address in the header is set to an email address within YOUR DOMAIN only. So for example, if your website is www.foodoo.com, then the From: address must be something like info@foodoo.com. It cannot be info@somethingelse.com because doing that will allow spammers to misuse it!

    Friday, October 3, 2008

    Setup was unable to open information file

    I had SP3 installed on my PC. But there was no SP3 CD. So had some trouble installing IIS and other win components. So I obtained a SP3 EXE. It took half an hour to install, but it installed without errors.

    When I went to add/remove components to install IIS, I got the error:

    Setup was unable to open information file fp40ext.inf

    This was followed by some 'error 0x2'. Looked up on the net and found some good pointers.

    fp40ext.inf is a FrontPage extension info file. It was missing from the C:\Windows\inf folder. I copied it to this folder from C:\ServicePackFiles\i386 folder. Then I got the error fp40ext.dll was not found. Copied this file too from ServicePackFiles to the c:\windows\system32 folder. Then I got the error about missing pinball*.inf file. Taking cue from a website, I opened the sysoc.inf file and commented the line for pinball, using ';' character. Also commented the line for msnmsn (the next error source).

    After this, the add/remove component dialog box opened, I was able to install IIS (except for the file admxprox.dll which I got from Xp-SP2 CD) successfully.