Joomla 3.4 too many redirects (303)

On a Joomla site currently in offline mode the front page gave us “too many redirects” error. It turned out the reason was the article connected to the home page menu item had been unpublished. By publishing the article the problem wsa solved.

Vivotek PT7137 rtsp stream to webpage using VLC plugin

One way of getting the video from Vivotek PT7137 to a webpage is by using the VLC plugin and connect the rtsp stream.

However, in current version of Chrome the VLC plugin is no longer supported. Instead it is suggested to use HTML5 to embed video, but rtsp is not supported in Chrome so it is kind of a dead end there for the moment. This solution works in for example Firefox.

In the webpage where you would like to add the stream:

<object classid=”clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921″ codebase=”http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab” id=”vlc”>
</object>
<embed type=”application/x-vlc-plugin” pluginspage=”http://www.videolan.org” autoplay=”yes” loop=”no” width=”600″ height=”340″ target=”rtsp://USERNAME:PASSWORD@IPADDRESS:554/live.sdp” />

Replace USERNAME, PASSWORD and IPADRESS with real values for your Vivotek PT7137 camera. It might be a good idea to create an account in the Vivotek PT7137 to use from the web as the username and password will be visible for anyone who inspects the webpage source code. That said, putting the root user account and password here would be considered stupid 🙂

Tip for Joomla users: If you include this code in a Joomla site, include {emailcloak=off} before the above, because the @-sign will trig Joomla email cloaking beliving it is an email address.

CSS background-position not working on Android Mozilla

In order to position a background image inside a div I tried to use the CSS3:

background-position: right 10px center;

The goal was to position the background image to the right of a div container, 10px from the right edge and vertically centered. This worked fine in most browsers. However, in the Android devices using the native Mozilla browser the background was positioned at 0,0 (i.e. left top).

The solution was to use:

background-position: right center;

and edit the background image where I added 10 px of extra transparent space into the image.

How to convert a SVG (scalable vector graphics) image to PNG

This method aims at Windows users but similar methods are probably also useable in other environments.

  1. Right click on the SVG image file and select Open with
  2. Select Internet Explorer
  3. In Internet Explorer right click on the image and select Save image as
  4. In the File Format box switch from Scalable Vector Graphics (*.svg) to PNG (*.png) 
  5. Click Save

For Ubuntu there is a simple solution described here -> http://www.upubuntu.com/2012/06/how-to-convert-svg-files-to-other-image.html

Cron scripts in /etc/cron.daily not running

If you put a script to be run by cron in cron.hourly, cron.daily, cron.weekly or cron.monthly but they won’t run, make sure that they:

  • Are chmod +x
  • Are owned by the correct user (like root:root)
  • Start with #!/bin/sh or the corresponding shell used to execute them
  • The filename doesn’t contain any dots, like a script name ending in .sh will not execute

You can also execute the command to verify that your script will be run:

run-parts –test /etc/cron.daily

My mobile phone has been stolen – how do I find it?

Track and find a stolen mobile phone is often done in vain. If you forgot it somewhere there is a chance to locate it, but if it was stolen for example by a pick pocket, they usually know to turn it off immediately and then wipe it before it has a chance to report it’s location. But it is worth a try.

Apart from that, call your provider to lock your SIM card and the phone IMEI numer (makes it unusable with other SIM cards). Change passwords for all the apps you had installed, like Facebook, email etc.

Android: Use Android Device Manager and login using the same Google account you used to initially set up the phone. Click on Locate device.

iPhone: Use iCloud and login using your Apple ID. Can be used to find your missing Mac, iPhone or iPad.

Windows phone: Use Microsoft and login using your Microsoft Account (former Windows Live ID). Go to Find my device.

Smooth scrolling not working for my website on IOS devices like iphone and ipad

On iPhone and iPad, i.e. IOS devices, in some cases the smooth, accelerated scrolling is not working. Instead the web page feels “lagging”, slow or stuttering and won’t continue to scroll in the smooth accelerated way you are used to.

To solve this, make sure to use overflow-y: scroll; (not auto) and apply  -webkit-overflow-scrolling: touch; to body and possibly other elements. If it is not enough to apply it to the body you might need to also apply it to your div:s, like the wrapper div and so on.

body {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}

Joomla t3 bootstrap dropdown submenu not working on tablet and phone

A template based on t3 boostrap framework has a problem when click a menu item where there is a submenu dropping down. The visitor has no possibility to click the submenu item. The problem occurs in the android native browser but works fine in chrome for android. Some reports says the same problem occurs in the iphone/Ipad safari browser too.

To resolve this, go to the templetes in joomla backend and configure the t3 bs. Go to navigation and change dropdown trigger from hover to click (as tablets and phones doesn’t have the possibility of hovering).

FormMail.pl keeps reporting Bad referrer

I used FormMail.pl from Matt’s Script Archive on one of my web sites and called this script from several other web sites. This way I only need to maintain one copy of the script regarding updates.

The script began complaining about “Bad referrer” when called from my other sites, even though I could positively verify that the other site’s domain name was present in the referrers of FormMail.pl.

Not finding the problem in the script itself I began to think over what I had recently changed on the site hosting the FormMail.pl and one thing was that I recently added a http redirect any incoming calls that didn’t go to the site url using https and I also redirected www.sitename to just sitename. For example, a call to http://www.sitename was redirected to https://sitename using Apache’s http rewrite module.

On my other sites using the FormMail.pl script from the main site, I was calling the FormMail.pl using a url beginning with http://www, i.e. the call was redirected by http redirect rules. When changing the url to call the FormMail.pl script to https://sitename (i.e. using SSL and no www), the call would not be touched by http redirect rules and voila – everything was working again.

PrestaShop PHP error Cannot redeclare class BlowfishCore on Ubuntu 14.04 server [solution]

Edit /etc/php5/cgi/conf.d/05-opcache.ini. Add:

opcache.enable=0
opcache.enable_cli=0