Posts

Showing posts with the label compile

C code tidbits.

Image
Just like there are many verbal languages for speaking i.e. English, Spanish, Italian or etc.,  computers have their own languages also. Most people understand a verbal language  without having to do any translation. For computers that can be different. So if you want to use a language on a computer, some translation will need to be done to convert the commands (aka source code) to the ones and zeroes a computer understands. This is called compiling. There are a zillion languages that can be used, but one of the most common is "C" pronounced "see". "C" was made famous by Dennis Ritchie and Brian Kernighan also know and K&R. Even if you are not a programmer, you will get the urge to create your own program. This usually happens when you seen some code on a web page or in a magazine that you just have to try. So then every once in a while you may actually need to create a simple program either for testing a system or just to create a quick utility. M...

Build your own web server software.

Image
You can download the source code from IBM. Link is below. $ mkdir nweb $ cd nweb Download and extract the tar file $ tar zxvf es-nweb.tar Compile $ gcc nweb.c -o nweb (Compiles quickly) nweb port [directory} and run in background: (I just used the current directory for testing) $ nweb 8181 . & Point to it from a browser. Actually I used the web directory on my existing web server to see what I would get.). IBM suggests.   $ mkdir /home/nag/webpages $ cd /home/nag/webpages $ cp /tmp/nweb.tar . $ tar xvf nweb.tar $ ls client.c index.html nigel.jpg nweb.c nweb_AIX51 nweb_RedHat9_pentium nweb_SuSE_SLES8_PowerPC $ chmod ugo+x nweb $ chmod ugo+r *.html *.jpg $ nweb 8181 /home/nag/webpages & More information here and the download at: https://www.ibm.com/developerworks/systems/library/es-nweb/index.html

Build your own web server software.

Image
You can download the source code from IBM. Link is below. $ mkdir nweb $ cd nweb Download and extract the tar file $ tar zxvf es-nweb.tar Compile $ gcc nweb.c -o nweb (Compiles quickly) nweb port [directory} and run in background: (I just used the current directory for testing) $ nweb 8181 . & Point to it from a browser. Actually I used the web directory on my existing web server to see what I would get.). IBM suggests.   $ mkdir /home/nag/webpages $ cd /home/nag/webpages $ cp /tmp/nweb.tar . $ tar xvf nweb.tar $ ls client.c index.html nigel.jpg nweb.c nweb_AIX51 nweb_RedHat9_pentium nweb_SuSE_SLES8_PowerPC $ chmod ugo+x nweb $ chmod ugo+r *.html *.jpg $ nweb 8181 /home/nag/webpages & More information here and the download at: https://www.ibm.com/developerworks/systems/library/es-nweb/index.html