Tuesday, February 9, 2016

How to install the Perl module Data::Dumper on Linux - RHEL, CentOS or Amazon AMI?

Below is an error message that could get thrown while installing any Bitnami package (say Bitnami Mediawiki package) on a Linux

Error: Error running /opt/app_name/mysql/scripts/myscript.sh 
/opt/app_name/mysql ****: FATAL ERROR: please install the following 
Perl modules before executing scripts/mysql_install_db:

Data::Dumper

The error states that you have install the Perl Module Data::Dumper. Run the below command :
yum install "perl(Data::Dumper)"

Follow through the rest of the instructions on the command line to complete the installation. 

Sunday, February 7, 2016

How to hide or remove the View History tab on Mediawiki

Below are the steps to remove/disable/hide the View History tab on Mediawiki. This works as of early 2016 on Mediawiki 1.26x. Hope it helps!
  1. Login to your apps/mediawiki/htdocs directory. This is the directory which contains the LocalSettings.php file.
  2. Edit the LocalSettings.php file (open in text editor).  Add (append) the following lines
#====Begin : code to hide/remove View Source tab from Mediawiki====
function efAddSkinStyles(OutputPage &$out, Skin &$skin) {
    if(!$skin->getUser()->isLoggedIn()) {
        if ($skin->getSkinName() == 'vector') {
            $out->addInlineStyle('#ca-history { display:none; }');
        }
    } else {
        if ($skin->getSkinName() == 'vector') {
            $out->addInlineStyle('#ca-view { display:none; }');
        }
    }

    return true;
}


$wgHooks['BeforePageDisplay'][] = 'efAddSkinStyles'; 
#====End of code====