Monday, November 25, 2013

Apache2 LDAPS Auth config against eDirectory

Apache2 LDAPS Auth Config against eDirectory

  1. Create cert directory in apache conf directory:
    mkdir /etc/apache2/cert
  2. Download LDAP cert from eDirectory server and copy to /etc/apache2/cert:
    cp CA.b64 /etc/apache2/cert/
  3. Create config file /etc/apache2/conf.d/ldaps and add this line:
    LDAPTrustedGlobalCert CA_BASE64 "/etc/apache2/cert/CA.b64"
  4. Edit ssl config file /etc/apache2/sites-enabled/default-ssl and add these lines to protect the directory:
    Alias /phpmyadmin /usr/share/phpmyadmin/
    <Directory "/usr/share/phpmyadmin">
     AuthName "Access to phpMyAdmin: Login using LDAP user"
     AuthType basic
     AuthBasicProvider ldap
     AuthLDAPUrl ldaps://,o=company?cn
     Require ldap-user username1 username2
  5. Restart apache2:
    service apache2 restart

References :


Thursday, August 22, 2013

Adding a mobile version to your typo3 site with css and jquery mobile

You already have a complex and huge typo3 site and want to add a mobile version to it. At the beginning, you didn't have such a plan to have different layout for the mobile devices, so it will cost you a lot of time and work to create another layout for the mobile devices. But don't worry, with this trick, you will have a friendly mobile layout for your site with just a little effort.

Tuesday, July 09, 2013

Hideable navigation on Custom Home extension

To make more space in the main column, we can try to wrap the navigation using div, so that it will be hidden  on window load. This example shows how to wrap the navigation using typoscript.

In this example, the navigation is defined in left_nav object:
page.10.subparts {
  left_nav.wrap = <div id="nav1" class="nav"><div class="nav-btn"><img width="16" height="16" alt="Info" title="Info" src="../typo3/sysext/t3skin/icons/module_web_list.gif"></div> | </div>
The div above will be processed by jquery so that it will be hidden by default, we can hover on the icon to make it visible, and then we can access the navigation.

Tuesday, July 02, 2013

Changing Shibboleth Hostname


When we change the hostname, for example: to, we need to change the definition in configuration file and also the SSL certificate. The information below, lists which files are needed to be changed.

Changing IDP hostname

When we change the IDP hostname, the following files should be edited:
  • edit shibboleth2.xml on SP server
  • edit relying-party.xml (IDP SSL cert path)
  • edit idp-metadata.xml (hostname and ssl cert)
  • edit apache conf (SSL cert path)
After that, restart both IDP and SP services.

Monday, June 10, 2013

Belkin F7D1101 Wireless USB on android Cubieboard

Preconfigured Android Livesuit image from Cubieboard website only support Wireless Usb with RTL8192cu and RTL8188eu chipset. For anyone that have wireless USB with chipset 8712u (8188su) such as Belkin F7D1101 (list of similar device) must add the driver manually. Here you can find how to compile the driver and configure it in android cubieboard.

Tuesday, June 04, 2013

Shibboleth IDP and Kerberos


Shibboleth IDP can use Kerberos as authentication mechanism, but Shibboleth IDP still need a LDAP or any database system to get the user's data and to release the attributes to the Shibboleth SP. To setup a Kerberos mechanism in Shibboleth IDP, we need at least:
  • Working Kerberos System.
  • Working Kerberos client in the Shibboleth IDP server. /etc/krb5.conf is configured properly.
  • Working Shibboleth IDP server.
At first, we need to install Kerberos Login Handler in the working Shibboleth IDP server. The Original file and documentation can be found here.

Thursday, May 02, 2013

Doc Creator (doc_creator) for typo3

This extension is based on PDF Generator 2. This extension uses htmltodocx, PHPWord and SimpleHTMLDom as the converter engine. So, it is a pure php converter and should work in any OS. Because of the limited function from PHPWord, it can only convert simple html page into docx.

You can find the extension installer on TER.

example in the template Constants:

doc_creator {
  top = 18
  bottom = 20
  left = 15
  right = 15
  string_search1 = <body>
  string_replace1 = <body> <!-- DOCX Body -->
  regexp_search2 = (<a (.*?)>&larr;(.*?)</a>)
  regexp_search3 = (<a (.*?)>(.*?)</a>)
  regexp_search4 = (<a (.*?)>&lt;-(.*?)</a>)

Friday, April 05, 2013

VGA out for cubieboard

Because my TV is used mainly for watching. I need an alternative display output for my cubieboard. The easiest way is using CVBS pin, and attach it to RCA jack to connect to video input. But I don't have another display with video in, so I need to built VGA out for the cubieboard.

Component needed :
  • 3 x 75 ohm low-tolerance resistors.
  • 1 x 74ACT08D quad AND gate.
  • 2 x bat54s SCHOTTKY diodes (I can't find it in my local store, so I change it with 4 x bat85s or any SCHOTTKY diodes).
  • 1 x 100 nF low-tolerance capasitor.
  • 1 x VGA DB15 connector.

Thursday, February 21, 2013

Mysql backup using php script

When you make backup using mysqldump, you will get one big file in your backup folder. If you want to move the backup file to another server or just want to save it in your local computer, it will take time because of the size of the file. Indeed, you can split it per table. This script can help you to backup your mysql database, and splits the backup file every 10 tables.

Wednesday, February 20, 2013

Simple bash script to kill stalled application

Sometimes, your application was stalled and stay in memory and never exit. For this, you can create a simple bash script to define whether the application is worth to be killed. This example will kill wkhtmltopdf-amd application that has state Sl and have been running for more than 1 hour. You can then call this script via cron, to call it periodically.
get_proc=`ps -C wkhtmltopdf-amd -o pid=,stat=,etime= | awk '{if ($2 == "Sl" && !(substr($3,0,2)+0 < 1) ) print $1; }'`
for i in $get_proc
 kill -9 $i

Monday, February 18, 2013

MySQL Apache Failover System with DRBD, Pacemaker, Corosync


To setup a failover system with Pacemaker, Corosync and DRBD, we need 2 servers, 3 IP address in the same subnet and one partition with same size in both server. In this setup, mysql and apache are already configured
Software requirement:
  1. DRBD & drbdlinks
  2. Pacemaker & Corosync
  3. psmisc package (needed by pacemaker)

It is highly recommended to use separate network adapters for synchronization but it is also work with 1 network adapter.
In this example, we use below configuration:
  • Node 1, hostname: fo2, ip:, synchronization partition: /dev/sdb1
  • Node 2, hostname: fo3, ip:, synchronization partition: /dev/sdb1
  • IP Cluster:
  • Domain: test.ok
  • Synchronization folder: /sync

Wednesday, January 23, 2013

Custom typo3 Sitemap

This is an example to customize the Sitemap in the typo3 system. You can add image and define your own layout for the Sitemap. You have to modify your main template on the Setup section and your root page properties on the Resources tab in the TypoScript Configuration.

PDF Creator for typo3

This extension is based on PDF Generator 2. So you can use the PDF Generator 2 documentation to setup this extension. I added functionality to put an icon as a pdf link via content element.

This extension uses wkhtmltopdf as the rendering engine. So, it comes with binary version for linux 32 and 64 OS. If you want to install this extension on Windows, just change the binary to the version for windows in bin directory. The binary for another OS, you can find here. Don't forget to change the permission as executable by typing this command "chmod +x bin/*"