Tips & Tricks : MediaWiki 1.25.1 and VisualEditor


In case you want to deploy MediaWiki 1.25.1 with VisualEditor use following components:

Configuration details for LocalSettings.php for these components can be found here:

When you download VisualEditor from Git repository installation with MediaWiki 1.25.1 is more likely to fail.


Cheat Sheet : SCO Vi Quick Reference Guide


I just found vi reference from Santa Cruz Operation (SCO) 🙂 Nice piece of memorabilia as well as handy reference for vi beginners.


Tips & Tricks : Using EPEL with CentOS


If you use CentOS and want to add some extra packages you can use EPEL.

Extra Packages for Enterprise Linux is project created by Fedora.

In order to use repositories on CentOS first download and install RPM appropriate for your version of CentOS from here:

Method 1


Then install it and enjoy more packages from new repo.


Method 2

[root@localhost ~]# yum install epel-release

Here is example from CenOS 7 how to add EPEL repositories:



How-To : openSUSE & keepalived for Firewall HA


Current expectations from all type of systems and services is to be available without any disruption. One of mission critical systems is gateway/firewall. Of course you can use multiple products available on the market. One of them is openSUSE, which is perfect to act as gateway/firewall between Internet and production systems. So, how to provide redundancy for openSUSE and same time be able to keep it up-to-date without any disruption for production systems?

openSUSE 13.2 with keepalived provides all technology required to make your firewall high-available.

Here is diagram of Lab created to configure and test openSUSE with keepalived:



Code snippet : Sending email from PowerShell script


If you want to send email from PowerShell script via Google Mail:

$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
$SMTPUsername = "sender@gmail.com"
$SMTPPassword = "password"

$EmailSenderAddress = New-Object System.Net.Mail.MailAddress("sender@gmail.com", "PowerShell Automated Email")

$EmailFrom = $EmailSenderAddress
$EmailTo = "recipient@gmail.com"
$EmailCc = "recipient@hotmail.com"
$EmailAttachment = "C:\Scripts\Attachment.txt"
$EmailSubject = "Automated Email with Report."
$EmailBody = @"
Please find attached report.

$EmailMessage = New-Object System.Net.Mail.MailMessage
$EmailMessage.Subject = $EmailSubject
$EmailMessage.Body = $EmailBody
$EmailMessage.From = $SMTPUsername

$SMTPSession = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
$SMTPSession.EnableSSL = $true
$SMTPSession.Credentials = New-Object System.Net.NetworkCredential($SMTPUsername, $SMTPPassword);
Write-Host "Mail Sent"

Code snippets : Encrypted password in PowerShell


Many times there is a need to store password in PowerShell script. Unfortunately to leave password in script is insecure solution and might cause an issue.

So, what to do if there is a need to have password in a script and we don’t want to have it embedded in clear-text in script?

Best way is to encrypt it and store in the file and then re-use it when required.

Create file with encrypted password

$secureString = Read-Host -AsSecureString "Enter a secret password"
$secureString | ConvertFrom-SecureString | Out-File C:\Scripts\storedPassword.txt

Use encrypted password in script

$secureString = Get-Content -Path C:\Scripts\storedPassword.txt | ConvertTo-SecureString
Remember that password has to be encrypted on the account which will be running the script. So, in case you plat to use Task Scheduler to run PowerShell script, start PowerShell windows as particular user and then create file with encrypted password.

Tips & Tricks : Install Node.js on Debian 7.0 “Wheezy”


As on Debian 7.0 Node.js is not included in standard repositories, if you want to install it login to server as a root and issue following commands:

apt-get install curl
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs

How-To : Autostart Parsoid on openSUSE 13.1


Once Parsoid is installed on openSUSE it might be handy to have is started automatically once system is restarted.

First we have to create startup script.



# description: Node.js /srv/parsoid/api/server.js

. /etc/rc.status






if [ ! -f "$LOCK_FILE" ] ; then
echo -n $"Starting $SERVER: "
runuser -l "$USER" -c "$DAEMON $SERVER -n $WORKERS_NUMBER >> $LOG_FILE &" && echo || echo
[ $RETVAL -eq 0 ] && touch $LOCK_FILE
echo "$SERVER is locked."
echo -n $"Stopping $SERVER: "
pid=`ps -aefw | grep "$DAEMON $SERVER" | grep -v " grep " | awk '{print $2}'`
kill -9 $pid > /dev/null 2>&1 && echo || echo
[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE

case "$1" in
echo "Usage: $0 {start|stop|restart}"

exit $RETVAL
Remember to adjust all paths and number of worker processes accordingly to your installation.

Once startup script is in place we have to enable Parsoid to be automatically started:

chkconfig parsoid on

From now on Parsoid will be automatically started after each restart.


Tips & Tricks : Apache2 autostart on openSUSE 13.1


In order to have Apache2 started automatically after reboot use:

systemctl enable apache2.service


How-To : Deploy VisualEditor extension for MediaWiki 1.24.2 on openSUSE 13.1 x64


In previous article I described how-to Deploy Parsoid on openSUSE 13.1 (which turns out to be quite a challenging task). Parsoid is component required for VisualEditor. Now it’s time for VisualEditor deployment.

Downloading VisualEditor

At the moment, when I’m doing deployment, stable version of MediaWiki is 1.24.2. VisualEditor is an extension written for certain version of MediaWiki, hence we can’t just download latest version and use it. It has to be specific release for specific MediaWiki version.

So, first we download VisualEditor for MediaWiki 1.24.2:

git clone -b REL1_24 https://github.com/wikimedia/mediawiki-extensions-VisualEditor.git
cd mediawiki-extensions-VisualEditor/
git submodule update --init

Once it’s done we need to place content of mediawiki-extensions-VisualEditor in extensions/VisualEditor folder under MediaWiki folder structure.

Finally, once we have all files in proper places it’s time to inform MediaWiki about VisualEditor.

Changes to LocalSettings.php

Changes which have to be applied to LocalSettings.php:

# VISUAL Editor
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVisualEditorParsoidURL = 'http://localhost:8000';
$wgVisualEditorParsoidPrefix = 'localhost';
Remember to adjust Parsoid URL and Prefix accordingly to setup of your Parsoid service.

From now on you can enjoy VisualEditor until you decide to upgrade to newer version of MediaWiki.
Prior to that I would suggest to check if there is VisualEditor available for new release and test it prior to live deployments.

Page 4 of 17« First...23456...10...Last »