Category: Software

  • Mediawiki site generating Warning: Invalid argument supplied for foreach() in LocalisationCache.php on line 390

    Had to blog about this, as I had a problem with one of my MediaWiki sites that I moved onto a shared hosting provider.

    Every page when loaded would generate the error below displayed somewhere on the page. i.e in my case at the top in my header region.

    Warning: Invalid argument supplied for foreach() in /path/to/file/includes/cache/LocalisationCache.php on line 390

    The fix for this is easy, just run the rebuildLocalisationCache.php script in maintenance folder and if you don’t have access to run it via a shell you can add the following line into your LocalSettings.php file instead;

    $wgLocalisationCacheConf[‘manualRecache’] = true;

    Check out the page here for more specific details on the script use etc.

  • Ubuntu 12.04.2 LTS and lxc continued

    This is a continuation of my previous post here, but with more detail. In case you want to jump straight in and have a play with lxc (Linux Containers) on Ubuntu 12.04.2 LTS.

    I moved to Ubuntu 12.04.2 LTS purely cause lxc seemed to be workable out of the box, thus I left behind Debian 7 for now.

    Getting Started.

    Installation of lxc on Ubuntu 12.04.2 LTS is a simple as running the command below;

    apt-get install lxc

    It will install what is needed and even configure the cgroup mount that is required (a manual step of Debian). This will install and configure a NAT 10.x.x.x network device called lxcbr0 on your host, which ALL templates use when you attempt to setup other linux containers on your host.

    If you want bridged network for your linux containers, i.e. share the same network used by your hosts ethernet device, you can do the following. Requires installation of bridge-utils and configuration change to your network file.

    apt-get install bridge-utils

    Next you need to configure /etc/network/interfaces to ensure that your network device is now configured for bridged networking. In my case, I wanted my eth0 to be the bridged device, so you hash out all eth0 networking references. Create the additional lines below in the file;

    auto br0
    iface br0 inet static
     bridge_ports eth0
     bridge_fd 0
     bridge_maxwait 0
     address 192.168.4.10
     netmask 255.255.255.0
     network 192.168.4.0
     broadcast 192.168.4.255
     gateway 192.168.4.254
     dns-nameservers 192.168.4.254
     dns-search lan.heimic.net

    As you can see above, I have configured a static IP assignment. If my eth0 was using 192.168.4.10, I’ve now taken it to use on br0 and would of hashed out all eth0 related configuration. Restart networking (and/or simply reboot). Be sure to have access to the machine should you break it and need to fix it via a console.

    Creating Container

    The command to create a container is easy, and below is a sample.

    lxc-create -n lxc1 -t ubuntu

    This says to create a linux container named (-n) lxc1 and use template (-t) ubuntu. This will end up being a Ubuntu 12.04.2 LTS container. Default location is /var/lib/lxc by the way, you could change this by creating a symlink to where you want them or changing the lxc configuration accordingly.

    When it’s completed creating you will get told that the account to logon is “ubuntu” and password is “ubuntu”, be sure to change it.

    If you want your container to make use of the bridged network and not the NAT based one which the templates default too.

    Find the config file associated with your new container, if your using the default location still it will be;

    /var/lib/lxc/lxc1/config

    Edit the file and find the line that says “lxc.network.link=lxcbr0” and change it to be “lxc.network.link=br0” and save the change.

    Starting Container

    To start the container you just created issue the command below;

    lxc-start -d -n lxc1

    Once again name (-n) is passed, the -d tells it to go in background. If you don’t do this it will boot and show you the output. Good for troubleshooting, so drop the -d if you have problems. Note I haven’t worked out a way to exit from the container when I don’t pass -d, so you might have to kill your ssh session and/or halt the container to get your terminal session back.

    Container Console

    If you start the container using -d, you can access it’s console via the command below;

    lxc-console -n lxc1

    At which point you will get the logon banner for the console of the container. Logon now using the details you got during creation. Change the password.

    At this point you can make changes to the linux install as needed, just like it was a normal physical install on its own dedicated hardware.

    To exit the lxc-console, as it will have stated is control a + q.

    Stopping Container

    To shutdown down a container, you issue the command below;

    lxc-halt -n lxc1

    Where -n is the name of the container as always. See the trend with the commands.

    Container Autostart

    If you want to have the container autostart when the host is rebooted, you should go into /etc/lxc/auto and create a symlink to your containers config file. By default on Ubuntu 12.04.2 LTS this directory is looked at during system startup and any container configs found will have them autostart. Below is an example from my own environment;

    root@alpha:~# cd /etc/lxc/auto
    ln -s /data0/lxc/bravo/config bravo
    root@alpha:/etc/lxc/auto# ls -la
    total 8
    drwxr-xr-x 2 root root 4096 Aug 1 13:59 .
    drwxr-xr-x 3 root root 4096 Jul 31 20:59 ..
    lrwxrwxrwx 1 root root 23 Aug 1 13:59 bravo -> /data0/lxc/bravo/config

    If this has worked, when you run the command below, you will see the word (auto) next to the name of the container that will be start automatically when host reboots.

    root@alpha:~# lxc-list
    RUNNING
     bravo (auto)
    
    FROZEN
    
    STOPPED
     vm0

    Host/Container sharing mounts/file systems

    If you’d like a filesystem from your host to be available on the container, you need to have the container use a bind mount and have it come up during container start and removed during container shutdown. DO NOT MAKE THE BIND MOUNT STATIC ON HOST via /etc/fstab, as I found when I lxc-destroy my container, that it will remove data from any bind mounts.

    Best way to describe the bind mount is to provide an example and what to populate in the containers config file. See below;

    root@alpha:/var/lib/lxc/bravo# cat config | grep lxc.mount
    lxc.mount.entry                         = /data1/cifs/backup data1/backup none defaults,bind 0 0

    Which means /data1/cifs/backup from my host will be mounted at /data1/backup on the container.

    root@alpha:/data0/lxc/bravo# df /data1/cifs/backup
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/alpha1-data1 3845456920 1166862816 2639526500 31% /data1

    on container shown as;

    root@bravo:~# df /data1/backup
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/alpha1-data1 3845456920 1166862816 2639526500 31% /data1/backup

    Hope this helps get someone started, as this information was found by research, reading and putting into practice.

     

  • SDR and paging messages

    Following from my other post here, I’ve managed to finally secure a cable I needed to hook up my USB DVB-T tuner to an outside antenna. I’ve subsequently configured my Raspberry Pi as per the forum post here with the required software.

    Basically I have enabled SDR (Software Defined Radio) and using it to decode paging messages on the paging network.

    I setup the tuner on Windows at first and used SDR# to find the frequency range. A friend told me roughly where to look and what to listen out for. He said you’d hear bursts every so often. Sure enough I did. I found based on my location in South West Sydney that 148.630 was the band that enabled me to get what I needed.

    If you get it working, you will see output like so from the command line below;

    Command:
    rtl_fm -f 148.630M -s 22050 | multimon-ng -t raw -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -f alpha /dev/stdin

    Output:
    POCSAG1200-: Alpha: 1957499:XMPROD PET_SYD_WATER_2 Regular heartbeat 1 to VHA

    It appears that the paging network is still very much used by many. From looking at what comes over it, you can see that the medical industry uses it, in addition to other corporations for notifications etc.

    I should add I found the following page helpful too. Click here.

  • Ubuntu 12.04.2 LTS and lxc

    Have completed my Ubuntu 12.04.2 LTS install and configured lxc (Linux Containers). I am so far very impressed just how easy it was to get this working out of the box. I think the Ubuntu team who produce Ubuntu 12.04.2 LTS has to be given a big clap. Very fine job.

    I’ve install some Debian squeeze lxc’s and Ubuntu ones. All seem to work great and I will post more details soon on what I have done and how it was performed, as it might help anyone thinking of doing the same.

    I wanted to do this so I could run some other software on the containers and not clutter the host install. Although the host will see the processors for the container etc. But that’s fine and expected on how lxc works.

    My aim was to install Mythtv as a master backend into a container and have it use my HDHomerun network based tuner. This has actually worked, and I am currently running it now, however I noticed during reboot/auto start of the container that the mythtv-backend wouldn’t start. Turns out the upstart configuration is not going to work on a linux container. Wiki page here is the link to the config that ships in Ubuntu 12.04.2, and below is my change I made so that I could get it to start automatically, it’s a hack and needs some further investigation, but I was in a rush to get it working in my environment.

    root@delta:~# cd /etc/init
    root@delta:/etc/init# cat mythtv-backend.conf | grep start
    #start on (local-filesystems and net-device-up IFACE!=lo and started udev-finish)
    start on net-device-up IFACE!=lo

    As per above, I hash out the original start on line and create the amended one below it. This is perform in the file /etc/init/mythtv-backend.conf

    Now it will start correctly in my container at boot.

  • Asterisk and Voice Over IP

    Purchased a humble Linksys/Cisco IP phone SPA922 and installed it earlier in the week. However wasn’t able to use it until the power brick I ordered arrived. It came later in the week.

    Been a long time since I installed asterisk, but I have fond memories that it was very awesome once you got it working. I struggled a little, but somethings were easy and others not so. Thanks to a friend who helped I managed to configure everything I needed and even got it to talk to my provider MyNetFone which I purchased a DID from to use from Sydney 02 region.

    After tinkering Friday evening I got the inbound working and outbound working. My next step was to get IVR working on the inbound calls. I got this done on Saturday morning and evening.

    Very happy with the setup so far, have subsequently copied over my configuration and voice files onto a Raspberry Pi where I have setup raspbian and installed asterisk. I choose to run it like this as I found the pabx based distro with the nice web interface confusing. What I have got works, and works well so far more me. Will continue to work/tweak it.

    So far so good and very impressed.

  • Confluence 5.1.4 installation and configuration on Linux

    Over the past 2 years or more I’ve become a bit of an expert and/or go to person for Confluence. Below is my notes on how I would do a Confluence 5.1.4 deployment, please note it will not be a detailed process. We will have some assumed knowledge.

    Prerequisites:

    • Linux client/server installed
    • apache2 installed
    • mysql installed (I use mysql still)

    Download the Confluence 5.1.4 bin file and copy it to your client/server. Since we will be using mysql, we should also download the mysql connector per the Confluence documentation. See step 6 on this page here.

    1. Create the mysql database that you will use for your confluence;

    mysql> create database confluence_wiki character set utf8 collate utf8_bin;

    2. Create a mysql user with a password and provide it the privileges required to access the database above;

    mysql> create user ‘conf’@’localhost’ identified by ‘password_string’;
    mysql> grant all privileges on confluence_wiki.* to ‘conf’@’localhost’;
    mysql> flush privileges;

    3. You can check the account privileges via the command below;

    mysql> show grants for ‘conf’@’localhost’;

    4. Now chmod 755 the Confluence 5.1.4 bin file you got and execute it. Run through the installation and define your install path and confluence data path.

    5. Extract the contents of the mysql connector archive and copy the jar file to the path below;

    <Confluence installation>/confluence/WEB-INF/lib

    6. Before you now point your browser at the Confluence to complete the setup, I would recommend you stop and start it. Below is the scripts you can use to perform this.

    <Confluence installation>/confluence/bin/stop-confluence.sh
    <Confluence installation>/confluence/bin/start-confluence.sh

    7. Now you can point your browser at the URL stated back at the end of step 4. Complete the installation as needed, following the Confluence installation documentation.

    If you’d like for your users to be able to access the Confluence via an apache2 vhost, without the need to remember the servers name/ip and port for the Confluence installation you can do the steps below.

    Prerequisites

    Ensure that you have the DNS setup for the vhost, so clients go sent to this webserver.

    1. Setup the vhost configuration file in Linux distribution specific way. i.e. Debian is /etc/apache2/sites-available

    Sample vhost configuration file;

    <VirtualHost *:80>
    ServerName wiki.domain.com
    ServerAlias wiki
    ServerAdmin webmaster@domain.com

    ProxyPreserveHost On

    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>

    ProxyPass / http://localhost:8090/
    ProxyPassReverse / http://localhost:8090/

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    If my vhost was called wiki.domain.com, it would send all client connections to wiki.domain.com to the localhost:8090. Thus serving out the default confluence installation just completed prior above. If you have multiple confluence installs on the client/server, you would just make as many vhosts as you need and modify the port on the end to point to each unique confluence install.

    2. Ensure you have installed the proxy* modules for apache2 and have them enabled. i.e. Debian is the location below;

    root@bravo:/etc/apache2/mods-available# ls -l proxy*
    -rw-r–r– 1 root root 87 Mar 3 23:07 proxy_ajp.load
    -rw-r–r– 1 root root 355 Mar 3 23:07 proxy_balancer.conf
    -rw-r–r– 1 root root 97 Mar 3 23:07 proxy_balancer.load
    -rw-r–r– 1 root root 803 Mar 3 23:07 proxy.conf
    -rw-r–r– 1 root root 95 Mar 3 23:07 proxy_connect.load
    -rw-r–r– 1 root root 141 Mar 3 23:07 proxy_ftp.conf
    -rw-r–r– 1 root root 87 Mar 3 23:07 proxy_ftp.load
    -rw-r–r– 1 root root 89 Mar 3 23:07 proxy_http.load
    -rw-r–r– 1 root root 62 Mar 3 23:07 proxy.load
    -rw-r–r– 1 root root 89 Mar 3 23:07 proxy_scgi.load
    root@bravo:/etc/apache2/mods-available# pwd
    /etc/apache2/mods-available

    They can be enabled by running “a2enmod proxy_ajp” etc.

    Be sure to restart apache2 when all done.

    3. If you have everything configured correctly, you should be able to access http://wiki.domain.com and get set to the confluence install you completed previously. I would recommend updating the hostname in the confluence console to use the vhost if it all works, so any links that get generated now use the vhost.

    — That concludes things.

     

  • Mountain Lion

    Installed Mountain Lion for a look on weekend. Certainly different.

    Didn’t use it long enough to draw any sort of opinion just yet, so will keep playing around. The first thing I do remember seeing was the way files are now displayed during file copy process using Finder was good. I quite liked this so far.

  • Booting Windows Server 2012 under VMware Workstation 8

    Still not having much luck with getting Windows Server 2012 to boot under VMware Workstation 8. The failure during booting it in a Virtual Machine is below.

    A little annoying to say the least. I’ll eventually work it out I am sure, have tried a number of the suggested workarounds and nothing has worked so far. I guess I will get more motivated eventually.

  • Windows Server 2012

    I downloaded the Windows Server 2012 RC and can’t even get it to boot in VMware Workstation 8.

    Not figured out why yet, but will have to do more research. Really want to take a peek to see what’s new.

    Any ways..

  • CentOS 5.8 now available

    It would appear CentOS 5.8 is now available. Go get it.