Posts

VGA out for cubieboard

Image
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.

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.

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. #!/bin/bash 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 do kill -9 $i done

MySQL Apache Failover System with DRBD, Pacemaker, Corosync

Environment 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: DRBD & drbdlinks Pacemaker & Corosync 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: 10.0.0.2, synchronization partition: /dev/sdb1 Node 2, hostname: fo3, ip: 10.0.0.3, synchronization partition: /dev/sdb1 IP Cluster: 10.0.0.1 Domain: test.ok Synchronization folder: /sync

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/*"

SSH Tunnel with auto reconnect

If you want to make your SSH Tunnel automatic reconnect when it is disconnected, you can use autossh. This is an examples how to configure autossh to make tunnel on port 10088 in local server and on port 10087 in yourserver.com and only accessible from yourserver.com Put these codes in the rc.local : AUTOSSH_POLL=600 AUTOSSH_GATETIME=30 export AUTOSSH_POLL AUTOSSH_GATETIME autossh -2 -M 20000 -fN username@yourserver.com -R 10087:localhost:10088 -N