HTTPS Redirect with .htaccess

Posted: March 13th, 2021 | Author: | Filed under: Uncategorized | No Comments »

Creating a simple HTTPS redirect rule for Apache can potentially be a long, tiresome journey of trial and error.
There are many ways to write the rule with subtle syntax differences and other factors such as the version of the Apache server also affecting the outcome.
The following snippet is what finally worked for me on Gigahost (a shared web hosting provider in Denmark).

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{ENV:HTTPS} !on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

General OpenELEC Configuration

Posted: January 10th, 2013 | Author: | Filed under: Uncategorized | No Comments »

Shutdown function should suspend:

System -> Settings -> System Powersaving -> Shutdown function: Suspend

XBMC + TVHeadEnd + HDHomeRun

Posted: December 28th, 2012 | Author: | Filed under: Uncategorized | No Comments »


How to install and configure TVHeadend and HDHomerun on an OpenELEC machine.


HDHomerun Driver


Configure HDHomerun Driver

Change directory to /storage/.xbmc/addons/driver.dvb.hdhomerun/config
Make a copy of dvbhdhomerun.sample to dvbhdhomerun.conf

Open \\xbmc\Userdata\addon_data\driver.dvb.hdhomerun\adapters and copy the IDs of the two tuners to dvbhdhomerun and set their types (just follow the instructions in the config file.). Alternatively, run userhdhomerun to get the IDs.


Configure TVHeadend

Go to webpage of TVHeadend: http://:9981
Go to Configuration -> DVB Inputs -> TV Adapters

Select the first adapter.
Click “Add DVB Network by Location”
Choose your location
Click “Enabled”
Click “Save”
TVHeadend now starts scanning for channels. You can monitor its progress in the pane to the right. When “Muxes awaiting initial scan” is zero, it’s done.
Click “Map DVB Services to Channels”.
The mapping will also take some minutes to complete depending on how many channels are present.

In the web config in Configuration -> TV Adapters: After all channels have been configured, disable “Autodetect Muxes” and “Idle Scanning“. Having these enabled completely destroyed the stream from TVHeadEnd, making the image look garbled and stuttering. It looked like a low bandwidth connection or bad signal.

XBMC Setup

Posted: July 29th, 2012 | Author: | Filed under: Uncategorized, XBMC | No Comments »

The following articles describes my XBMC setups.

Resume from Suspend (S3) in XBMC
Samba Sharing in XBMCbuntu

OpenELEC 2.0

Configure audio device

HDHomeRun + TVHeadEnd

Get XML String from JQuery XML Object

Posted: January 9th, 2012 | Author: | Filed under: Uncategorized | Tags: , , | No Comments »

Problem: You have an XML structure in a JQuery object and now you want to extract a string with the raw xml.
Solution: Use the XMLSerializer class. This class provides methods for serializing DOMs and nodes into text or byte streams. In our case, we will call the serializeToString(data) method:

new XMLSerializer().serializeToString(xmlDoc);

Computer Forensics

Posted: December 30th, 2011 | Author: | Filed under: Linux, Uncategorized, Windows | Tags: | No Comments »

The tools I use for computer forensics.


  • Recuva – Excellent at recovering data from Windows partitions and free to boot.
  • UFS Explorer – Not free, but is able to recover from linux partitions (Recuva is better for FAT/NTFS)
  • explore2fs – Access linux partitions from Windows. Free.
  • HFSExplorer – Access Mac partitions from Windows


  • Hiren’s Boot CD – Contains an impressive lineup of programs for computer forensics, but its legal status is often debated.
  • Trinity Rescue Kit – A live distro with backup programs, Midnight Commander, testdisk, shell and other good stuff. Legal!

Non-ASCII chars in Java

Posted: November 29th, 2010 | Author: | Filed under: Uncategorized | Tags: , | No Comments »

If you are having problems with non-ASCII characters (for example the Danish æ, ø and å) not showing up correctly in your Java application, try giving the Java VM the following argument:


You can verify that the charset has been set with this statement:


Slow access to shared network folder from VM

Posted: August 5th, 2010 | Author: | Filed under: Uncategorized | No Comments »

After changing the network adapter type on a VMware virtual machine from NAT to bridged, the transfer speed from shared network folders dropped to about 25 kb/s and browsing shared folders was really sluggish. The network folder was located on the host machine, which was running Windows 7 Searching the VMware knowledge base resulted in the following article. I can confirm that the proposed solution also applies to Windows 7:

Performance issues with bridged networking on Windows Server 2003 and Windows 2008 host operating systems

In short: Use regedit to navigate to the following place:


Then create a DWORD key named DisableTaskOffload and give it ‘1’ as value. TCP task offloading means distributing calculations concerning the network communication to the network card, so creating this registry key means that all these calculations will be done on the CPU.
Microsoft Virtual Server seems to be susceptible to the same problem and offers the same solution along with two others: Slow performance when you try to access resources on your Virtual Server 2005 host computer from a guest virtual machine