Tuesday, August 22, 2006

Getting the gcc/g++ compiler #define-s

I was doing 64 bit migration and wanted to know more about gcc/g++ compiler #define-s. One of my friend Homolka Richard gave me a very nice tip. Alias the whole thing!


alias whatg++='echo "main(){}" | g++ -E -x c++ -dM - '
alias whatgcc='echo "main(){}" | gcc -E -x c -dM - '


So running whatg++ from now on will list all the compiler #define-s something like this...


#define __HAVE_BUILTIN_SETJMP__ 1
#define __unix__ 1
#define unix 1
#define __i386__ 1
#define __SIZE_TYPE__ unsigned int
#define __ELF__ 1
#define __GNUC_PATCHLEVEL__ 3
#define __linux 1
#define __unix 1
#define __linux__ 1
#define __USER_LABEL_PREFIX__
#define linux 1
#define __STDC_HOSTED__ 1
#define __EXCEPTIONS 1
#define __GXX_WEAK__ 1
#define __WCHAR_TYPE__ long int
#define __gnu_linux__ 1
#define __WINT_TYPE__ unsigned int
#define __GNUC__ 3
#define __cplusplus 1
#define __DEPRECATED 1
#define __GNUG__ 3
#define __GXX_ABI_VERSION 102
#define i386 1
#define __GNUC_MINOR__ 2
#define __STDC__ 1
#define __PTRDIFF_TYPE__ int
#define __tune_i386__ 1
#define __REGISTER_PREFIX__
#define __NO_INLINE__ 1
#define _GNU_SOURCE 1
#define __i386 1
#define __VERSION__ "3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)"

Wednesday, August 16, 2006

IMAP through SSL using pine

I have a unix/mail account on a external BSD server. Being a great fan of text mode I use fetchmail to retrieve the mails to my local linux machine and run elm or pine depending on my mood. But my mail server being too restictive on the smtp side, I couldn't hit reply on my local machine and send a reply or send a new mail. Relaying was denied. I could have used a different smtp server of course. But I wanted a simple solution.

So I setup pine on my local machine to do IMAP to my server and things are suddenly rosier. My local copy of pine works on the IMAP folders on my server. I only do fetchmail once in a week for archiving purposes.

The pine configuration is really simple...
Goto "Setup"->"Configuration"
Set 'inbox-path' to
'{mail.foo.com/ssl}INBOX'. Since my server requires a ssl connection todo IMAP.

If your server doesn't support ssl you can replace "ssl" with "notls". I also set the smtp-server to
mail.foo.com

Sunday, August 13, 2006

Making firefox java plug-in work on AMD64

It is frustrating not have the firefox java plugin for AMD64. So living with that handicap for almost a year...finaly I decided to put a end to it.

With little browsing I found the black-down java distribution supports the 64 bit java plugin. I downloaded the distribution from here.

After downloading I executed the installer

sh j2re-1.4.2-03-linux-amd64.bin

This creates a subdirectory "j2re1.4.2". Move this to /usr/java

sudo mv j2re1.4.2 /usr/java/

Now create a softlink to the java plugin from firefox plugins directory...

ln -s /usr/java/j2re1.4.2/plugin/amd64/mozilla/libjavaplugin_oji.so /usr/lib64/mozilla/plugins/

Restart firefox and type "about:plugins" to confirm proper installation.