The FLVPlayerTwo extension doesn’t work with versions of MediaWiki later than 1.18. The extension makes use of the PHP IMAGE class and apparently this class has been removed from newer versions of MediaWiki. Administrators of newer versions of MediaWiki are therefore stuck if they wish to integrate this extension. However there is a workaround to make it function correctly. Follow the steps below and you should have .flv videos running on your wiki.

  1. Download the latest code of the FLVPlayerTwo code from the MediaWiki site.
  2. Save the code in a file named FLVPlayerTwo.php in a new directory ‘FLVPlayerTwo’ located in the extensions directory of your MediaWiki installation.
  3.  Add the following line to the end of your LocalSettings.php file.
    require_once( “$IP/extensions/FLVPlayerTwo/FLVPlayerTwo.php” );
  4. Download the latest version of Flowplayer flash from the Flowplayer site
  5. Extract the contents of downloaded file in the FLVPlayerTwo directory located in the extensions directory of your MediaWiki installation.
  6. Make sure the FLVPlayerTwo directory along with all its contents are owned by the user running your web server.
  7. Edit the FLVPlayerTwo.php file and replace the following line
    $img = new Image($title);

    with
    $this->repo = RepoGroup::singleton()->getLocalRepo();
    $img = LocalFile::newFromTitle( $title, $this->repo );

You can now use the extension using the following syntax:

<flvplayertwo width=”320″ height=”240″ autoPlay=”true” autoBuffering=”true”>File:myFile.flv</flvplayertwo>

 

Graph Databases

Posted: February 5, 2013 in NOSQL
Tags: , , ,

A very nice article on Graph databases by Emil Eifrem. Worth reading…

Today I came into the error ORA-00845: MEMORY_TARGET not supported on this system when setting the parameter MEMORY_TARGET on an Oracle 11.2.0.1.0 instance.

SQL> alter system set memory_target=9G scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

The solution is to make sure that you have /dev/shm mounted under shmfs. The size should be greater or equal to the size you set MEMORY_TARGET to.

as root:
mount -t tmpfs shmfs -o size=9216m /dev/shm

SQL> startup
ORACLE instance started.

Total System Global Area 9620525056 bytes
Fixed Size 2215704 bytes
Variable Size 4966056168 bytes
Database Buffers 4630511616 bytes
Redo Buffers 21741568 bytes
Database mounted.
Database opened.

Make sure to make an entry in your /etc/fstab to make the changes persistent across reboots.
The entry should be like:
shmfs /dev/shm tmpfs size=9216m 0 0

When installing Oracle 11gR2 (11.2.0.1) on Centos Linux 6.2 64-bit, the Oracle installer will fail the package verification for the x86 packages, even if the required packages have been installed. This is because the installer cannot verify the newer versions of the packages. You can safely ignore the errors and continue with the installation.

In this post I am going to show how to setup automatic Link Failover using Cisco IP SLA (Service Level Agreement). In this configuration, the primary and backup Links are from two separate providers. Router R1 at Site A tracks the interface fa0/1 of router R5 and Router R4 at Site B tracks the interface fa0/1 of Router R2. In the event a tracked interfaces is not reachable, the communication automatically fails over to the Backup Link. Communication automatically fails back to the Primary Link when the tracked interfaces are both reachable.

Site Topology

Configuration Router R1

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
ip sla monitor 10
type echo protocol ipIcmpEcho 10.100.12.2 source-ipaddr 10.100.11.1
timeout 1000
threshold 2
frequency 3
ip sla monitor schedule 10 life forever start-time now
!
!
track 10 rtr 10 reachability
!
!
interface FastEthernet0/0
ip address 10.100.10.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/1
no ip address
shutdown
speed 100
full-duplex
!
interface FastEthernet1/0
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/1
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface Vlan1
no ip address
!
interface Vlan20
ip address 10.100.11.1 255.255.255.248
!
ip local policy route-map SLA-POLICY-DEFAULT
ip classless
ip route 10.100.12.0 255.255.255.248 10.100.11.2 track 10
ip route 10.100.13.0 255.255.255.0 10.100.11.2 track 10
!
!
no ip http server
no ip http secure-server
!
access-list 101 permit ip 10.100.0.0 0.0.255.255 10.100.12.0 0.0.0.255
access-list 102 permit ip 10.100.0.0 0.0.255.255 10.100.13.0 0.0.0.255
!
route-map SLA-POLICY-DEFAULT permit 10
match ip address 101
set ip next-hop verify-availability 10.100.11.2 1 track 10
set ip next-hop 10.100.11.3
!
route-map SLA-POLICY-DEFAULT permit 20
match ip address 102
set ip next-hop verify-availability 10.100.11.2 2 track 10
set ip next-hop 10.100.11.3
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

Configuration Router R2

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
!
!
interface FastEthernet0/0
ip address 172.200.100.1 255.255.255.248
speed 100
full-duplex
!
interface FastEthernet0/1
ip address 10.100.11.2 255.255.255.248
speed 100
full-duplex
!
router rip
version 2
network 10.0.0.0
network 172.200.0.0
no auto-summary
!
ip classless
ip route 10.100.10.0 255.255.255.0 10.100.11.1
ip route 10.100.13.0 255.255.255.0 172.200.100.2
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

Configuration Router R3 

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
!
!
interface FastEthernet0/0
ip address 172.200.200.1 255.255.255.248
speed 100
full-duplex
!
interface FastEthernet0/1
ip address 10.100.11.3 255.255.255.248
speed 100
full-duplex
!
ip classless
ip route 10.100.10.0 255.255.255.248 10.100.11.1
ip route 10.100.12.0 255.255.255.248 172.200.200.2
ip route 10.100.13.0 255.255.255.0 172.200.200.2
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

Configuration Router R4

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
ip sla monitor 10
type echo protocol ipIcmpEcho 10.100.11.2 source-ipaddr 10.100.12.1
timeout 1000
threshold 2
frequency 3
ip sla monitor schedule 10 life forever start-time now
!
!
track 10 rtr 10 reachability
!
!
interface FastEthernet0/0
ip address 10.100.13.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/1
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface Vlan1
no ip address
!
interface Vlan20
ip address 10.100.12.1 255.255.255.248
!
ip local policy route-map SLA-POLICY-DEFAULT
ip classless
ip route 10.100.11.0 255.255.255.248 10.100.12.2 track 10
ip route 10.100.10.0 255.255.255.0 10.100.12.2 track 10
!
!
no ip http server
no ip http secure-server
!
access-list 110 permit ip 10.100.0.0 0.0.255.255 10.100.11.0 0.0.0.255
access-list 120 permit ip 10.100.0.0 0.0.255.255 10.100.10.0 0.0.0.255
!
route-map SLA-POLICY-DEFAULT permit 10
match ip address 110
set ip next-hop verify-availability 10.100.12.2 1 track 10
set ip next-hop 10.100.12.3
!
route-map SLA-POLICY-DEFAULT permit 20
match ip address 120
set ip next-hop verify-availability 10.100.12.2 2 track 10
set ip next-hop 10.100.12.3
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

Configuration Router R5 

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
!
!
interface FastEthernet0/0
ip address 172.200.100.2 255.255.255.248
speed 100
full-duplex
!
interface FastEthernet0/1
ip address 10.100.12.2 255.255.255.248
speed 100
full-duplex
!
router rip
version 2
network 10.0.0.0
network 172.200.0.0
no auto-summary
!
ip classless
ip route 10.100.10.0 255.255.255.0 172.200.100.1
ip route 10.100.13.0 255.255.255.0 10.100.12.1
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

Configuration Router R6

!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R6
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
no ip domain lookup
!
!
interface FastEthernet0/0
ip address 172.200.200.2 255.255.255.248
speed 100
full-duplex
!
interface FastEthernet0/1
ip address 10.100.12.3 255.255.255.248
speed 100
full-duplex
!
ip classless
ip route 10.100.10.0 255.255.255.0 172.200.200.1
ip route 10.100.11.0 255.255.255.248 172.200.200.1
ip route 10.100.13.0 255.255.255.0 10.100.12.1
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end

MySQL Backup Script

Posted: June 22, 2012 in MySQL

The script has been written in bash, and has been tested on Centos Linux 5.x only. It can be run in two modes; either a full backup or specific databases backup. When using the database mode, the script checks the engines with which the tables in the database have been built. If tables of type MyISAM are present, a backup with the –lock-all-tables is performed. In the event, only tables of type Innodb exist, the backup is performed with the –single-transaction option. The script can be downloaded from launchpad  and is also available from github

Configuring Oracle Enterprise Manager on Oracle 11g through command ’emctl -config dbcontrol db -repos create’ may sometimes lead to error ORA-01921

Go through the following steps to resolve this issue.

  1. In sqlplus :
    drop user sysman cascade;
    drop public synonym SETEMVIEWUSERCONTEXT;
    drop role MGMT_USER;
    drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
    drop user MGMT_VIEW;
  2. emca -deconfig dbcontrol db
    emca -config dbcontrol db -repos create

We’ll I know it’s been a while since I posted something here, but the mood wasn’t really there…
You might have been in the situation where you went on Dell’s support website to download some drivers or utilities for your notebook and you were asked for the Service Tag. The first thing that you might have thought about at this time is to topple your notebook to look for the Service Tag underneath. we’ll no need for that, you can obtain it from the command line:

On Linux —
dmidecode -s system-serial-number

On Windows —
wmic bios get serialnumber

It’s always handy to have a script to create the reverse lookup records from a forward lookup zone file. So here its goes…

#!/bin/sh
#@Author Daysen — daysenv@gmail.com

#———–
>rev

cp /var/lib/named/master/de.daysen.com.hosts fwd
sed -e ‘/^;/d’ fwd | sed -e ‘/^$/d’ > f1

while read line
do
RD_=`echo $line | awk ‘{print $3}’`
IN_=`echo $line | awk ‘{print $2}’`

if [ “$IN_” = “IN” ] && [ “$RD_” != “SOA” ]
then

if [ “$RD_” != “SRV” ]
then
if [ “$RD_” = “CNAME” ] || [ “$RD_” = “NS” ]
then
CN_=`echo $line | awk ‘{print $4}’`
if [ “$RD_” = “NS” ]
then
c=`nslookup $CN_ | grep -v “127.0.0.1” | grep “Address” | awk ‘{print $2}’ | awk -F . ‘{print $2″.”$1}’`
a=”$c.in-addr.arpa. IN NS     “
b=`echo $line | awk ‘{print $4}’`
else

c=`nslookup $CN_ | grep -v “127.0.0.1” | grep “Address” | awk ‘{print $2}’`
a=`echo $c | awk -F . ‘{print $4″.”$3″.”$2″.”$1″.in-addr.arpa.        IN        PTR     “}’`
b=`echo $line | awk ‘{print $1}’`
fi
else

c=`echo $line | awk ‘{print $4}’`
a=`echo $c | awk -F . ‘{print $4″.”$3″.”$2″.”$1″.in-addr.arpa.        IN        PTR     “}’`
b=`echo $line | awk ‘{print $1}’`
fi

echo $a”        “$b >> rev
sort -k3,4 rev > f2
mv f2 rev
fi
fi

done < f1

rm -f f1

Virtualbox uses a NAT network connection by default. So initiating an SSH connection to the guest machine from either the host machine or any other box is impossible. A work around for this is to forward all packets coming to a port on the host machine to the port on which the ssh server listens on the guest machine. This can be done using the “VBoxManage” Virtualbox command. Assuming the host port is 2022, ssh server listens on the default port 22 and the network adapter is a PCnet. The guest machine runs Mepis Linux and is named mepis01.

Type the following commands on the host machine’s console

>> VBoxManage setextradata mepis01 “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort” 2022

>> VBoxManage setextradata mepis01 “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort” 22

>> VBoxManage setextradata mepis01 “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol” TCP

You need to close and restart the host machine before the changes take effect.

You can now connect through ssh from the host machine as:
>> ssh -l daysen -p 2022 localhost

Replace localhost with the IP address or hostname of the host machine if you are connecting from another box