Archive for March, 2011

More tips on tunning postfix

These are from server

maximal_backoff_time = 1000s
minimal_backoff_time = 300s

Leave a comment

Debug shell script

Simple add and -x to your shebang

#!/bin/bash -x

Leave a comment

Cross Compiling streamer from xawtv using LTIB

1 – Get source code from

2 – Aplly these patches

diff -urN ../tmp-orig/xawtv-3.95/console/fbtools.c ./console/fbtools.c
--- xawtv-3.95/console/fbtools.c 2003-02-14 14:14:04.000000000 +0000
+++ xawtv-3.95/console/fbtools.c 2011-03-12 10:57:40.000000000 +0000
@@ -21,8 +21,6 @@

#include "fbtools.h"

/* -------------------------------------------------------------------- */
@@ -424,7 +422,7 @@
goto err;
- fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~PAGE_MASK);
+ fb_mem_offset = (unsigned long)(fb_fix.smem_start) & ~(sysconf(_SC_PAGE_SIZE)-1);
fb_mem = mmap(NULL,fb_fix.smem_len+fb_mem_offset,
if (-1L == (long)fb_mem) {
diff -urN ../tmp-orig/xawtv-3.95/console/matrox.c ./console/matrox.c
--- xawtv-3.95/console/matrox.c 2005-02-03 10:40:41.000000000 +0000
+++ xawtv-3.95/console/matrox.c 2011-03-12 11:09:51.000000000 +0000
@@ -9,7 +9,6 @@

-#include /* PAGE_SIZE */

#include "byteswap.h"
@@ -226,7 +225,7 @@
return -1;
off = (unsigned long)fb_fix.mmio_start -
- ((unsigned long)fb_fix.mmio_start & ~(PAGE_SIZE-1));
+ ((unsigned long)fb_fix.mmio_start & ~(sysconf(_SC_PAGE_SIZE)-1));
bmmio += off;
mmio = (uint32_t*)bmmio;
return 0;

3- Prepare the compilatio using

./configure –disable-xfree-ext  –disable-xvideo  –disable-lirc –disable-quicktime –disable-motif –disable-aa–disable-alsa  –disable-zvbi –disable-gl  –disable-dv  –disable-xft –without-x

4- After configure, modify Makefile

# include stuff
# must come firstinclude $(srcdir)/common/
# subdirsinclude $(srcdir)/console/Subdir.mkinclude $(srcdir)/debug/Subdir.mkinclude $(srcdir)/frequencies/Subdir.mkinclude $(srcdir)/libng/Subdir.mkinclude $(srcdir)/libng/plugins/ $(srcdir)/libng/contrib-plugins/ $(srcdir)/man/ $(srcdir)/scripts/ $(srcdir)/vbistuff/ $(srcdir)/x11/
# dependencies-include $(depfiles)
#Compiling only streamer
# targets to buildTARGETS-console := \    console/streamer
console/streamer: \    console/streamer.o \    common/channel-no-x11.o \    $(OBJS-common-capture)
console/streamer : LDLIBS  += $(THREAD_LIBS) -ljpeg -lm -L${JPEG_ROOT}/libconsole/streamer : LDFLAGS := $(DLFLAGS)
# global targetsall:: $(TARGETS-console)

install::    $(INSTALL_PROGRAM) $(TARGETS-console) $(bindir)
distclean::    rm -f $(TARGETS-console

5- Run make

Thanks to Jeyner Gil Caga

Leave a comment

Git clone SVN repository

git svn clone git@git-server:project.git
cd project
git remote add beanstalk
git push beanstalk master


Leave a comment

Undo git last commit

git reset --soft HEAD^

Leave a comment

Load Python in 32bit mode



Leave a comment

Convert Canon CR2 raw images to JPEG images


for i in *.cr2; do dcraw -c -q 0 -w -H 5 -b 8 $i | cjpeg -quality 100 > $i.jpg; done

Tip from

Leave a comment

Compiling Busybox for ARM and Android

# Download the source from git

hamilton@saygon:/tmp$ git clone git://

hamilton@saygon:/tmp$ cd busybox/

#Export ARCH and  CROSS_COMPILE (check your toolchain)

export ARCH=arm
export CROSS_COMPILE=/opt/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-

#Enter the configuration interface

hamilton@saygon:/tmp/busybox$ make menuconfig

#and follow these procedures

$ Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs)  -  Enable this option by pressing "Y"
$ Busybox Settings --> Build Options --> Cross compiler prefix  -  Set this option equal to "arm-none-linux-gnueabi-"
$ Busybox Settings --> Installation Options --> Don't use /usr  -  Enable this option by pressing "Y"
$ Linux Module Utilities --> () Default directory containing modules - Set this option to nothing
$ Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing

#Select desired packages and save your configuration and run make, after compilation you will have a busybox binary

hamilton@saygon:/tmp/busybox$ file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.14, stripped

#Upload the file to your adb device and install busybox using ./busybox –install -s

#You can find more tips here


Ltib fails to compile in Ubuntu 10.10 file not recognized problem

ccache /usr/bin/gcc -B/usr/bin/  -g -O2   -o makedoc  makedoc.o ../lib/libtxi.a -lncurses

makedoc.o: file not recognized: File format not recognized

collect2: ld returned 1 exit status

make[4]: *** [makedoc] Error 1

make[4]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8/tools/info’

To solve that just

$ sudo rm -rf ~/.ccache

and start all over.

Leave a comment

Parallel bzipping with pbzip2

PBZIP2 is a parallel implementation of the bzip2 block-sorting file compressor that uses pthreads and achieves near-linear speedup on SMP machines. The output of this version is fully compatible with bzip2 v1.0.2 or newer

Compression :

$ pbzip2 file


$ pbzip2 -d file.bz2


Leave a comment