Archive for the ‘code’ Category

Create static executable from shared one

February 9, 2008

Did you get an error, like this one, when you tried to run an executable:

./MyOldBinFile: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

This happens to you if you try to execute an old dynamically linked executable, whose library dependencies are missing. Here is how you would have to fix it. Use the command ldd <binFile>, to identify missing shared libraries. Find them online or on other machines and copy them onto your’s. That should do it. Moreover, go one step further and use a software like Ermine OR statifier to create a statically linked executable from a dynamically linked one.

./ErwinePro.i386 MyOldBinFile –output=MyOldBinFile_Static

Seven Habits for Effective Text Editing

April 25, 2007

By none other than Bram Moolenar, the creator of Vim (improved VI editor)

10 more good UNIX usage tips

December 16, 2006

Level: Intermediate
Michael Stutz (stutz@dsl.org), Author, Consultant
12 Dec 2006

“Adopt 10 good habits that improve your UNIX® command line efficiency and break away from bad usage patterns in the process. This article takes you step-by-step through several good, but too often neglected, techniques for command-line operations. Learn about common errors and how to overcome them, so you can learn exactly why these UNIX habits are worth picking up. “
Commands covered: mkdir, tar, xarg, grep, awk
..[more]..

Code to convert big Endian to little Endian

November 19, 2006

// This code converts big Endian to little Endian and vice-versa

// similar code for float as well.

int swapEndianInt( int bEnum )
{

int lEnum;
char *lE = (char*) &lEnum;
char *bE = (char*) &bEnum;
lE[0] = bE[3];
lE[1] = bE[2];
lE[2] = bE[1];
lE[3] = bE[0];
return lEnum;

}