, 100 linux tips and tricks 

[ Pobierz całość w formacie PDF ]
.108 100 Linux Tips and TricksTip 12: Free software and copyleftMost software programs under Linux come under the GPL license.The so-called copyleft agreement.It maybe confusing to new Linux programmers.Here are the main features of the license, and why you may or maynot want to use it for your programs.The full license is available from the GNU site at http://www.gnu.org.The GPL license provides software free.Not as in free of charge, but in freedom.You can charge money forfree software or software under the GPL.What you can't do is restrict its use.You must provide source code, or a way for the user to have access to that source code.This means that ifyou release a program as a binary only, it can't be under the GPL license and may not contain GPL code fromother people.If you use code available from other people under the GPL license, you can modify it and redistribute it underthe same license, with source code.Also, you must keep the previous copyright notices, and write down inthe program what changes you have made to it.This also means that anyone can modify your programs, aslong as they keep your copyright notices there, and release their modifications under the same license.109 100 Linux Tips and TricksTip 13: Talking to the terminalUnder DOS, or other text based systems, there is only one way in and one way out.Under Linux and everyUnix system, there is one way in but two ways out.The terminal has 2 outputs, one for standard output and one for errors.By default, they both display on thesame device: your monitor.But they can be redirected, for example, to different logs.This is why it'simportant for you to use them properly.The standard output is called stdout, and printing to it will print to the screen, or where it is redirected.In C, itmay look like this:fprintf(stdout, "Test\n");The standard error is called stderr:fprintf(stderr, "Error\n");To input, you need to read from the standard input, called stdin.They are all available to you from the stdio.hfile.110 100 Linux Tips and TricksTip 14: Internet technologiesThe Internet is of course a big phenomena, and Linux is a big part of it.Linux servers are very popular, andyou can be a part of this revolution.Among available technologies, here are the most popular ones:" Java - The Java language is a new and powerful language made to be cross-platform.Since theWeb must be available on all systems, this makes Java a very powerful tool.You can makeJava applets that will run on the user's system and display information or interact with him." JavaScript - This is similar to Java, but in a Web page itself.It is embedded in HTML, to dosmall functions like rollover scripts, and making text appear on the screen." CGI - The CGI protocol is very much in use for servers with some sort of account system, likeonline shops and search engines.You can make CGI scripts in any language, and make yourWeb server run them on the server.111 100 Linux Tips and TricksTip 15: Library typesTwo types of libraries exist on most operating systems: shared and static.On Windows, they are.DLL, fordynamically linked library, and.LIB for static library.On Linux and most Unix, they are.so and.a files.The shared libraries, the.so files, are loaded at runtime.The.a files, or static libraries, are loaded at compile time and are no longer required to run the binaryprogram.When you make a program, you must decide if you will link it to a static library or a shared one.You willwant a shared library in most cases because standard libraries are available on most systems, and would betoo big to include in a binary file.If you have a small library that is not one of the standard ones that you need, then you may decide to includeit in your binary program.In that case, simply add it like any other object file in your compilation:cc -o program file1.o file2.o library.a112 [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • anikol.xlx.pl