DoK – Where Dreams Come From

C’è chi vede il bicchiere mezzo pieno e chi lo vede mezzo vuoto… Per me, l’acqua che manca, è traboccata fuori ;)

Qmailtoaster & Dovecot IMAP

Hi tech guys icon smile Qmailtoaster & Dovecot IMAP
After dome days of big bugs from my previous IMAP server (Courier 4.2.x – AUthlib 0.59.2), I decided to upgrade to last version available (Courier IMAP 4.4.1 – Authlib 0.61.0). I always installed package from qmail toaster, so I build a new .rpm and .srpm version for courier and authlib mantaining upstream qmailtoaster version.

After installation, I noticed something wrong icon sad Qmailtoaster & Dovecot IMAP
I got this strange error: “libauthvchkpw.so: cannot open shared object file: No such file or directory”.
Why ?!?!?!? Simply because vpopmail support is’nt available with authlib 0.61.0 (from 0.60.4) !!!!!
But all my installation support vpopmail !!!!! ARGHHHHHHHHHHHHHHHHHHHHHHHHHHHH !!!

Don’t worry Salvatore, don’t worry icon smile Qmailtoaster & Dovecot IMAP The only file you need is libauthvchpw.so icon smile Qmailtoaster & Dovecot IMAP
I copied it from previous installation and all was OK icon smile Qmailtoaster & Dovecot IMAP

But…. bugs are still present… GRRRRR… I need another IMAP server… DOVECOT !!!!!

Installation is very very simple (yum installer help a lot icon smile Qmailtoaster & Dovecot IMAP ). But now it’s time to configure and migrate.

First, simple step icon wink Qmailtoaster & Dovecot IMAP Migration is immediate. All you need is to add this commands on /etc/dovecot.conf:

mail_location = maildir:~/Maildir
mail_uid = 89
mail_gid = 89
first_valid_uid = 89
last_valid_uid = 89
first_valid_gid = 89
last_valid_gid = 89

so you can access previous receveid mail icon wink Qmailtoaster & Dovecot IMAP Remeber, on qmail-toaster vpopmail uid/gid is 89. If you want to known which userid/groupid is assigned to your user, you need to issue from shell:

id vpopmail

Ok, now the hard work. Now you need to integrate your vpopmail installation (auth module) with DOVECOT. First of all, you can’t use SQL access. With qmail-toaster all domains have a separate table. This is’nt a problem… Real problem is domain translation !!! You can’t use %d (DOVECOT variable) because domain is translated. For example, my domain ansani.it is stored like ansani_it.

And now ?!?!?!? Don’t worry, you can use vchkpw and checkpassword icon smile Qmailtoaster & Dovecot IMAP

Yes yes yes yes, on your auth default section, you need to write something like that:

auth default {
mechanisms = plain
 
passdb checkpassword {
args = /home/vpopmail/bin/vchkpw
}
 
userdb prefetch  {
args = uid=89 gid=89 home=/home/vpopmail/domains/%d/%u
}
 
count = 1
}

Remember again, I’ve installed qmail-toaster and my mails are on /home/vpopmail/domains/MY_EMAIL_DOMAINS/MY_USERNAME_/Maildir.

After this mod, all works ok icon smile Qmailtoaster & Dovecot IMAP

Enjoyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy icon smile Qmailtoaster & Dovecot IMAP

Regards,
Salvatore

Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

Hi guys !!!
this is another (!?!?!?!) document on how to compile a toolchain for iPhone (with firmware 2.0.x) on MaxOSX 10.5.x. First of all, why a new document ?!?!?!? Simple question and simple response: “Because other documents I found on Internet don’t work for me, so I decided to mix infoz from the NET and try to make my toolchain… icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x and… finally it works !!!!!”

Most info about toolchain compilation I get from this good article from Saurik, NerveGas and Drudge.

First of all, you need terminal access to your Mac. If you don’t known how made an ssh/shell access, well… go away icon wink Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x
Now, I hope you have installed bison, flex and a svn client… It’s OK ?!?!? Do you have ?!?!? OK… let’s go !!

Create a new directory iPhoneDevel and go on with llvm.
Now, from shell:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn -r 42498
pushd llvm-svn
./configure --enable-optimized
make ENABLE_OPTIMIZED=1
sudo make install
LLVMOBJDIR=`pwd`
popd

If you want to known why you’re still relegate to release 42498 of llvm, you need to read these.

Now, it’s time to checkout some iPhone devel tools:

svn checkout http://iphone-dev.googlecode.com/svn/trunk/ iphone-dev
pushd iphone-dev
pushd include
svn switch http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk
popd
pushd odcctools
svn switch http://iphone-dev.googlecode.com/svn/branches/odcctools-9.2-ld
popd
sudo mkdir -p /usr/local/arm-apple-darwin
mkdir -p build/odcctools
pushd build/odcctools
../../odcctools/configure --target=arm-apple-darwin --disable-ld64

I compile for arm-apple-darwin platform, you can safely change this target with whatever you want icon wink Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x .
Now, check if you have MacOSX 10.4u SDK (if not, simply download iphone SDK from Apple Site and install everything). If so, simply write this on shell:

export INCPRIVEXT="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"

Now, compile party icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

make
sudo make install
popd

Ok, first BIG step is gone. Now it’s time to get iPhone FileSystem and mount to /usr/local/share/iphone-filesystem. If you don’t known how to obtain correct File System, simply read this document.
I assume you mounted correctly undecrypted dmg image so, go on mounting iPhone FS and compiling toolchain.

sudo ln -s /Volumes/BigBear5A347.M68OS /usr/local/share/iphone-filesystem
export HEAVENLY=/usr/local/share/iphone-filesystem
pushd include
./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk
sudo bash install-headers.sh
popd
mkdir -p build/csu
pushd build/csu
../../csu/configure --host=arm-apple-darwin
sudo make install
popd

By now I tried successfully to compile gcc 4.0 with MacOSX 10.4u headers, so document I wrote assume you have downloaded and correctly installed these. I try to compile gcc 4.2 with 10.5.x headers and, if all was ok, I update this guide… stay tuneeeeeeeeeeeeeeed icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

Let’s go:

mv llvm-gcc-4.0-iphone/configure llvm-gcc-4.0-iphone/configure.old
sed 's/^FLAGS_FOR_TARGET=$/FLAGS_FOR_TARGET=${FLAGS_FOR_TARGET-}/g' llvm-gcc-4.0-iphone/configure.old > llvm-gcc-4.0-iphone/configure
sudo ln -s /usr/local/arm-apple-darwin/lib/crt1.o \/usr/local/arm-apple-darwin/lib/crt1.10.5.o
mkdir -p build/llvm-gcc-4.0-iphone
pushd build/llvm-gcc-4.0-iphone
export FLAGS_FOR_TARGET="-mmacosx-version-min=10.1"
sh ../../llvm-gcc-4.0-iphone/configure --enable-llvm=`llvm-config --obj-root` \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld

Now, it’s time to patch icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x
If you don’t patch, you receive a lot of garbage errors like these:

../../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm:670:garbage following instruction -- `bls 11f'
../../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm:672:garbage following instruction -- `beq 12f'
make[2]: *** [libgcc/./_udivsi3_s.o] Error 1

Why you obtain these errors ?????? Read this page about issue #145.
How you can correct error ?!?!? Simply download this file and save it on iPhoneDevel directory and:

patch ../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm ../../../lib1funcs.asm.diff

Now, final step icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn
sudo make install

OKOKOKOKOKOKOKKOKOK icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

Now all it’s OK with toolchain. All files are installed on /usr/local/arm-apple-darwin/ and you can safely compile all sources you want.

Before you go out, some little tips icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

If you want to run your app on iPhone, you need to run “ldid -S YourApp” on your iPhone, otherwise you obtain “Killed” because your app need to be signed.

If you obtain a “Segmentation fault” error, a “Bus error” or a trap error on your iPhone when you try to launch your app, something went wrong with your main method. Remember, you need to use something like thah when you create your app:

int main(int argc, char *argv[])
{
NSAutoreleasePool* pool = [ [ NSAutoreleasePool alloc ] init ];
int AppReturn;
AppReturn = UIApplicationMain( argc, argv, [YourAppLicationName class] );
return AppReturn;
[ pool release ];
}

Finally, I suggest a Makefile like that when you try to compile icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

CC = /usr/local/bin/arm-apple-darwin-gcc-4.0.1
CFLAGS =  \
-I"/usr/local/arm-apple-darwin/include/"  \
-I"/usr/local/lib/gcc/arm-apple-darwin/4.0.1/include/" \
-fobjc-abi-version=2 \
 
LD=$(CC)
LDFLAGS = \
-fobjc-abi-version=2 \
-lobjc  -lstdc++.6 -licucore -llockdown -lz.1 -lxml2.2 \
-framework CoreFoundation       \
-framework Foundation   \
-framework UIKit        \
-L"/usr/local/share/iphone-filesystem/usr/lib/" \
-F"/usr/local/share/iphone-filesystem/System/Library/Frameworks/"       \
-bind_at_load
 
App=YourAppName
 
all:    $(App)
 
$(App): main.o YourAppName.o
$(LD) $(LDFLAGS) -o $@ $^
 
%.o:    %.m
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
 
clean:
rm -f *.o $(App)

Now, it’s all icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

Good compiling icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x

Salvatore vs. iPhone 1 – 0 :)

Ebbene si, sono emozionatissimo !!!!

Dopo mille mila ore dedite al coding matto e disperato, sono riuscito finalmente a compilare correttamente la toolchain nativa per iPhone su MacOSX 10.5.x  e, cosa ancora più incommensurabilmente incommensurabile, a compilare, a linkare ed a far girare (GULP!!!!!) il primo programma su quel coso fetuso di iPhone 2.0.1 icon smile Salvatore vs. iPhone 1   0 :)

Ovviamente, fra qualche ora aggiornerò il post con i comandi utilizzati per il toolchain ed i tips (una marea…) per “correggere” le applicazioni in modo che non diano mille mila trap error sul “melacosino”… icon smile Salvatore vs. iPhone 1   0 :)

Stay TUNED !!!!!

Beta Testing

Hui geek guys icon smile Beta Testing
have you ever dreamed to be beta testers for a revolutionary new software or a new exciting game ???
OK !!! This is a list of sites offering open and closed beta testing of applications, games, OS.

Opera Software – http://snapshot.opera.com/
Adobe – http://labs.adobe.com/
Mozilla – http://labs.mozilla.com/

Tell me about unpublished links !!!!!

How to purge unused debian conf files

After you uninstall some .deb packages, you need to completely erase all unused configuration files.
You can use one line command like that:

dpkg -l | grep “^rc” | awk -F’ ‘ {‘print $2′} | xargs dpkg –purge

Enjoy your debian icon smile How to purge unused debian conf files

« go backkeep looking »