newbiedoc-0.8.0/0000755000175000017500000000000011257632646012474 5ustar chrischrisnewbiedoc-0.8.0/INSTALL0000644000175000017500000000321111257615362013516 0ustar chrischrisINSTALL v 0.8.0 2009/09/27 Chris Lale chrislale@users.berlios.de These are the instructions for installing the newbiedoc package on a Debian GNU/Linux system using the tarball newbiedoc-0.8.0.tar.gz as source. Overview -------- The installation process is governed by a Makefile and involves some helper scripts. "make all" invokes the "download", "createweb" and "modify" scripts. The resulting directory structure and files are already included in the package (subdirectory newbiedoc.berlios.de). There is no need to repeat this process. In fact, it is not recommended since the wiki is constantly changing and the "newbiedoc-urls.txt" may stop corresponding with the index page on the wiki. "download" is used to download pages specified in "newbiedoc-urls.txt" from the NewbieDOC wiki (http://newbiedoc.berlios.de). "modify" strips out wiki functionality from the downloaded pages using sed and the rules in "newbiedoc.sed". "createweb" uses "modify", "find" and "rename" to create the local website. "make install" places an executable script "newbiedoc" in /usr/bin and the documentation files in /usr/share/doc/newbiedoc/. "make uninstall" removes the executable script "newbiedoc" from /usr/bin and the directory /usr/share/doc/newbiedoc/ and its contents. How to install -------------- Untar the package to a working directory eg $ tar -xzvf newbiedoc-0.8.0.tar.gz Move to the resulting directory: $ cd newbiedoc-0.8.0 Run "make install" as user root: # make install How to uninstall ---------------- Move to the directory containing the Makefile: $ cd /path/to/package/files/newbiedoc-0.8.0 Run "make uninstall" as user root: # make uninstall newbiedoc-0.8.0/LICENCE0000644000175000017500000000174310724633313013454 0ustar chrischrisLICENCE v 0.7.0 2007/11/15 Licences -------- The NewbieDOC articles are all available under a Free licence. Most are available under the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. Some are available under the GNU GPL and some are dual licenced. Dual licencing is generally specified when an author wishes to include the material in another project which does not accept the GNU FDL (eg the Debian Reference manual). The images are all available under Free licences. They are variously available under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) and the GNU GPL (http://www.gnu.org/copyleft/gpl.html). Sometimes thay are dual licenced with other licences. Each image is linked to an information page on the NewbieDOC wiki which includes details of the licence(s). The scripts are all available under the GNU GPL. newbiedoc-0.8.0/LICENCE-FDL0000644000175000017500000004766310724633313014072 0ustar chrischris GNU Free Documentation License Version 1.2, November 2002 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. newbiedoc-0.8.0/LICENCE-GPL0000644000175000017500000010451310724633313014073 0ustar chrischris GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . newbiedoc-0.8.0/Makefile0000644000175000017500000000321411257612764014133 0ustar chrischris# Makefile for creating newbiedoc package # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . install: install -d $(DESTDIR)/usr/share/doc/newbiedoc/newbiedoc.berlios.de install -d $(DESTDIR)/usr/share/doc/newbiedoc/newbiedoc.berlios.de/images install -d $(DESTDIR)/usr/share/doc/newbiedoc/newbiedoc.berlios.de/wiki cp -aR newbiedoc.berlios.de/* $(DESTDIR)/usr/share/doc/newbiedoc/newbiedoc.berlios.de cp newbiedoc $(DESTDIR)/usr/bin cp newbiedoc-icon.png $(DESTDIR)/usr/share/doc/newbiedoc/newbiedoc.berlios.de/images uninstall: rm -r $(DESTDIR)/usr/share/doc/newbiedoc/ rm $(DESTDIR)/usr/bin/newbiedoc all: # Invoke the download, and modify scripts and find to download # and modify pages from the NewbieDOC wiki and construct a stand-alone # non-interactive website from them. # # Download wiki pages and linked files, eg images. ./download # Find the wiki pages and convert them to standalone html # and remove original unconverted wiki pages ./createweb newbiedoc-0.8.0/README0000644000175000017500000000137311257613050013344 0ustar chrischrisREADME v 0.8.0 2009/09/27 Chris Lale chrislale@users.berlios.de NewbieDOC snapshot ================== This is a snapshot of major articles downloaded from the NewbieDOC wiki (http://newbiedoc.berlios.de). They have been used to construct a stand-alone website without the wiki functionality. The NewbieDOC project --------------------- "Debian for newbies by newbies (and not-so-newbies)". The aim of the NewbieDOC project is to encourage Debian newbies (newcomers) to document their experiences of Debian GNU/Linux in order to help future newbies. The wiki (http://newbiedoc.berlios.de) is very easy to use. All Debian users are encouraged to create, amend and comment on material in the wiki pages so that the documentation is maintained at a high quality. newbiedoc-0.8.0/createweb0000755000175000017500000000325211257613000014344 0ustar chrischris#!/bin/sh # createweb # Modify pages downloaded from the NewbieDOC wiki and construct a stand-alone # non-interactive website from them. # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Find the wiki pages and convert them to standalone html # Add .tmp extension find ./newbiedoc.berlios.de/wiki/ -type f -exec mv '{}' '{}'.tmp \; # Modify the HTML and add .html extension find ./newbiedoc.berlios.de/wiki/ -type f -regex "./newbie.*/wiki/.*\.tmp$" -exec ./modify '{}' \; # Replace .tmp.htl extension with .html find ./newbiedoc.berlios.de/wiki/ -type f -regex "./newbie.*/wiki/.*\.tmp\.html$" -exec rename 's/\.tmp\.html$/\.html/' '{}' \; # Remove original unconverted wiki pages find ./newbiedoc.berlios.de/wiki/ -type f -regex "./newbie.*/wiki/.*\.tmp$" -delete #find ./newbiedoc.berlios.de/wiki/ -type f -regex "./newbie.*/wiki/.*[)]$" -delete # Remove unwanted skins directory find . -type d -regex "./newbie.*/skins" -exec rm -R '{}' \; #Tidy up find . -type f -regex "./newbie.*/wiki\?.*" -delete newbiedoc-0.8.0/newbiedoc.1.gz0000644000175000017500000000200611257627660015132 0ustar chrischris‹°/¿Jnewbiedoc.1UÁnÛF½ó+>Å­Dǹ¤£Š¬TlI•¦|Y’Cqã%—Ø]Záß÷í’”%·E‹êÂ%göÍÌ›7£øñ‚þÓoÅÝ„–óE2£éSª. Šb@|’Æ:j„;6ZÏ–²¥nUN)“PŠ2ÑØàp¦ëüÔ=Y.vw›õéëéOªD‡ãáŠl›ZΜÔu@Юdó`I˜C8Ÿ‘eÆÍúÍûËIx^_FñnEëå×wËÛÍ‚®éâÝ{W"‘Æq•êÝÛ·?_è­ba–kQ’+¥¥\8$QrÍÏp5ü,­¬÷°…0Øsì¯öµéŠ)pS‰Ìh;¡Bû;®3ž§¸.G^siEª˜Ê®Aq¬0.»ÑŸÿÖCä¤zÅ…#Ÿ¯,º£-ímÃgršRÐÖû Ðoä¾tÈÒìem‡´Š×iR)ÔÚ› ù*¥3kjF+ðØ8‚‰)5,žzÛЇúæÄ¡þñš¸j\\û<[©SÛp& ™©|il'« ²¨æC*9×=Né–S)jÂ[[qíY²÷²”vã1ÉëÍ6¹K¢ø#‘"Ôröá±ØúZ9\¹]&‹Ïw[¯×hçåŒZ¡È§|ŒŒHFr¡:¯’sðLW¸‘Ç´ƒ~£÷ñ™Ed+?463²ñ:ެÈn âYé<Áú6CKѵF‰ÎiÊ:çï}Vº_Ö!‚€3‚¢FdO^Ä´iü;ÂbÖ[Sß„PÕ7&èØO‹×–n¸FÈà6¤†·ÛWµP(«ý€›’S – £«pwè ’kG¸ßé+jÑJ:‹qyÈÁmzƒÅ¤ÿ<ׇý‡Z Ô°Eå‹YíîC3.³²7 ÄûªÔndï'k Ú§¥ì·AŽå ÀBî5vRIä‡ý$tüjŽé7l<òI’p¾®Ò¹fvuud,ÆrRRÛ8çÈë8ìÅÞž°,ÒÁlÀ(‹Ðµƒ´¥o –¬32m]hëÕÖÇÞQA :ÂÎ +¢µÁº²Çû°]±½ ;È$÷~¢u¥Æâæ5 ´ÈsòÂÒ¢A¬2SaÒÐ¥µ/4@º•Î2¬rþÞ(™IÏ'žŒýx”@C!ÊÑ´W:õ2¥"ïYùuý…>,ˆÛ³>Ý÷W-ú‰_.i~Ÿl¢ÝÙDŒl`Ìþ­#ÒüËnµùpÚÆ:,ºŠ,8Êødåøy>H Ãê0"(jQºœ™?+iÑ,•â<ÎtÜ>ÝôIÿeÇü_¸ÉQACs9ÐhÄÿÕú©læÃ?¬½Œ£?˜Å"newbiedoc-0.8.0/download0000755000175000017500000000202011257612772014221 0ustar chrischris#!/bin/sh # download # Downloads NewbieDOC wiki pages and images etc from the web links # in the file newbiedoc-urls. # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # download all necessary files (-p) # convert links for local viewing (--convert-links) # get urls from text file (-i) wget -p --quota=0 --convert-links -i newbiedoc-urls.txt newbiedoc-0.8.0/modify0000755000175000017500000000205211257613131013674 0ustar chrischris#!/bin/sh # modify # Takes a filename with no extension as a parameter. # Invokes sed with the commands in the file newbiedoc.sed # to strip out unwanted MediaWiki HTML and modify links. # Saves the result using the filename with a .html extension. # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #cat $1|sed -f newbiedoc.sed>$1.html cat $1|sed -f newbiedoc.sed>$1 newbiedoc-0.8.0/newbiedoc0000755000175000017500000000333611257613216014356 0ustar chrischris#!/bin/sh # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Which browser will we use? # Text-based browser? if [ "$DISPLAY" = "" ]; then if [ -x /usr/bin/lynx ]; then BROWSER=lynx elif [ -x /usr/bin/elinks ]; then BROWSER=elinks else echo "newbiedoc: no text-based WWW browser found." exit fi # X11 browser? else BROWSER2=`which $BROWSER` if [ $? -eq 0 ]; then BROWSER=$BROWSER2 elif [ -x /usr/bin/iceweasel ]; then BROWSER=iceweasel elif [ -x /usr/bin/firefox ]; then BROWSER=firefox elif [ -x /usr/bin/galeon ]; then BROWSER=galeon elif [ -x /usr/bin/konqueror ]; then BROWSER=konqueror else echo "newbiedoc: no X11 WWW browser found." echo ' Install a browser or use $BROWSER.' echo ' Using text-based lynx instead' BROWSER=lynx fi fi # start browser or search engine echo -n "Starting ${BROWSER}"; DOCUMENT='/usr/share/doc/newbiedoc/newbiedoc.berlios.de/wiki/Index.html' if [ "$1" = "" ]; then $BROWSER $DOCUMENT; else $BROWSER $1 fi newbiedoc-0.8.0/newbiedoc-icon.png0000644000175000017500000000417610724633313016065 0ustar chrischris‰PNG  IHDR$ z‘ÚŽbKGDÿÿÿ ½§“ pHYs  šœtIME×  *à“ÓtEXtCommentCreated with The GIMPïd%nâIDATXõ—kŒ]UÇë<ïûÎûÕam)¡¨tZZ bD  2T4˜Œ†O|±š öAƒMC DQ±*AJJ¡¥µØ)L;­3vfîíÌ;÷Ì}}¶¦ 35Îú¸ÎÙ{ý²×ÞÿÿÞÂc%÷‰`¬2ûJ ½`lñ zAÄ ¬WSæMÓA¾äcÜ.PíÃÁóPO ¢Oö°eÖ:æ\Z¹b™‰<øþ)p¹¾© 9®$7Œus€\ƃôšÐ•ø"€WÙWú¿uqŸaa<Ô+‚î]lúÝ*.yÃÃXeÂW€við‘[¹HÁvy¸‡;Z踭ûN²op¶ZÖ\€ŽX¨ ½=l> pgÀ Ümb\¨+‚Lc±‹D*C;ØPH¼Y±!‚xs©%œc¬ä^L×m²Å¸­C>úŵÅÉ#²M/çþÊ0Üf£ /ç ìeSp.óŸ3ÐUt7Fã¡ç_rÞ–cqdïÀž|Æ»7\Ÿr#öÆpȾ6š sdÿ‰cùBéP¯Íe3Ÿ ã\`V°N¹; -éþÉ-üà—wlHTu‘Êð]UÕ±¯Ý÷ØMÕë·?T½lõù-–ßñ1“çR㜀L‚jY½ê«ËW.¤qq×ßueÔ4¤3l[?n¹°å7t¨ŠróƒW×Õ.¨è²‘Žyª@7Gbî¢kn½¬AŒén¯ørGMÛÒÆ‹D¨¿øê%„c.K:[©k©Š†tÎÐ8ÆÂºÖªŠÚ¶ê™\Í‚J«qaM\ aIÇ‚óIšÕÄ#Qgé ºÍy2 !Q %ª¢3¹h>-"Ô4WhâELg¾€1@ ¿¬£X(ã¸6¹ÌT*Ÿ+LŒ ŒQ*úÓ°‰0Zë¨9Yü¨€??÷ÝöÍKêÔèÀxîÄG©ÁÍ?ú}³çYqãE|ýáµ(_¡¡\†`^€|Èú~@jhœ¿}ŸÉ1/ØõÒþ¡ìio°ÞûÛátuSÒÚõÒþª5·\ÆøpS$Á*ÎK˽̽§ž ï'³§½ÌŒÀj­Ý°)æKœìOqêX:Ö)‹by^VHàÈè‰Ì‰÷ÿþQ!ï•"©\êlB17n»V`¨o”¾}ƒ“^iÿ[lÑóT„Q™È¿û‡_î\$à¡3Ÿþ¥áp€íXÚÝïeR¹Ó&òö¼éÐ6zyY ñ0*€?Z°¡è‡ËE¿ üÀßó—C#¾ vú¨Ás©1ë ­ä^²µIäÒ:›/¨ZS·0¾8wDùšÑ£™ãFNih %¬Ü‚‹“˜¶)±³¡´Ûoó2Sß¿ŠîÝ 9(øc³­ü™À¨©D–Ú®±fÁÒºµUÍáÈù]MK5!ÇZîÙ‘ÙÑüéמ9Ô_µ ÞvéÍ­N¼Ú6S SÙÒ¨—.DFú&‚á¾ì±“¦ÿ”=]xEÁAA÷|ÆÞ€opOü(΂äÊè¨ _BnñÚ{:nV:!Ë´Öå‚WÊJ;NÈŽÖ´Ç­ôqÛ6H6…IŸ$PÊrbÊ”aJÉq­UÒÖTÖW¯m9ðB!Sr42X†mÄ+£C ¶îæÙ¢¬æþÐ¥¡õ°%Ã6T}[ÅÊ(L–²¥¼ï¼bĈ$CÑŽګÉi!žLM•>Øq<£_RE­uP¡˜W…k-×4GŽg> ÊØŸ¨wÜF¿nh]´´¿ÐÑy0`˜šú–’{æÇÃ5¸áèô~KTéX,‰3ÐW©[w}îÝvÈÑÄCšXèÑ;b-‹3‰ñù|NÊ@9ï1IS˜š4 i+w–äà{Ëý½møV@ð¤`\TÞýÈHK(ò)òό”¥Aëï­ß“ì\}ÂØñbëä¶Ç/÷šÛ‡Ü¦6ßmj#6û<”¿µ¶< œö`«1#Áý½íîK›ÏKÏõx:îD^÷Ê%­ªêu¸ª^‡-SiA"Áœ½ë×O^0–i )ôÏ Œ¬q”Í,@½hyý7›ÖØCÇŒìœT[-¨ÀËÊŒ-Œ§¤˜¬ö­P$˜Óý§ï¡ìË[—eÍö<ºçm6L ãQÄWÈãS^ØÛôØÊ¼R³»s(˜ÉjßʤdÆ8½¬©ÂÑÀ´ìÙW)‚§íòòùðx+þS{Ù¬f”zZ¬ü>²á½7–˜¯<_›šUQÌp,0½¬©Îæ2iËĵe»³?@_y¾6Õ÷A» òÔ1ŒÑOYGÏjý¢ÖæÁm¿X©ÒÃ|îÃÎv0"1meÒ–?s=QÕ'¤MÓúüê7²¿zü: ´ù®O°ým6ëÏ´Uð±~:1V÷Üúï^7Õ¼0å)}ê˜9å—%8uÜ-i(Ý\h×.,óâ/N%¡oȯÞßàßqÅ7'¯`ÊP ±­èX¶6ÛUÄ´Á#µ’›ˆ•d½à—>×:VðmÃB=`ÀÀøó4ˆ=.P Ó2ò«{}€½;/´TÞ/p@C$¡ÐŽ@`™Ps¦+•žP[wñ¬žÕ˺è1­gǘZOÑïð WÑ]òÀ²3öµß€Ÿ¿ÁƱ+Y‡Æ<.B@)CÐÆOyÙ¿Årh¬ÌTÃ¥IEND®B`‚newbiedoc-0.8.0/newbiedoc-logo.png0000644000175000017500000004544410724633313016100 0ustar chrischris‰PNG  IHDRIA ‰±bKGDÿÿÿ ½§“ pHYs  šœtIMEÖƒ‡ºjtEXtCommentCreated with The GIMPïd%n IDATxeJšµ7i3û\ôÿßÌÇ™¸ƒ\'° U !äþºþ¶Åžó;b ‚Bæ÷|É—Í;b ‚BæCõp}¤Ù‚Bÿÿýž9gH;b 9gH;b ƒ\';b œBÿÿ½ ;b9gHÿ‰üþ¾þ¹þëüüI Hÿÿ óãý“R(úwûÅœóþ¸ -(Ìú«þëü5\ÿÿ üþ¾Åœq>e©(üþ¾Åœqƒ\'½ ÿÿ æÿÿúwÇ™¸9gHÿ‰üüIÅžæ;b(þ‹}¤ÙCõcóùÿ—Cõpóôÿ«Ç™¸Ç™¸ÿÿØè=8&ÿOÿÿØÄŸ¿Òí/¸ûóùÿ±ý~Ç¿¿Òí/«æè ÿûöÌþË™©2= áͲ7i3É—Í;büùÚÅžó7i3;b ;bƒ\';b øo Uôÿ«ýžÅžæ9gHoÿÿæù‘Ç™¸;b#.VßÒæÅCõc}¤Ù#dWzôÿ«Í›„!4œ('4íæñïéòðßH/«ãÏú9gH3.°%1$ ïéóé+2äÎÌ8eh(f‰Sw_‹ªe ÿÿ øo;b 3;#·(€ªeŠ·n:U3i;b\:U38H+'A\6 U;bèJõó÷ lV ZoB-;$.øb9gHÿÿ óZoBRh?æè=RH-¨A\6 [|J".. HýG[ƒM; m—YHmìæð>N..;" "..ÿÿ 9gH5"..QU2>N.!.;0B' /H*úþ4ƒ\'ÿÿ '@V2.".."8",4 !¶ !%5-90.;""..4ÿþ "..',4 ' ;bû  (ü !  ! ìû$·žÆžöó÷¸¥Ê鱄 Ha<8H+ÞÒåÒíÙ祘ÂÛËâ/H*Pb:“pªÙÌáæšw­ÞÒåÒ€c¤õó÷Æ«ÍѸ։·l ëÿïȸÕÙÌáyI“ÅÞÒåÒÿÿÓÅÜÒõó÷¦‘¾äÙèÜôÿßðëóÔÌàÞÒåÒÿÿ ÞÒåÒÞÒåÒѸÖ÷òø¯®Üâ IDATìæàìÚÅÝÞÒåÒ"..õó÷ìæïäÙêùÚàÛËàìæðìçóìæïõó÷ÅžóûÒÙÌáÞÒåÒ"..ÜÒæÞÒåÒÌÅžæóÞÒåÒȸÕʹÔôÿßóþ¸ UÞÒåÒlI‘« ;ÿÿæÿÿ оÙ·Ì Uþþòù‘ÿÿØ Á¿ÚÞÒåÒæÉ—ÍÇ™¸æ(óûÅûŸ'¿¤Êøþ±ù‘øþ¤ÄÿóÆÿ˜¸æÞÒåÒäÙêÓÅÜÒóý¥þëóÿÿØÇÿš˜CõpÓÅÜÒóþ¸Åžó;bè=8B$.þëàñçÜîžüüpÄÿó<c(ùö-D(8ñèïúøçÜîÒóûýËþ¹ûÅÅžó;b èJR(ÿÿìýÿÒTx=pýØÁí¾˜ÍÒÿÿØýýqÿÿôÿ«v§Gƒùë–n¶iÿ'û8ÿ üþ¾þ¹ûÅÅžó;b þ;ýGBÿÿìýÿÒW†Dp!Y¹ii!/.øõú:b0!æÑõëáðäÓåúøçÜîÒüþ¾þ¹ûÅÅžó;bè=8Bùö:Y28-!ÄÛëàñ"5/NæÑõëáðäÓåáÔðÒüþ¾þ¹ûÒÅžæ;b ý[ÿËìû$% ;ÿÿÿÿìýÿÒTx=p/ éßü̦ÎDf9ýæÑõ¬ˆÃû8ÿ ÿÿØõÓðÿÛÜìû$Ýœ©ƒ\'¼ ªÌôÿßNh4ƒùñøóëöѼުúÿ $.)D!(?ѲåÞËççÜîÒÿÿìì/D"V  ²˜Ì} -(üüIÅžæ9gH|ÿÿ $.çÜîÒ(9.+M%­z¾Ò$.çÜîÒóCõc8ehiùÿ—àÿÑã×íASò8I%0 K"fîµÞšÜÔíïê÷È·é¿­ñúQ&ÿ K÷¿üþ¾Bùö¡ÌÉ& ¨Ðý)ü/ùö$,5Bm‹òðî¡÷\4_íÿ ôÿ«}¤ÙÇ™¸;bÒ5ÿÿ ÿ £‡Öm‹3®ÞòB˾Éä€d/¯Úb4Çÿ0æü‘Åžæãý“¸­f!˾äùöÜÔí˾äùX0ù‘ÅžóÝœ©ÿÿØ„d7í¯Úïê÷ðî÷d_üþ¾Ç™¸E÷~ü/“uÍȷ飇Öÿ óþ‹}¤Ùùÿ—¸­f!ðî÷ASò˾中f!ãý“Åžæý¥æb4ÇÈ·é„d7íÌÝœ©Åžó÷|ùX0˾äASò“uÍü/DöŠÉ—Íüþ¾d_ðî÷¿­ñ8Iðî÷¸­f!ùÿ—}¤Ùþ~óÿ b4Çb4Ç44Ír pIDATæý¥Åžóãý“ùX0˾ä8I¿­ñ˾äùX0÷|ÅžóÝœ©Ì„d7íðî÷ðî÷d_üþ¾É—Íüü}ü/£‡ÖùX0%0b4Çÿ óþ~8ehi€œšöÈ·é¿­ñý)ü/Ñã±ÞÉ/K"fî¨ÐASò8I€df úwÇ™¸@g·ÿÿµÞšK"fîÌÁšc÷|R"¾Ë¾ä˾ä˾äR"¾üü}8ehiæÿÿæùÿËàþëÉ—Í3e| Uùÿ—È›˜;b ü&ìû$û !'ù„Ç™¸;b œ(ÌÁšc9gHúþ4 !ôÿßÌÇ™¸èd—åùÏÌIEND®B`‚newbiedoc-0.8.0/newbiedoc-urls.txt0000644000175000017500000000641211257474517016163 0ustar chrischrishttp://newbiedoc.berlios.de/wiki/NewbieDOC:Index http://newbiedoc.berlios.de/wiki/NewbieDOC:Debian_basic_features http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_download_Debian_GNU/Linux_installation_CD/DVDs_with_Jigdo http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_install_Debian_GNU/Linux_on_your_computer http://newbiedoc.berlios.de/wiki/NewbieDOC:Installing_Debian_on_a_small_partition http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_try_out_Debian_GNU/Linux_without_installing_it http://newbiedoc.berlios.de/wiki/NewbieDOC:Aptitude_-_using_together_with_Synaptic_and_Apt-get http://newbiedoc.berlios.de/wiki/NewbieDOC:Unofficial_Debian_packages http://newbiedoc.berlios.de/wiki/NewbieDOC:Module-Assistant_-_using_upstream_tarballs http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_install_and_use_Debian_NewbieDOC_documents_on_your_computer http://newbiedoc.berlios.de/wiki/NewbieDOC:Commandline_shortcuts http://newbiedoc.berlios.de/wiki/NewbieDOC:Manage_users_and_groups http://newbiedoc.berlios.de/wiki/NewbieDOC:Run_a_program_as_a_different_user http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_configure_Sudo_to_run_programs_as_a_different_user http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_create_a_Grub_disc_to_boot_a_Debian_GNU/Linux_system http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_rescue_data_from_a_crashed_disk_on_a_Debian_GNU/Linux_system http://newbiedoc.berlios.de/wiki/NewbieDOC:Shutting_down_a_Debian_system http://newbiedoc.berlios.de/wiki/NewbieDOC:Cloning_a_hard_disc http://newbiedoc.berlios.de/wiki/NewbieDOC:Runlevels_introduction http://newbiedoc.berlios.de/wiki/NewbieDOC:Grep_Introduction http://newbiedoc.berlios.de/wiki/NewbieDOC:Process_management http://newbiedoc.berlios.de/wiki/NewbieDOC:Debian_help_system http://newbiedoc.berlios.de/wiki/NewbieDOC:Shortcuts_for_copying_and_pasting_text http://newbiedoc.berlios.de/wiki/NewbieDOC:Beginner%27s_guide_to_Vi_Improved_%28Vim%29 http://newbiedoc.berlios.de/wiki/NewbieDOC:Using_Joe_as_your_editor http://newbiedoc.berlios.de/wiki/NewbieDOC:Synchronising_laptop_and_desktop_files_using_Unison http://newbiedoc.berlios.de/wiki/NewbieDOC:Broadband_-_setting_up_an_ethernet_ADSL_modem/router http://newbiedoc.berlios.de/wiki/NewbieDOC:Setting_up_a_serial_modem_using_Wvdial http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_set_up_a_wireless_network_card_using_drivers_from_Debian_packages http://newbiedoc.berlios.de/wiki/NewbieDOC:Installing_Ndiswrapper_in_Debian http://newbiedoc.berlios.de/wiki/NewbieDOC:Setting_up_a_personal_firewall_on_Debian_using_Guarddog http://newbiedoc.berlios.de/wiki/NewbieDOC:Firewall_with_masquerading http://newbiedoc.berlios.de/wiki/NewbieDOC:Installing_Samba_Linux/Windows_networking http://newbiedoc.berlios.de/wiki/NewbieDOC:Mail_-_retrieving http://newbiedoc.berlios.de/wiki/NewbieDOC:Mail_-_sending http://newbiedoc.berlios.de/wiki/NewbieDOC:Using_RSS http://newbiedoc.berlios.de/wiki/NewbieDOC:Sound_in_Debian_GNU/Linux http://newbiedoc.berlios.de/wiki/NewbieDOC:Managing_a_Creative_Zen_mp3_jukebox_with_Gnomad2 http://newbiedoc.berlios.de/wiki/NewbieDOC:How_to_install_a_scanner_in_Debian_GNU-Linux_using_Sane http://newbiedoc.berlios.de/wiki/NewbieDOC:Setting_up_a_parallel_printer_using_CUPS http://newbiedoc.berlios.de/wiki/NewbieDOC:Getting_rid_of_broken_print_jobs_%28Debian_using_CUPS%29 newbiedoc-0.8.0/create-newbiedoc0000755000175000017500000000324111257613013015605 0ustar chrischris#!/bin/sh # Invoke the download, and modify scripts and find to download # and modify pages from the NewbieDOC wiki and construct a stand-alone # non-interactive website from them. # # Version 0.8 # Copyright 2007-2009 Chris Lale, GPL v3. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Download wiki pages and linked files, eg images. ./download # Remove :NewbieDOC from file and dir names find . -regex ./newbie.*/wiki/.* -exec rename 's/NewbieDOC://' {} \; # Find the wiki pages and convert them to standalone html #find . -type f -regex ./newbie.*/wiki/*[^\.html] -exec ./modify '{}' \; find . -regextype posix-basic -regex ./newbie.*/wiki/.* -type f -exec ./modify '{}' \; find . -regextype posix-basic -regex ./newbie.*/wiki/.* -type f -exec mv {} {}.html \; # Remove original unconverted wiki pages find . -type f -regex ./newbie.*/wiki/.*[^\.html] -delete # Remove other unwanted files find . -type f -regex ./newbie.*/wiki.title=.* -delete # Remove unwanted skins directory find . -type d -regex ./newbie.*/skins -exec rm -R '{}' \; newbiedoc-0.8.0/newbiedoc.sed0000644000175000017500000000510211257613274015122 0ustar chrischris# newbiedoc.sed # Creates a modified local version of a page from the NewbieDOC wiki. # Mediawiki 1.11.0 # # Version 0.8 # Copyright 2007-2009 Chris Lale. # chrislale@users.berlios.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Download pages from the NewbieDOC site using # wget -p --convert-links -i newbiedoc-urls.txt # Then run this script on each downloaded page. # Remove MediaWiki head scripts //,/skins\/common\/ajax.js?97/ d # Remove links to favicon, search box, navigation, creative commons action and gnu.org // d /



1 Third party packages

Many unofficial .debs are available from http://apt-get.org/

2 Backports

Packages in the Testing and Unstable distributions are often unavailable for the Stable distribution. You cannot install the Testing/Unstable packages because of dependency issues.

Packages at http://www.backports.org/ are compiled against libraries in the Stable distribution.

LAMP (Linux, Apache, Mysql, PHP) packages at http://dotdeb.org/ are compiled against libraries in the Stable distribution.

3 Installing third party packages and backports

3.1 Using the commandline to install individual packages

Download the .deb file and install from the commandline using dpkg as user root.

$ su
(enter root password)

# dpkg -i name-of-package.deb
# exit
$

Uninstall using the -r switch to remove the package.

$ su
(enter root password)

# dpkg -r name-of-package.deb
# exit
$

3.2 Adding a repository using Synaptic

If you are using Synaptic in the X Window System, you must add the repository to /etc/apt/sources.list using

Settings -> Repositories

Open the tab for

Third-Party Software

and click the

Add

button. Type or paste in (Ctrl-V) the appropriate line. For example, if you wished to backport Squeeze packages into Lenny from backports.org you would add the line

deb http://www.backports.org/debian lenny-backports main contrib non-free

Click on the

Add Source

button and then

Close

4 How to remove backports before Debian upgrade

If you are upgrading to a new version of Debian (eg Lenny -> Squeeze), you may wish to remove your backported packages first (since they cannot be upgraded).

4.1 Commandline

You can identify backported packages and remove them before upgrading. To find all the currently installed ('~i) packages from backports.org ('~Obackports'), run this search:

$ aptitude search '~i ~Obackports'

Remove the backports.

To find all the currently installed ('~i) packages not ('!') from debian.org ('~!Odebian'), run this search:

$ aptitude search '~i !~Odebian'

This will find all the unofficial packages on your system including locally installed packages.

For more information see Aptitude's command line reference in the README at /usr/share/doc/aptitude/README.

4.2 Synaptic

Remove backports.org from sources.list. They should all show up as "Installed (local or obsolete)". You can do this within Synaptic:

 Settings -> Repositories

Open the tab for

Third-Party Software

View the /etc/sources.list entries. Highlight the relevant entry, click the

Remove

button and

Close

Next, reload the package information.

Edit -> Reload Package Information

You have removed the repository, but the packages remain. Identify them and remove them. In the left-hand panel click on the "Status" button and choose "Installed (local or obsolete)"

Status -> Installed (local or obsolete)

Remove the packages.

5 Debian Multimedia

This repository is a must if you want to add functionality such as dealing with mp3 formats etc. There are instructions on the home page at http://debian-multimedia.org/. The best way to make use of the repository is to add it to your /etc/apt/sources.list. It is recommended that you also add the Debian Multimedia keyring to your system so that you can download and install packages, confident that they do not pose a security risk.

Download the debian-multimedia-keyring package from the loink on the home page at http://www.debian-multimedia.org/. For example,

http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb

Then install it as root:

$ su
(enter root password)

# dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
# exit
$

Finally add

deb http://www.debian-multimedia.org squeeze main

to /etc/apt/sources.list as described above in .html#Adding a repository using Synaptic.

6 Appendix A: Licence

Copyright (c) 2006-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated. newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Module-Assistant_-_using_upstream_tarballs.html0000644000175000017500000002716111257474724030742 0ustar chrischris Module-Assistant - using upstream tarballs - NewbieDOC

Module-Assistant - using upstream tarballs

From NewbieDOC

Andrewsw
(author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 17th January 2007 Revised by Andrewsw
Initial release.

Revision 1.1 22nd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Module-Assistant - using upstream tarballs


Abstract

This is a simple hack to use an upstream tarball with Debian's module-assistant for upstream tarballs using gspca-source as an example.

This issue has come up on debian-user a few times now in recent history (early 2007). The package gspca-source is the source code for building modules for a whole slew of webcams. Upstream has been keeping up a pretty good release pace that even sid has trouble keeping up with.

I needed drivers for a Logitech Notebook Webcam. A quick check of lsusb and the compatibility list showed that the camera was supported, but unfortunately in a new release than was available in sid.

Just to double check, I did an aptitude install gspca-source and built the modules with module-assistant. This confirmed that the camera was not recognised. So how to proceed?

Contents


1 Use the Source:

Download the source tarball from upstream. mv it to /usr/src and unpack it.

tar -xzf gspcav1-xxxx.tar.gz

It will unpack in /usr/src/ but needs to be in /usr/src/modules/ so mv it there. Or be smarter than me and unpack it there in the first place.

2 Get the appropriate packages:

aptitude install gspca-source

(this should bring in module-assistant too...). unpack gspca-source.tar.bz2 (its in /usr/src/)

tar -xjvf gspca-source.tar.bz2

3 Compare the two directories.

You'll see that there is only one difference between the two: the debian package has an additional sub-dir "debian". cp -a that "debian" sub-dir into the upstream source directory:

cp -a /usr/src/modules/gspca/debian /usr/src/modules/gspcav1-xxxx  # xxxx is the versioning info from upstream.

4 Get rid of the debian source directory

rm -rf /usr/src/modules/gspca  #CAREFUL!!

or you could mv it aside

mv /usr/src/modules/gspca /usr/src/modules/gspca-deb

5 rename the upstream directory:

mv /usr/src/modules/gspcav1-xxxx /usr/src/modules/gspca

5.1 rename the debian source tarball:

mv /usr/src/gspca-source.tar.bz2 /usr/src/gspca-source-orig.tar.bz2

6 ball up the modified upstream source:

cd /usr/src
tar -cjf gspca-source.tar.bz2 modules/gspca

7 Launch module-assistant and build away:

m-a build gspca-source  # I actually did it from the curses interace, so that's a guess

- or -

module-assistant # follow instructions on screen


This successfully built gspca modules using sid source package (version 1.0.4) and the upstream tarball (version 1.0.12). May not work for others... but its worth a shot.

Enjoy.

8 Appendix A: Licence

Copyright (c) 2007 Andrewsw

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_and_use_Debian_NewbieDOC_documents_on_your_computer.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_and_use_Debian_NewbieDOC_documents_on_your_0000644000175000017500000005101411257474724033106 0ustar chrischris How to install and use Debian NewbieDOC documents on your computer - NewbieDOC

How to install and use Debian NewbieDOC documents on your computer

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 28th November 2007 Revised by Chris Lale
Initial release.

Revision 1.1 26th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to install and use Debian NewbieDOC documents on your computer


Abstract

A snapshot of Debian NewbieDOC is available as a Debian package. You can install it on a Debian system and access the web pages using the "newbiedoc" command, from the Debian menu in X11 or using an online documentation reader such as "dhelp", "doccentral" or "dwww".


Contents


1 Install the newbiedoc package

1.1 Installing from the NewbieDOC project site

The newbiedoc package in the Debian Stable repository may be a little out of date. You can get the most recent version from http://developer.berlios.de/projects/newbiedoc/ .

First create a suitable directory (folder) in your Home directory for the downloaded file. If you are using the X Window System, you can do this with your file manager. Otherwise, use the command line in a terminal (or terminal window). Make the directory with mkdir.

$ mkdir -p ~/downloads/debs
 
Note
Note: 
The -p switch makes sure that any parent directories that don't exist are created. The tilde (~) starts the path at the root of your Home directory.
 

Visit the project site http://developer.berlios.de/projects/newbiedoc/ with your web browser to download the latest newbiedoc-deb release. The package file has the form newbiedoc_n.n.n-n_all.deb; for example, newbiedoc_0.7.0-1_all.deb. Download this file to the download directory you just created.

You must do the next bit from the command line. Change directory (cd) to the directory containing the downloaded .deb package.

 
Tip
Tip: 
You can use tab completion to fill in much of the path. Tap the "Tab" key after the first letter or two of each word in the path.
 
$ cd downloads/debs

Switch user (su) to user root.

$ su

Install the package using the Debian package manager dpkg.

 
Tip
Tip: 
You can use tab completion to fill in the package name.
 
# dpkg -i newbiedoc_0.7.0-1_all.deb

Selecting previously deselected package newbiedoc.
(Reading database ... 194453 files and directories currently installed.)
Unpacking newbiedoc (from newbiedoc_0.7.0-1_all.deb) ...
Setting up newbiedoc (0.7.0-1) ...
#
 
Important
Important: 
Switch back to normal user as soon as possible. This avoids accidental damage to your system.
# exit
 

The newbiedoc package is now installed. You can remove it with the usual tools (Apt, Aptitude or Synaptic), or you can use dpkg as user root.

# dpkg -r newbiedoc
 
Note
Note: 
To install the package with dpkg you supply the filename, to remove the package with dpkg you supply the package name.
 

2 Accessing the NewbieDOC documentation directly

You can see the NewbieDOC documents in a web browser. They are in the directory /usr/share/doc/newbiedoc. Use this URL:

file:///usr/share/doc/newbiedoc/newbiedoc.berlios.de/wiki/Index.html

There are a couple of shortcuts for doing this as follows.

2.1 From the command line

The newbiedoc command runs your favourite browser for X and opens the NewbieDOC Index file. If you are not using the X Window System, the newbiedoc command will open your favourite non-graphical browser instead.

$ newbiedoc
 
Tip
Tip: 
You can change your favourite browsers, as user root, using the commands update-alternatives --config x-www-browser and update-alternatives --config www-browser.
 

2.2 From the X Window System

You can run the newbiedoc command directly from the Debian menu. First make sure that the Debian menu is visible. You can do this in Gnome from The System menu:

System -> Preferences -Main Menu 

Make sure that Debian (in the Items list) is ticked. After this, Newbiedoc documents are always available from

Applications -> Debian -> Help -> NewbieDOC

3 Accessing the NewbieDOC documentation using online documentation systems

When you install the newbiedoc package, it registers the NewbieDOC documents with doc-base. The doc-base system makes documentation available to Debian's online documentation systems, currently doc-central, dhelp and dwww. Each of these systems depend on having a webserver (eg apache2) installed.

These online documentation systems allow you to view your Debian system's documentation (man pages, info files, READMEs, etc) in your web browser. All three systems have similar functionality. which one you use is a matter of personal preference. Only details for dwww are given here.

3.1 Using dwww

3.1.1 Installing the software

Install the dwww package using, for example, Apt, Aptitude or Synaptic. To be able to use dwww's search function, you must also install swish++ (the document indexing system). To install these packages from the command line you could enter this command as user root:

# aptitude install dwww swish++

3.1.2 Updating the database for dwww

You can index all the documentation registered with doc-base (including NewbieDOC) by running the dwww-index++ command as user root. This may take a while. The dwww-index++ command is also run automatically by cron every week.

# dwww-index++
 
Note
Note: 
Running dwww-index++ will not affect dwww's database of package information eg man pages. If you install new packages, update dwww's cache by running dwww-refresh-cache, as user root, to make sure that the package information is available.
# dwww-refresh-cache
 

3.1.3 Viewing the NewbieDOC documentation

Just as with the newbiedoc command, you can run dwww either from the command line

$ dwww

or from the Debian menu.

(Desktop's main menu) -> Debian -> Help -> Dwww

Your browser will display dwww's home page. You can find NewbieDOC documents in the registered documentation index.

For instance, to see a list of all NewbieDOC documents, type "newbiedoc" in the search box, select the last radio button ("registered documentation index") and click on the "Search" button.

dwww's home page.

Fig 1: dwww's home page.


4 Appendix A: Licence

Copyright (c) 2007-2009 Chris Lale. chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."


Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Commandline_shortcuts.html0000644000175000017500000002224511257474724024663 0ustar chrischris Commandline shortcuts - NewbieDOC

Commandline shortcuts

From NewbieDOC

Neo Phyte
(author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 8th February 2006 Revised by Neo Phyte
Initial release.

Revision 1.1 22nd November 2007 Revised by Chris Lale
Modified to include Revision History, Abstract and Appendix for Licence, so that a stable version can be included in the "newbiedoc" package.

Revision 1.2 26th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Commandline shortcuts


Abstract

Debian newbie help with tab completion, commandline history, copying and pasting text.


Contents


1 Tab completion

1.1 Commands

At the prompt, press the TAB key (twice if you get a beep) for a list of all possible commands.

$ (TAB BEEP TAB)
Display all 2177 possibilities? (y or n)

At the prompt, start typing a command, then press TAB after the first few letters. If several commands start with those letters, you get a list of all the commands.

$ ne (TAB BEEP TAB)
nepomuk-rcgen       netcat              netstat
nepomukserver       netkit-ftp          newaliases
nepomukservicestub  netmon_applet       newbiedoc/
neqn                net.samba3          newgrp
net                 net-snmp-config     newrole


If only one command starts with those letters, the whole command is inserted on the command line.

$ nets (TAB)
$ netstat

1.2 Paths

Start typing the path, then press TAB to complete part of the path (if there is more than one possibility) or the whole path (if it is unique).

# tail /va (TAB)
# tail /var/
# tail /var/lo (TAB BEEP TAB)
local  lock   log
# tail /var/log/sy (TAB)
# tail /var/log/syslog (BEEP)

The final BEEP indicates that there are more possibilities. Press TAB again to see what they are.

(TAB)
syslog       syslog.1.gz  syslog.3.gz  syslog.5.gz  
syslog.0     syslog.2.gz  syslog.4.gz  syslog.6.gz 

2 Commandline history

At the prompt, navigate through previous commands you have issued using the UP ARROW and DOWN ARROW keys. For instance, if the previous two commands were nano and ls:

$ (UP ARROW)
$ ls
$ ls (UP ARROW)
$ nano
$ nano (DOWN ARROW)
$ ls

3 Copy and paste

If you are using a terminal window in X, highlight text in the terminal (or anywhere else) using the mouse. Click to position the insertion point anywhere on the command line and paste with the middle mouse button. Alternatively use SHIFT-CTRL-C to copy and SHIFT-CTRL-V to paste.

4 Appendix A: Licence

Copyright (c) 2006 Neo Phyte

Copyright (c) 2007-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Manage_users_and_groups.html0000644000175000017500000004350211257474724025150 0ustar chrischris Manage users and groups - NewbieDOC

Manage users and groups

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revsion 1.0 31st January 2006 Revised by Chris Lale
Initial release.

Revsion 1.1 22nd November 2007 Revised by Chris Lale
Modified to include Revision History, Abstract and Appendix for Licence, so that a stable version can be included in the "newbiedoc" package.

Revsion 1.2 26th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Manage users and groups


Abstract

Brief newbie help about how to manage users and groups in Debian using Gnome, KDE, generic desktop and commandline tools.


Contents


1 Gnome desktop

You must install the gnome-system-tools package in order to manage users and groups in Gnome. Once installed, the Users and Groups menu item is available from the System menu.

  • System -> Administration -> Users and Groups

You will need the root password. The main Users Settings window shows a list of users. In order to to supply the root password you must click the Unlock button.

Unlock -> Password for root -> Authenticate

Operations are carried out by selecting items and clicking on buttons.

1.1 Users Settings

There are four buttons available:

  • Add User
  • Properties
  • Delete
  • Manage Groups

1.1.1 Add User

Account tab
Basic Settings
Username:
Real Name:
Contact Information (optional)
Password
Set password by hand
Generate random password
User Privileges tab
Advanced tab
Advanced Settings
Shell:
Home directory:
Main group:
User ID:

1.2 Manage Groups

The Add Group button is available at any time. The other buttons are greyed out unless a group is selected first. The buttons are

  • Add Group
  • Properties
  • Delete

1.2.1 Add Group/Properties dialogue

Group Name:
Group ID:
Group members:

2 KDE desktop

 
Note
Note: 
The following applies to Etch but may vary in Squeeze.
 
  • KDE Main Menu -> System -> User Manager

You will need the root password. There are two tabbed windows - one to manage users and one to manage groups. Operations are selected from the User menu and the Group menu.

2.1 Users tab

Menu operations available include

  • User -> Add
  • User -> Edit
  • User -> Delete
  • User -> Set Password

2.1.1 User Add/Edit dialogue

User Info
User login:
Set Password...
User ID:
Full name:
Login shell:
Home folder:
(optional contact information)
Account disabled
Password Management
Groups
Groups
Set as primary
Account disabled

2.2 Groups tab

Menu operations available include

  • Group -> Add
  • Group -> Edit
  • Group -> Delete

2.2.1 Group Add/Edit dialogue

Group number:
Group name:
Users in group: Remove
Users NOT in group: Add


3 Any window manager (generic)

You can use either of the above tools by installing the gnome-system-tools package (Gnome tool) or the kuser package (KDE tool). Each package will also install all the relevant libraries, but not the whole desktop.

Alternatively, you can install the webmin package available from http://prdownloads.sourceforge.net/webadmin/webmin_1.490_all.deb. You can install the downloaded package using dpkg.

$ su
(enter root password)

# dpkg -i name-of-package.deb
# exit
$

Accept the defaults during installation. You will then need the root password to access webmin.

3.1 Run Webmin

 
Note
Note: 
The details outlined below may vary in the latest version of webmin.
 

Open a browser and visit this URL:

https://localhost:10000/

Log into webmin using the root username and password.

3.2 Manage users and groups

Click on the System tab and then Users and Groups.

System tab
Users and Groups

3.2.1 Create or delete

There are two tables - Local Users and Local Groups. At the top of each table there is a link that enables you to create new users or groups. Each entry in a table has a checklist box that enables you to select user(s) or group(s). There is a button at the bottom of each table that allows you to delete selected users or groups.

3.2.2 Edit

Each user or group has a link that enables you to edit details

User Details
Username
User ID
Real name
Home directory
Shell
Password
Password Options
Group Membership
Primary groups
Secondary groups

4 Commandline

Run these commands from a terminal or a terminal window as root. Read the man pages first. Eg to read the manual for adduser:

$ man adduser
adduser
add a new user
usermod
modify a user's details
deluser
delete a user
chfn
change a user's full name
chsh
change a user's shell
passwd
change a user's password
chage
change how or when a user's password expires
groups
displays the groups of a specified user
addgroup
add a new group
groupmod
modify a group's details
delgroup
delete a group

4.1 Examples

4.1.1 Add a user

# adduser junk
Adding user `junk'...
Adding new group `junk' (1005).
Adding new user `junk' (1005) with group `junk'.
Creating home directory `/home/junk'.
Copying files from `/etc/skel'
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for junk
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [y/N] y
#

4.1.2 Delete a user

# deluser
Enter a username to remove: junk
Removing user `junk'...
done.
#


5 Appendix A: Licence

Copyright (c) 2006-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Run_a_program_as_a_different_user.html0000644000175000017500000002310311257474724027153 0ustar chrischris Run a program as a different user - NewbieDOC

Run a program as a different user

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 30th January 2006 Revised by Chris Lale
Initial release.

Revision 1.1 22nd November 2007 Revised by Chris Lale
Modified to include Revision History, Abstract and Appendix for Licence, so that a stable version can be included in the "newbiedoc" package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Run a program as a different user


Abstract

Help with using su, gksu and gksuexec - a guide for Debian newbie users and others.


Contents


1 Why switch user?

Sometimes, you will want to run a program user root. Some programs will only run if you are user root. Switching user enables you to log in as a normal, under-privileged user and run a particular program as root.

 
Warning
Warning: 
Avoid logging in as user root. Doing so would give all programs and processes complete access to the whole system. You could do a lot of damage accidentally and become vulnerable to a malicious attack. Switch user instead.
 

2 Running a GUI program as user root

Some desktops have gksuexec accessible from a menu. Alternatively, you can use the gksu command directly from the commandline in a terminal window. You will need to enter user root's password. The program (and only that program) will run as root. When the program is closed, you also exit from root automatically.

2.1 Gnome

  • Applications -> System Tools -> Run as different user
    • Run: (name of program)
    • As user: root
  • OK

(Requires gnomesu to be installed)

2.2 KDE

  • KDE Main Menu -> Run as different user
    • Run: (name of program)
    • As user: root
  • OK

(Requires kdesu to be installed)

2.3 X Desktop without a menu (generic)

Issue the gksu command from a terminal window.

$ gksu name of program

3 Running a commandline program as user root

Issue the su command to switch user to root

$ su
password: (enter root password here)
# name of program

When you have finished, close the program, then exit from user root at the commandline.

# exit
$


4 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_configure_Sudo_to_run_programs_as_a_different_user.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_configure_Sudo_to_run_programs_as_a_different_user.0000644000175000017500000006210611257474724033273 0ustar chrischris How to configure Sudo to run programs as a different user - NewbieDOC

How to configure Sudo to run programs as a different user

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 14th September 2004 Revised by Chris Lale
Initial release.

Revision 1.1 15th February 2007 Revised by Chris Lale
Converted to wikitext and added an example template for the sudoers file.

Revision 1.2 17th February 2007 Revised by Chris Lale
Added the missing Abstract.

Revision 1.3 19th March 2007 Revised by Chris Lale
Modified and corrected sudoers file structure section to improve clarity. Added a Comments section with a link to the article's discussion page.

Revision 1.4 22nd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package. Removed redundant link to the article's discussion page.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to configure Sudo to run programs as a different user


Abstract

This article explains how a normal user can use Sudo to run particular programs with root permissions. It explains how to configure Sudo using a simple table as an alternative to the Extended Backus-Naur Form used in the Sudoers man (5) page.


Contents


1 Who needs to know about Sudo?

You do not need to know anything about Sudo to run your PC normally. Being able to switch user using Su is quite sufficient. However, Sudo is a valuable tool for anyone who spends significant time administering a PC.

2 Overview

It's not Sudo so much as the Sudo manual that you have to wrestle with. It is written in a rather cryptic style. Hopefully you will find here all that you need to know about Sudo to manage your PC more efficiently. Sudo enables specific users to run specific programs as though they were another user -- normally as the Root user.

Sudo has a configuration file called /etc/sudoers. Sudo is a program that runs any other program as the Superuser or any other user specified in the /etc/sudoers file. This is especially useful for programs that can normally only be run by the root user; for example, installing or removing software.

It is unwise to try and use an ordinary text editor to compose or edit the Sudoers file. There is a customised version of Vi called Visudo which helps prevent you making dangerous changes to /etc/sudoers. Don't worry if you have not used Vi or any of its derivatives before. There instructions here should be enough to do the job.

One more thing -- you must either switch user to Root with Su, or log in as Root to be able to edit the Sudoers file.

3 The Sudoers file

3.1 Creating and modifying the Sudoers file

Sudo must be installed before you begin.

Here is the default Sudoers file which is created when you install the Sudo package.

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
#
# User privilege specification
root    ALL=(ALL) ALL

It has only one specification statement:

root    ALL=(ALL)ALL

This statement allows the Root user to run any command via Sudo.

3.2 Editing Sodoers with Visudo

You can configure Sudo by modifying the Sudoers file using Visudo. Visudo is installed on your system when you install the Sudo package. Switch to the Superuser with Su or login as the Root user. Open a terminal window if you are working in X.

First make a backup copy of /etc/sudoers. You can use a file manager to do the job. Alternatively, you can use the command line as follows. Change directory (cd) to /etc and list (ls) the existing Sudoers file sudoers. (You may also find sudoers.tmp if Visudo has been modified before, but Visudo normally deletes this file after a successful editing session.)

# cd /etc
# ls sudoers*
sudoers  sudoers.tmp

Make a copy of sudoers called sudoers.old.

# cp sudoers sudoers.old

Visudo is a derivative of the Vi text editor.

Run Visudo from a terminal or a terminal window in X.

# visudo

Visudo starts in command mode. You can check by looking in the bottom right-hand corner -- you should see "Command" in a red font. Change to insert mode by pressing i.

i

Check that the bottom right-hand corner has changed from "Command" to "Input". You can now move around the document using the arrow keys. You can delete a character under the cursor using the DEL key.

Add the User alias specification below, substituting your username for "chris".

# User alias specification
User_Alias MAINTAINERS = chris

Add the Cmnd alias specification as shown below.

# Cmnd alias specification
Cmnd_Alias DEB = /usr/sbin/synaptic, /usr/bin/aptitude, 
/usr/bin/apt-get

Finally, add a second line to the User privilege specification.

# User privilege specification
root ALL=(ALL) ALL
MAINTAINERS ALL = DEB

You must return to Command mode to save the changes and exit. Press the ESC key and check that "Command" has replaced "Input" in the bottom right-hand corner. Commands begin with a colon (:). The tables show you the commands that you are likely to need.

Command Result of issuing the command
:w Write to file (sudoers.tmp) and continue in Command mode.
:q Quit. (Will not quit unless you have saved changes.)
:wq Write to file (sudoers) and quit. (Sudoers.tmp is deleted.)
:q! Quit without saving changes.

Table 1: Some Visudo (Vim) commands

Command Result of issuing the command
Ctrl-O Write to file (sudoers.tmp) and continue in Command mode.
Ctrl-X Quit. (Prompts for save unless you have saved changes.)

Table 2: Some Visudo (Nano) commands

Save the amended file and quit.

:wq

3.3 What to do if the editing goes wrong

Don't worry if you end up with a file full of mistakes that you cannot correct. You still have your saved original version (sudoers.old). Preserve the messed-up file by copying it to a new file called sudoers.new. You are unlikely to need it again, but keep it as insurance in case you decide that you were right after all. Overwrite sudoers with sudoers.old.

# cp sudoers sudoers.new
# cp sudoers.bak sudoers

You are now back to square one with no harm done.

3.4 Testing Sudo

You can test Sudo by attempting to install a package from a terminal or a terminal window in X. This example uses the Nethack package. It does not matter whether Nethack is already installed or not. You can abort the installation if Nethack is already installed by holding down the CTRL key and pressing Z.

First, attempt to install Nethack as a normal user. You should be logged in as a normal user (with a $ prompt).

$ apt-get install nethack
E: Could not open lock file /var/lib/dpkg/lock - open 
(13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), 
are you root?
$

Next, switch user to Root and attempt to install Nethack. Remember that the superuser's prompt is "#".

$ su
Password: (enter password for user root)
# apt-get install nethack

If Nethack is not installed you will get message including this line:

The following NEW packages will be installed:

Otherwise you will get this message:

Sorry, nethack is already the newest version.

Finally, exit back to your normal user and use Sudo to run Apt-get. You will get the same messages if you have configured Sudo correctly. Remember that Nethack will ask you for you normal user's password.

# exit
$
$ sudo apt-get install nethack
Password: (enter password for normal user)
The following NEW packages will be installed:

or

Sorry, nethack is already the newest version.
$

If you did not get the same messages as before, go back and check the Sodoers file.

4 The structure of the Sudoers file

Here is an example of a Sudoers file.

# User alias specification
User_Alias MAINTAINERS = chris

# Cmnd alias specification
Cmnd_Alias DEB = /usr/sbin/synaptic, /usr/bin/aptitude, 
/usr/bin/apt-get

# User privilege specification
root ALL=(ALL) ALL
MAINTAINERS ALL = DEB

All lines starting with # are comments and are ignored. The other lines are statements.

The first statement sets up a collection of one or more users called MAINTAINERS. It is not the same thing as the group used in file permissions. It only means anything to Sudo. The statement also makes one user (chris) a member of MAINTAINERS.

The second statement sets up a collection of one or more commands called DEB. The statement also adds three commands to DEB.

The last two statements specify which users can run which programs with which privileges. The penultimate statement allows the Root user on all PCs to run all commands as any user. The last statement allows all MAINTAINERS on all PCs to run the commands collected in DEB as the Root user. (The Root user is the default when "(...)" is omitted.)

Both these statements are examples of the same general form:

User_Alias Host_Alias = (Runas_Alias) Authentication Cmnd_Alias

where the contents of the variables is shown in Table 3: Contents of the Sudoers variables.

Variable Contents of the variable Default value
User_Alias a user or collection of users none -must be specified
Host_Alias is a host (a specific computer on a network) or a

collection of hosts

none -must be specified
(Runas_Alias) the user to switch to when the command is run Root user
Authentication whether or not to ask for a password before the command is run ask for the real user's password
Cmnd_Alias the command (eg a program), or commands, allowed to be run as the run-as-user by the user none -must be specified

Table 3: Contents of the Sudoers variables

User names, host names, run-as-user names and commands are in their normal case (lower case). The collections of names or commands are all in upper case.

 
Note
Note: 
You can find your PC's host name with the command hostname.
 

The simplest Sudoers file statement would contain just three variables:

ALL ALL = ALL

This allows all users on all PCs to run all commands as the Root user, authenticated with the particular user's password. The two variables missing from the statement (Runas_Alias and Authentication) assume the default values. This would be a very dangerous statement. Don't use it!

The original Sudoers file is created when Sudo is installed. It contains this one statement with four variables:

root ALL = (ALL) ALL

The statement allows the Root user on all PCs to run all commands as any user. The missing variable (Authentication) assumes the default value. (The default is for Sudo to prompt for Root's password before running the requested command.)

The second user privilege statement in the example is

MAINTAINERS ALL = DEB

This statement allows any user in the MAINTAINERS collection to run certain commands on any PC. The user is allowed to run all the commands in the DEB collection as the Root user (Runas_Alias default) after suppling the user's normal password (Authentication default).

You could use this statement if the host is a networked PC:

MAINTAINERS mypc = DEB

It allows the same users to run the same programs, but only on the PC whose hostname is mypc.

You may find it easier to identify the variables in each statement by putting them into a table (see Table 4: Combining Sudoers variables into statements)

User_Alias Host_Alias = (Runas_Alias) Authentication Cmnd_Alias Comment
ALL ALL = ALL Dangerous - do not use this one!
root ALL = (ALL) ALL You should find this statement in most Sudoers files.
MAINTAINERS ALL = DEB Any user in MAINTAINERS can run any commands specified in DEB.
MAINTAINERS mypc = DEB Equivalent to previous example for a single computer with hostname "mypc".

Table 4: Combining Sudoers variables into statements

4.1 Example

This is how you fill in the table for the statement

root ALL = (ALL) ALL

The first two variables before the equals sign are compulsory, so you put root and ALL straight into the first two columns. The last statement is also compulsory, so ALL goes into the last column. This leaves one variable - (ALL) - to be placed. A variable in brackets belongs immediately after the equals sign. A variable without brackets belongs immediately before the final variable. In this case (ALL) goes immediately after the equals sign.

You can easily identify the aliases once you have filled in the table. The User_alias is root, the Host_alias is ALL and the Run_as alias is (ALL). Authentication is not specified, so the default will be used. Finally, the Cmnd_alias is ALL.

Table 5: Contents of collections (Sudo groups) shows the "Sudo groups" or collections

Alias type Collection (Sudo group) = Contents of the collection
Cmnd_alias DEB = /usr/sbin/synaptic, /usr/bin/aptitude, /usr/bin/apt-get
User_alias MAINTAINERS = chris

Table 5: Contents of collections (Sudo groups)

The DEB Sudo-group consistes of three commands which run the programs Synaptic, Aptitude and Apt-get. MAINTAINERS contains one user (chris). You could use the username itself if only that user needed to run the three commands. However, doing it this way allows you to add other users later.

4.2 A template for the Sudoers file

You can use comments to tabulate your Sudoers file and make it more understandable. Here is an example.

# sudoers file.
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.

# Host alias specification
# ========================

# User alias specification
# ========================
User_Alias MAINTAINERS = username
 
# Command alias specification
# ========================
Cmnd_Alias DEB = /usr/local/sbin/checkinstall
 
# User privilege specification
# ============================
# Format:
#
#--------------------------------------------------------------
# User_Alias   Host_Alias = (Runas_Alias)  Authent   Cmnd_Alias
#                                          -ication
# -------------------------------------------------------------
# compulsory   run on     = run as which   PASSWD:   compulsory
#              which        user (root     (default)
#              hosts        by default)    or      
#              (PCs)                       NOPASSWD: 
#-------------------------------------------------------------- 
#
root           ALL        =   (ALL)                      ALL
MAINTAINERS    ALL        =   (root)       PASSWD:       DEB

5 Appendix A: Licence

Copyright (c) 2004, 2007 Chris Lale. chrislale AT users DOT berlios DOT de

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Shutting_down_a_Debian_system.html0000644000175000017500000004036411257474725026324 0ustar chrischris Shutting down a Debian system - NewbieDOC

Shutting down a Debian system

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 1.0 10th February 2007 Revised by Chris Lale
Initial release

Version 1.1 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package; added Abstract and Licence appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Shutting down a Debian system


Abstract

Newbies often tend to press the RESET button to stop/restart a Debian system. This is the equivalent of pulling the plug - you are risking file corruption. Here is some help about how to shut down your Debian system safely.

Contents


1 Introduction

Pressing the RESET button is the equivalent of pulling the plug - you are risking file corruption. Here are some safer ways to shut down your system. Adapted from posts in a thread on the Debian-user list (http://lists.debian.org/debian-user/2007/02/msg01393.html). As with so much in GNU/Linux, there is more than one solution.


2 Shutting down from a console screen

You can use these methods even without being logged in.

2.1 Shutting down a local machine

If you are used to another operating system, you may know about the Ctrl-Alt-Del key combination. You must first switch to a virtual console (text only screen) before you can use this method for shutting down Debian.

Switch to one of the six virtual consoles (Ctrl-Alt-F1, Ctrl-Alt-F2, ..., Ctrl-Alt-F6) by holding down the Ctrl and Alt keys and tapping one of the function keys "F1" - "F6". At the console screen, issue the reboot key combination Ctrl-Alt-Del (ie hold down the "Ctrl" and "Alt" keys, and tap the "Del" or "Delete" key).

Ctrl-Alt-F1
Ctrl-Alt-Del 

Wait until the system shuts down and the restart begins,then power down the system. You can power down safely anytime before Grub begins to boot the system.

 
Tip
Tip: 
One of your first post-install tasks in Debian might be to comment out the "timeout 5" line in "\boot\grub\menu.lst". This will make sure that Grub does not boot until after you press the "Enter" key.

Alternatively, if you wish Grub to boot automatically but wish to be able to prevent the system from booting, change the delay from 5 seconds (which is much too

short) to 10 or 15 seconds.
 

2.2 Shutting down an unresponsive local machine

If a machine is really not responsive (which happens once in a while) you can try these three key combinations in sequence : Alt+SysRq+S, Alt+SysRq+U and Alt+SysRq+O. They synchronise the discs ("S"), unmount the discs ("U") and turn the system off ("O"). It is important that you issue all three commands in the correct order so that you avoid data corruption.

Alt+SysRq+S
SysRq: Emergency Sync
Emergency Sync complete

Alt+SysRq+U
SysRq: Emergency Remount R/O
Emergency Remount R/O complete

Alt+SysRq+O 
SysRq: Power off
Shutdown

This will minimize the chance of data loss but isn't a long term solution.

If you wish to reboot the system rather than shutting down, use Alt+SysRq+B instead of Alt+SysRq+O.

Alt+SysRq+B
Resetting

You can find out more about key combinations at http://linux.about.com/od/linux101/l/blnewbie5_1.htm .

3 Shutting down from a shell prompt

If you are logged in to a console you can shut the system down from the shell prompt. You can also use this method from a desktop environment by first obtaining a shell prompt by running a "Terminal" application.

3.1 Shutting down a local machine

At the prompt, switch user ("su") to user root (see also the talk/discussion page).

$ su
(enter root's password)
#

The standard way to shut down is to enter

# shutdown -h now

An alternative is to enter

# halt
The System is going down for halt now!

If you include the "-p" switch, the system will also poweroff.

# halt -p

If you wish to reboot rather than shutting down, use the "-r" switch instead.

# shutdown -r now

An alternative is to enter

# reboot

3.2 Shutting down a remote machine

If your machine is in a network and Debian has booted, you can access the machine by SSH from another machine in the network. Log in as user root via SSH, and shut it down using one of the "shutdown" commands (see .html#Shutting down from a shell prompt). This works even if the remote keyboard or screen have locked up.


4 Shutting down from a GUI environment

4.1 Shutting down from the login screen

After X starts, but before you have logged in, you should be presented with a graphical login screen. This is provided by the display manager. The default display manager is the Gnome Display Manager ("gdm"). There is an "Actions" menu with a "Shut down the computer" item. You can use this without logging in and without needing a password.

4.2 Shutting down from the Gnome desktop

Once logged into Gnome, you should find "Shut Down" in the "Desktop" menu in the top panel.

 
Note
Note: 
You can add a "shutdown" button to the panel by right-clicking on the panel.
 

4.3 Shutting down from the KDE desktop

Once logged into KDE, you can right click with the mouse pointer over the "desktop" (background), which produces a menu with a number of options, the one you want being "Log out user" (where user is replaced by your login name). This will bring up another window with four selections. "End Current Session" just logs you out, the next two will power down or reboot.


5 Modify the action of the POWER button

Provided your machine is ACPI compliant, install the package "acpid". It contains a script /etc/acpi/powerbtn.sh and a symbolic link to that (/etc/acpi/events/powerbutton). With that you can just hit the power button of your machine and your system will gracefully do a shutdown to halt and then power off.


6 Appendix A: Licence

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Mail_-_sending.html0000644000175000017500000004030711257474725023124 0ustar chrischris Mail - sending - NewbieDOC

Mail - sending

From NewbieDOC

Andrei Popescu
andreimpopescu at gmail dot com (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 9th February 2007 Revised by Andrei Popescu
Initial release.

Revision 1.1 27th November 2007 Revised by Andrei Popescu
Reformatted for newbiedoc package. Added Revision History, Abstract and License in Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Mail - sending


Abstract

Help for Debian newbies wanting to send mail using Postfix with smarthost configuration.


Contents


1 Motives

You can send mail directly with any modern mail client (like Sylpheed-Claws). Why would you need a SMTP server, also known as Mail Transport Agent (MTA)? One reason is that it can be annoying if you have a flaky connection/mail server. You can get timeouts, errors, ... Your MTA can take over the message (much faster, because it resides on the same computer) and it will take care of sending it. If you ever get an error response than something is really wrong. Another reason is that it makes sending mail very easy and some programs don't even need configuration. Examples would be the mail clients mutt and mailx or the program reportbug. You can even expand on this configuration and use it on a mail gateway at home.

 
Important
Important: 
This example setup is not suitable for a real internet mail server (with a proper host.domain). This is just for a home computer or mail gateway used for sending mail via a proper mail server provided by your ISP or similar service. For the receiving part I use getmail and will write a separate note for it.
 

2 Basic configuration

In Debian Etch we will need at least the package postfix and the package libsasl2-modules in case we need SMTP AUTH. Debian comes with exim as default MTA so we need to change this. (The same can be done with exim as well, but in my very personal oppinion, postfix is easier to configure).

aptitude install postfix libsasl2-modules

Aptitude will offer to remove exim (because it conflicts with postfix). Just say yes. (Note: libsasl2-modules might already be installed.) You should get a window with postfix configuration.

General type of configuration?

Choose "Internet with smarthost".

Mail name?

Accept the default which should be your host name.

SMTP relay host?

Insert your ISP's SMTP server:

smtp.example.com

If your ISP doesn't require SMTP AUTH then you are good to go. You can test like this:

mail your_username@your_hostname

You will be prompted for a subject. Write for example "test" and press enter. Write a few words, then enter . on a newline and press enter. You will again get a prompt for Cc: at which point you should press enter and your mail gets sent. It should look like this:

$ mail your_username@your_hostname
Subject: test local mail
Just some text
.
Cc:

If you just type 'mail' you should be able to see your test e-mail.

3 Address rewriting

Many providers are trying to reduce spam by rejecting mails from an inexistent domain. In order to send mails out on the internet we need to tell postfix to use the real mail address when sending. (Note: You could configure your client to set proper "From:" and "Envelope-From:" headers, but the purpose of this document is to create a client-independent setup).

As root edit /etc/postfix/main.cf and add following lines:

# Address rewriting
smtp_generic_maps = hash:/etc/postfix/generic

(The line starting with # is just a comment for later reference)

Now we need to create the generic address rewriting table. Create the file /etc/postfix/generic and add a line like this:

your_username@your_hostname your_real_address@example.com

Now run:

# postmap /etc/postfix/generic
# /etc/init.d/postfix reload

At this moment, if your ISP doesn't request SMTP AUTH, you should be able to send mails just with the mail command:

$ mail your_real_address@example.com
Subject: test real mail
Just some text
.
Cc:

You should have new mail. (Note: remember that mail is not an instant protocol. If your smarthost and mail server are not the same it might take a while until you receive the test mail.)

4 SMTP authentication

Many ISPs also require SMTP AUTH as a measure to prevent spam. For this to work we need to add some more stuff to postfix's config. Remember, though postfix is a fully featured mail server, we are now configuring it as a client. Edit /etc/postfix/main.cf and add:

# SMTP AUTH as client
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
# This has to be like this, otherwise we get
# the 'no mechanism available' error
smtp_sasl_security_options =

Now create /etc/postfix/sasl_passwd with the following content:

smtp.example.com your_real_address:your_mail_password

Don't worry about putting your password in plain text. We will make the file and the resulting .db file inaccessible for normal users:

# postmap /etc/postfix/sasl_passwd
# chmod 600 /etc/postfix/sasl_passwd
# chmod 600 /etc/postfix/sasl_passwd.db
# /etc/init.d/postfix reload

This configuration should work with most mail servers. You can test (again) using 'mail' or any mail client. Graphical mail clients usually don't have a default configuration. When you create a new account just type 'localhost' for the SMTP server.

5 SSL support

The same as with the SMTP AUTH, we need to configure postfix to act as a client to an SSL server. There are a few variants for this, but I will post the config necessary to send mails via Gmail. (Note: address rewriting is futile for Gmail, as any mail that passes through their servers will use the gmail address in the From: header.)

We edit again the /etc/postfix/main.cf file and add the following line:

smtp_tls_policy_maps = hash:/etc/postfix/tls_policy

Of course, we also need to create the file /etc/postfix/tls_policy with the following contents:

smtp.gmail .com:587 encrypt

For this to work you need to set it as relayhost in main.cf, of course:

relayhost = smtp.gmail .com:587

The ':587' bit specifies the port if you didn't guess this by now. You can also use square brackets around the mail server's name to disable MX lookups. This might be necessary with some servers who don't have proper MX records.

Enjoy your new setup.

6 Troubleshooting

In case your testmails don't get through, the first place to chech is the mail log, which is stored in the file /var/log/mail.log. tail is a very nice utility for this as it shows you only the last rows of a file, which in a log should be the newest. Check your syntax for any typos and if you found the error (and corrected) you should run (as root):

# /etc/init.d/postfix restart

The 'restart' of the postfix daemon will make sure the new config is loaded and will also flush the queue. If you want to check, flush or delete messages from postfix's queue you can use postqueue(1).

Enjoy your new setup. For retrievind mail from a POP account see the Mail - retrieving and for sorting the Mail - sorting and filtering notes.

7 Appendix A: License

Copyright (c) 2007 Andrei Popescu, andreimpopescu at gmail dot com

This document has been released by the author under a Free license (which should be indicated beneath this notice). You may use it freely according to its particular license.

Free Software License: Either GNU FDL or GNU GPL at your choice.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."
GPL This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Cloning_a_hard_disc.html0000644000175000017500000005236511257474725024217 0ustar chrischris Cloning a hard disc - NewbieDOC

Cloning a hard disc

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 1.0 6th July 2005 Revised by Chris Lale
Initial release

Version 1.1 7th February 2006 Revised by Chris Lale
Modified for NewbieDOC wiki by converting source to wikitext. Added a note about ddrescue.

Version 1.2 15th November 2007 Revised by Chris Lale
Moved the section about compiling Pcopy to an appendix now that there is a Debian "pcopy" package in Etch.

Version 1.3 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package; Moved section on documentation of self-compiled version of Pcopy to Appendix B.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Cloning a hard disc


Abstract

This HOWTO article explains how to make a clone of a hard disc. If the original hard disc is a failing disc, it must still be working and readable. The new disc must be at least as the same capacity as the original disc. These instructions have been tested on a Debian 3.1 (Sarge) system with IDE (ATA) hard discs.

Contents


1 Introduction

If you are unlucky, your hard disc begins to fail after a few years. If you are lucky, it gives you warning that it is on the way out. The drive produces clunking noises when it spins up, or fsck reports damaged sectors. This is the time to backup important files and buy a new disc. If the failing hard disc is your primary disc, you can put the new disc in the same machine alongside the failing one and make it an exact clone of the original. After cloning, you can remove the failing disc and replace it with the cloned one. If all has gone well, your master boot record (MBR), Linux partitions and other partitions all function exactly as before.

1.1 Assumed hardware setup

For IDE (ATA) discs, this article assumes that the original IDE hard disc is the primary disc with the jumper set to master (/dev/hda). The new IDE hard disc is the secondary disk with its jumper set to cable select (CS) or slave (/dev/hdb).

For SCSI discs and SATA discs the device names would be /dev/sda and /dev/sdb.

2 Installing the Debian packages

Install these packages.

  • util-linux (provides sfdisk)
  • gcc (needed to complile pcopy)
  • make (needed to complile pcopy)

3 Installing Pcopy

pcopy is a tool for large disk to disk copying. It is intended to be used when doing large disk (partition) to disk (partition) copying where dd is just too slow (and error prone). It also displays a progress counter while doing the copying. It is available as a Debian package in Etch. If you have an earlier version of Debian, you can compile and install it by following the instructions in Appendix A.

 
Note
Note: 
It may be possible to use ddrescue instead of pcopy, although this has not been tested. ddrescue is available as a Debian package.
 

As user root:

# aptitude install pcopy

4 Preparing to clone the disc

Before you go any further you would be wise to take these precautions.

  • Backup important files..
  • Backup the master boot record (MBR). Eg to backup to a floppy disc:
# dd if=/dev/hda of=/media/floppy/mbr.backup bs=512 count=1
  • Clean up existing partitions on the old disc.
    • Run Scandisk on MS Windows systems.
    • Run fsck on unmounted Linux partitions using the -f switch to force a check:
# fsck -Cvf /dev/hda1
  • Print a list of existing partitioning information on the old disc. You may need this data to recover data if things go wrong.
# fdisk -l /dev/hda | lpr
  • Stop the network.
# /etc/init.d/networking stop
  • Change to single user mode before starting to copy the disk. This will shut down the system daemons and preserve the state of the logs. It will also prevent users from logging in on networked systems.
# /sbin/telinit 1

5 Copying the partition table

The new disc must be large enough to accept all the partitions. If the new disc is larger than the old one you will be all right.

Use sfdisk to dump the partitions of the old disk (/dev/hda) and pipe the output to another instance of sfdisk to recreate the partitions on the new disk. This creates the new partitions but not the data on them. Remember to switch user to root before you use sfdisk. This example shows the screen output for a disk with FAT, NTFS and Linux partitions. The bootable partition /dev/hda1 contained a proprietory boot manager. Even non-Linux partitions and data can be copied successfully

$ su
Password:

# sfdisk -d /dev/hda | sfdisk /dev/hdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/hdb: 19457 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hdb1 0 - 0 0 0 Empty
/dev/hdb2 0 - 0 0 0 Empty
/dev/hdb3 0 - 0 0 0 Empty
/dev/hdb4 0 - 0 0 0 Empty
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/hdb1 * 63 4176899 4176837 6 FAT16
/dev/hdb2 4369680 116262404 111892725 f W95 Ext'd (LBA)
/dev/hdb3 4176900 4369679 192780 16 Hidden FAT16
/dev/hdb4 0 - 0 0 Empty
/dev/hdb5 4369743 8594774 4225032 7 HPFS/NTFS
/dev/hdb6 8594838 9655064 1060227 82 Linux swap
/dev/hdb7 9655128 10281599 626472 83 Linux
/dev/hdb8 10281663 18683594 8401932 83 Linux
/dev/hdb9 18683658 28933064 10249407 83 Linux
/dev/hdb10 28933128 35085959 6152832 83 Linux
/dev/hdb11 35086023 36114119 1028097 83 Linux
/dev/hdb12 36114183 37961594 1847412 6 FAT16
/dev/hdb13 37961658 82734749 44773092 83 Linux
/dev/hdb14 82734813 86638544 3903732 83 Linux
/dev/hdb15 86638608 87618509 979902 82 Linux swap
/dev/hdb16 87618573 91843604 4225032 7 HPFS/NTFS
/dev/hdb17 91843668 99747584 7903917 83 Linux
/dev/hdb18 99747648 103972679 4225032 7 HPFS/NTFS
/dev/hdb19 103972743 110495069 6522327 b W95 FAT32
/dev/hdb20 110495133 112744169 2249037 83 Linux
/dev/hdb21 112744233 116262404 3518172 83 Linux
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7 say, then use dd(1) to zero the first 512 bytes:

# dd if=/dev/zero of=/dev/foo7 bs=512 count=1

(See fdisk(8).)

6 Copying the partitions

Copy the contents of each of the partitions from the old disc to the new disc using pcopy. The -d switch shows progress as a series of dots. This example shows the screen output for the copying of partition /dev/hda3.

# pcopy -d /dev/hda3 /dev/hdb3
Copying from /dev/hda3 to /dev/hdb3 (start in 3 seconds)...
...............................................................................................
/dev/hda3: Done. Copied 94 MB in 5 seconds (18 MB/s)
#

Repeat the copy process for each partition.

7 Testing the new disc

Shut down the system.

# shutdown now -P

Unplug the computer from mains power. Remove the old disk. Remove the new disk and reposition the jumper to set it to master. Replace it using the cable connections of the old disc. Reconnect mains power, switch on and watch the computer boot. Everything should work identically to the original system.

8 Appendix A: Installing Pcopy from source

This is how you can compile Pcopy if your distribution does not have a debian "pcopy" package.

8.1 Downloading Pcopy

Download the Pcopy source from ftp://ftp.lysator.liu.se/pub/unix/pcopy. If this link is broken, search for pcopy with a search engine. Save the source tarball in your home directory eg /home/chris/download/pcopy/.

8.2 Extracting the source files

Open a terminal or a terminal window as a normal user. Move to the directory where you saved the tarball. For example, if you downloaded the Pcopy archive to /home/chris/download/pcopy/:

$ cd /home/chris/download/pcopy/

Extract the source files.

$ tar -xzvf pcopy-1.5.tar.gz

This creates a new subdirectory, pcopy-1.5, containing the source files.

8.3 Configuring the source code for your system

Move to the source directory and run the configure script.

$ cd pcopy-1.5
$ ./configure
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether make sets ${MAKE}... (cached) yes
checking size of long... (cached) 4
checking for lseek64... (cached) yes
checking for llseek... (cached) yes
checking for thr_create in -lthread... (cached) no
checking for pthread_attr_init in -lpthread... (cached) yes
creating ./config.status
creating Makefile
creating config.h
$

8.4 Compiling the source files

Run Make to select and compile the appropriate files.

$make
gcc -g -O2 -c -o pcopy.o pcopy.c
gcc -o pcopy pcopy.o -lpthread
$

8.5 Installing the binary file

You must become user root to do install pcopy, because the binary is installed in /usr/local/bin. Still in the source directory, switch user to root using su. Run make install. When the installation is complete, return to being a normal user by entering exit or typing ctrl-D.

$ su
Password:

# make install
/usr/bin/install -c -m 755 pcopy /usr/local/bin/
athlon:/home/chris/download/pcopy/pcopy-1.5

# exit
$

8.6 Documentation

8.6.1 Pcopy details

http://directory.fsf.org/sysadmin/Backup/pcopy.html

8.6.2 Manual pages

Man pages are available after you have installed the Debian packages.

  • sfdisk (8)
  • cfdisk (8)
  • tar (1)

pcopy does not have a man page, but you can get a list of options by typing:

$ pcopy -h


9 Appendix B: Licence

Copyright (c) 2005-2007 Chris Lale. chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Runlevels_introduction.html0000644000175000017500000006401411257474725025100 0ustar chrischris Runlevels introduction - NewbieDOC

Runlevels introduction

From NewbieDOC


Will Trillich
will@dontUthink.com (author)
Tom Huckstep
(publisher)
Romain Lerallut
rom1 AT users DOT sourceforge DOT net (publisher)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision v1 Revised by Will Trillich
The HTML version. http://newbiedoc.sourceforge.net/system/runlevels-intro.html.en

Revision v2.0 18 February 2001 Revised by Tom Huckstep
The SGML version.

Revision v2.1 5 January 2002 Revised by Romain Lerallut
Fixed update-rc.d example.

Revision v2.2 24 January 2006 Revised by Chris Lale
Adapted for NewbieDOC wiki by translating source into wikitext. Updated the abstract. Made a few minor textual amendments. Removed some broken links.

Revision v2.3 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.

Revision v2.4 6th December 2007 Revised by Chris Lale
Corrected runlevel for reboot - telinit 6. (Thanks to anonymous wiki user.)


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Runlevels introduction


Abstract

Runlevels determine the behaviour of the system once it has booted.

Contents


1 Assumptions

I'm writing this in January of 2001 ("Open the pod bay doors, Hal") as it applies to my Debian "potato" release (that is, the uname -a command tells me I'm running Linux kernel 2.2.17). Your mileage may vary -- chances are SOMETHING in your system is different from mine, right?

Debian "Potato" Release Kernel 2.2.17 Other Linux distributions MAY find this information useful as well, but it's tailored for the Debian "Potato" crowd.

By the way -- for you Mac and Windows folks out there -- my Debian system, with exim and mutt for email, and web and ftp servers, has been up without any hiccups for 108 days as of today. (My Mac has stretches when it behaves delightfully for weeks, and then it freezes up in spurts, five times a day for the next ten days... Windows folks know the feeling, too.)

That "fits-and-starts" syndrome just doesn't happen with Linux.

2 Introduction

Sure, you can ls your directory, and grep a file here and there – and you create the process at your shell prompt... And you created the shell prompt when you first logged in...

Ever wonder: So what creates the first process? (If not, you should.) What starts all these processes? Where exactly IS the god of the machine?

If you haven't tinkered with ps yet, now's the time.

$ ps axf

And to learn about ps, try

$ man ps

What ps does is show you the current processes that exist – including any ls or grep or find or emacs – many will be idle, as they wait for some signal (a press at the keyboard, a network packet, a signal from the printer). Others will be actively using processor brainpower.

Using ps axf (instead of just plain ps without any arguments) makes it display ALL processes (not just those owned by you, or connected to certain terminals, but ALL processes background or otherwise) in a family-tree format. Here you can see which process spawned which others, for several 'generations'. Here's a trimmed-down cross-section of my system at the moment:

$ ps afx
 PID TTY      STAT   TIME COMMAND
 5790 ?        S      1:41 /usr/sbin/xinetd
25445 ?        S      0:00  \_ in.telnetd: wdt
25446 pts/0    S      0:00      \_ -tcsh
25878 pts/0    T      0:00          \_ vi runlevels-intro.wml
26045 pts/0    R      0:00          \_ ps afx

I have edited out lots of extraneous lines to reduce distractions; you'll always see a heck of a lot more than just five lines, in your ps axf output. (By the way -- don't tell anyone I use telnet - a.k.a. Bad Security Breach from Hell - even though I've got it locked down via xinetd to interact only with my local intranet. Do as I say, not as I do: use sshd instead!)

The above listing confirmed our initial suspicions about logging in creating the shell, which creates all the other command processes we execute: you can see that xinetd spawned the in.telnetd process, which in turn is the parent process of my tcsh login shell which has two child processes. I am editing this very file (the vi runlevels-intro.wml command) which I suspended (with Ctrl-Z so I could get back to the tcsh command shell) in order to run the ps afx command – so I could cut & paste it into this document.

Below, I run the ps program again, but ask for a LONG listing via ps afxl:

$ ps afxl
  F   UID   PID  PPID STAT TTY    TIME COMMAND
100     0     1     0 S    ?      0:17 init [2]
140     0  5790     1 S    ?      1:41 /usr/sbin/xinetd
100   101 25445  5790 S    ?      0:00  \_ in.telnetd: wdt
100  1000 25446 25445 S    pts/0  0:00      \_ -tcsh
000  1000 25878 25446 T    pts/0  0:01          \_ vi runlevels.wml
000  1000 26072 25446 R    pts/0  0:00          \_ ps axfl

(Again, I've whittled down on the rows, and this time, the columns, too. Your display will have lots more info than this, guaranteed.) Notice that the process-ID (PID) of tcsh, which is 25446, also shows up as the parent process ID (PPID) for vi and ps? That's the "family tree" info that's needed in order to display the forest/family-tree style indentation; every running process knows its parent process.

Now -- notice how the PPID (parent) of xinetd is PID 1? That's init, which turns out to be the granddaddy of them all. Quite literally! (ps doesn't display init in the family tree because it's kinda "understood" that everything owes its existence to init.)

Think of init as kinda like Adam in his Garden of Eden, without any worries about sufficient diversity in the gene pool. He just clones himself, and then the clone takes on the function of the requested command process, which may in turn clone itself for the next job, and so on.

3 Init is the granddaddy of them all

All processes are spawned by init, or by processes whose ancestor is init. Period!

Great. So how the heck does init know what to do?

When init starts up at boot time it looks in /etc/inittab for instructions. In my /etc/inittab, for example, the first non-comment is

id:2:initdefault:

which tells init that until another runlevel is specified, wake up using 'runlevel 2' by default.

But even before the runlevel-specific stuff is executed, the 'system-wide gotta-have' stuff is specified in /etc/inittab via

si::sysinit:/etc/init.d/rcS

which runs all the initial stuff, like loading kernel modules, mounting partitions, hardware clock settings, yada yada... What the /etc/init.d/rcS script does (go have a look at yours, I'll wait) is run all the scripts in /etc/rcS.d/S* to get all your basic system features up and running before delving into the items specific to each runlevel. For example, you might need network cards and SCSI drivers up-and-at-em – but you don't need any SQL engines or webservers until you're entering runlevel (pick one, for example) four.

Whenever you boot into single-user mode (also called 'runlevel S') init runs only rcS stuff and doesn't continue any further – enabling you to log in as root and twiddle with your settings, before starting a services-oriented runlevel. (By services-oriented, I mean something like "on runlevel A we've got X and apache and nfs available; on runlevel B we have only sshd with logins restricted to group XYZ only; on runlevel C we have nfs and ftp ...")

3.1 But how about the feature-sets for a "user runlevel"?

For the runlevel-specific stuff (and this is what determines the difference between runlevel 3 and 5 and 2 and ...) further down in /etc/inittab there's

l2:2:wait:/etc/init.d/rc 2

which says that for runlevel 2, to run the /etc/init.d/rc script with argument 2. That's the script that you'll find that does most of the work. Go check it out.

Anyhow, what the /etc/init.d/rc script does is look in

/etc/rc[runlevel-digit].d/*
/etc/rc2.d/*

for scripts to run. A very nice, modular structure. And all those /etc/rc*.d/* items are just symlinks to the actual scripts in /etc/init.d/ anyhow.

3.2 What makes init start up a login sequence?

Even further down in /etc/inittab is the procedure for establishing a live tty connection, which enables you to log in in the first place:

1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

According to this, for runlevels 4 and 5, only tty1 will be active; for 2 and 3 tty[1-6] will all be active. (It's actually more sensible to say that tty1 is gonna be active for runlevels 2-5, and tty[2-6] will be active only for runlevels 2-3.) And when the connection goes down (either you log out in a nice, neighborly fashion, or you get rudely disconnected by a power failure or because your neice chewed through your modem cable), init knows to 'respawn' the process for the next victim. Cool, eh?

3.3 What runlevel am I in?

How do you find out which runlevel you're in right now? This one's easy. Try this:

$ /etc/runlevel
S 2

It displays both the previous runlevel (which may be S after a successful system startup, or perhaps N, signifying that there was no previous runlevel) and the current runlevel. (My system is at runlevel 2 after last being at the single-user [S] runlevel.) Nothing to it.

3.4 Changing to a different runlevel

This is not something to do lightly, especially if you have several users on your system. They'll track you down eventually (and have been known to use weapons) and you'll regret your careless act unless you have a good reason...

If it's really a good idea to do so, here's the recommended way to change from whatever runlevel you're using, to another runlevel:

# telinit 4
# telinit S
# telinit 2

Very simple. Just telinit (as root) which runlevel to switch to, and you're off!

3.5 How do the runlevels differ?

Sorry, I can't answer that... But you can.

Remember the /etc/inittab section that showed what to do on each runlevel?

l0:0:wait:/etc/init.d/rc 0
1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6

They all run the same script -- /etc/init.d/rc! The very only single difference is, which argument is sent to that script.

So we hafta check into that script to see what the argument does.

If you look at the /etc/init.d/rc script, you'll find portions that look something like this:

# Is there an rc directory for this new runlevel?
if [ -d /etc/rc$runlevel.d ]
	...
	for i in /etc/rc$runlevel.d/K[0-9][0-9]*
	...
	for i in /etc/rc$runlevel.d/S*

Can you see what that does? If you enter runlevel 3 (perhaps via telinit 3 ) it'll try running scripts from /etc/rc3.d/*. Mystery solved.

When entering a runlevel, you may need to "turn off" features that might have been turned on by another runlevel. Then, you turn on the features for the new runlevel.

So first, /etc/init.d/rc will run all the "kill" scripts (any script whose name starts with "K") in the new run level with a "stop" argument. For example:

/etc/rc3.d/K20postgresql stop

Which stops the pgsql server for runlevel 3

After it's all done running available "kill" scripts it then runs the "start" scripts (which have names staring with "S") in much the same way:

/etc/rc3.d/S60sshd start

Which launches the secure shell daemon for runlevel 3.

So now you should see why YOU can answer the question better than I can: only YOU can determine the difference between your runlevels ... by looking at your /etc/inittab file and by checking out the /etc/rc*.d/* scripts!

And note that the scripts will be run "in sequential order" meaning that S10* would run before S60* and so forth. This is how you can ensure that the load order works properly. For example, you may need to establish a network connection with a fileserver before launching a remote-log daemon.

BUT! There are certain preset runlevels that have important meanings:

  • telinit 0 = SHUTDOWN!
  • telinit 1 = Single user (root only) mode
  • telinit 0 = REBOOTS your system!

4 Changing what a runlevel does

There are Debian ways of munging the directory of scripts that the /etc/init.d/rc script calls upon.

4.1 Create a script to start or stop a feature

In order to affect a runlevel, you need to create a script that does some work.

# cd /etc/init.d
# cp skeleton my_sample_script

That skeleton is a nice way to start you off on the right foot. Once you get your my_sample_script working, you can add it to various runlevels.

4.2 Determine where it belongs in the START or STOP sequence

Even when your script works properly, you'll need to know where it belongs in the startup sequence for example, to check out runlevel 4:

# cd /etc/rc4.d
$ ls -F
S10sysklogd@  S20gpm@      S20postgresql@  S50wu-ftpd@  S99rmnologin@
S12kerneld@   S20inetd@    S20ssh@         S60sshd@
S19bind@      S20logoutd@  S20xinetd@      S89atd@
S20cipe@      S20makedev@  S22ntpdate@     S89cron@
S20exim@      S20mysql@    S23ntp@         S91apache@

This sample, taken from my system, shows there are zero KILL scripts, and 21 START scripts. If you wanted your new script to be STARTed after sshd (which is number 60) and before atd (number 89) then using any number near S70 for startup would do the trick.

Let's say you also want to run the KILL portion (maybe to refresh or disable something, it's up to you) when entering runlevel 4, as well. In my example above, I have NO kill scripts, so there's no established sequence to fit into so any number will do, but let's use 50.

4.3 Install the links that call the script

Here's how you set up your script to START as sequence 70 and STOP as sequence 50 for runlevel 4:

# update-rc.d my_sample_script start 70 4 . stop 50 4 .

That'll create links in /etc/rc4.d/ called K50my_sample_script and S70my_sample_script that point to your original script. The actual script itself is in /etc/init.d/my_sample_script.

You could also add your start/stop script to several runlevels at once. For example, add it to runlevels 2 through 5 like this:

# update-rc.d my_sample_script start 70 2 3 4 5 . stop 50 2 3 4 5 .

Easy as pie!

4.4 Removing a feature from a runlevel

When you decide to REMOVE your script (or any other service) from a runlevel, do like so:

# cd /etc/init.d
# mv my_sample_script my_sample_script.DISABLED
# update-rc.d my_sample_script remove

If you don't remove (or rename, if you're obsessive like I am and deplore actually deleting anything, ever) the actual script first, you'll need to supply other arguments to update-rc.d to get rid of the links.

Of course you can always tangle things up manually if you like, by editing /etc/init.d/* scripts and munging links yourself... but that way, lies madness.

5 Need to know more?

Don't stop here! Learn more by trying these:

$ man init
$ man inittab
$ man ps
$ man update-rc.d
http://packages.debian.org/procps

6 Appendix A: Licence

Copyright (c) 2001 Will Trillich. will@dontUthink.com.

Copyright (c) 2001 Tom Huckstep.

Copyright (c) 2001 Romain Lerallut. rom1 AT users DOT sourceforge DOT net

Copyright (c) 2006-2007 Chris Lale. chrislale AT users DOT berlios DOT de.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Grep_Introduction.html0000644000175000017500000002554711257474725023766 0ustar chrischris Grep Introduction - NewbieDOC

Grep Introduction

From NewbieDOC

Jon Eisenstein
jeisen@mindspring.com (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision v0.02 23 February 2001 Revised by Jon Eisenstein
First SGML draft. A copy of the original "Grep Introduction" is at http://newbiedoc.sourceforge.net/utils/grep.html.en

Revision 0.03 24th January 2006 Revised by Chris Lale
Adapted for NewbieDOC wiki by converting source to wikitext. Made a few minor corrections and minor additions.

Revision 0.04 22nd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Grep Introduction


Abstract

An introduction to the very useful grep program.


Contents


1 Introduction

Some introductory stuff.

2 Main stuff

Eventually you may want to split this up into sections.

Grep. It sounds like a rude noise made by some bodily function. In fact, in some languages, I believe it is just that. Of course, we're talking about the grep command in Linux here, and so we can safely assume that we're referring to the Global Regular Expression Print.

Grep is a powerful tool to search files for some phrase, or, as the name suggests, any expression. Using grep, you could discover exactly which file contains the definition of that word you're looking for, or where you typed in that complex math formula. Simply give grep an expression, a place to look, and it will return any matches, in context.

The basic syntax of grep is as follows:

grep [options] expression [file(s)]

For example, I could ask grep to find the word "distribution" in Debian's Basic Definitions document:

$ grep distribution ch-basic_defs.html

Grep would then print on the screen the following lines:

Debian GNU/Linux is a particular distribution of the Linux
operating membership or payment required to participate in its distribution and
value-added Linux distributions can be built.  By providing a reliable,
compatibility, and allows Linux distribution creators to eliminate
...
.
.

As you can see, after finding any instance of the word "distribution" in the document, it told me where, in context, I could find that word if I searched myself. It gave me a basic idea of how the word was used each time it was found, so I could decide whether or not each one was the phrase I was searching for.

"Big deal!" you may say. "I can search for words more easily using my text editor!" That's true, but can you search an entire directory for that word? If you wanted to, could you search your entire system? With grep, you can.

I recently had a problem compiling a kernel to use my relatively ancient sound card. The kernel documentation (located in /usr/src/linux/Documentation if you have installed the source) has an entire directory dedicated to sound card issues. However, none of the files that seemed to be relevant seemed to contain the information I needed. As you may have guessed, I called up my good friend grep and asked for help.

$ grep "sound blaster 16" sound/*

I used the wildcard symbol to have grep search every file in the sound directory, but unfortunately came up with nothing. I asked myself what had gone wrong, and I realized that grep is case sensitive, and was being too literal to be useful here. I tried again, this time with the case insensitive option (-i), to see if might have more success.

$ grep -i "sound blaster 16" sound/*

This time, I was given a list of files in which the phrase "Sound Blaster 16" appeared, and found the answer to my question in a file which I had not thought of to search manually.

I have, in fact, used this method to locate a file which I had written and misplaced. I made sure to search recursively by using the -r option, and issued the command:

$ grep -r "my phrase" /

This searched my entire system to find one short phrase. Be warned, though, that if you do try this, searching every file will take a long time, regardless of the speed. Once you see the file that you were looking for and grep continues to look for more, you may use ^C to stop grep from searching any more and continue with your work.

There are many more useful things you can do with grep than I can describe here. Hopefully, I have convinced you that it is a tool worth using. I suggest you take a look at the manual page, as well as other resources that might be available.

3 Appendix A: Licence

Copyright (c) 2001 Jon Eisenstein. jeisen@mindspring.com.

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Debian_help_system.html0000644000175000017500000013624411257474725024123 0ustar chrischris Debian help system - NewbieDOC

Debian help system

From NewbieDOC

Jesse Goerz
jwgoerz@users.sourceforge.net (author)
Jonathan Eisenstein
jeisen@users.sourceforge.net (publisher)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 0.2 4th May 2001 Revised by Jesse Goerz
Added /usr/doc/*, xman, more info on using mailing lists, correction on zless reference, and minor corrections to info gathering progs. http://newbiedoc.sourceforge.net/general/help-system.html.en

Revision 0.3 29th September 2001 Revised by Jesse Goerz
Added info pages.

Revision 1.0 5th April 2002 Revised by Jonathan Eisenstein
Checked and revised by project editor. Lots of stuff moved around. A lot of text added.

Revision 2.0 7th April 2002 Revised by Jonathan Eisenstein
Pegged for release. After a major rewrite, and to match the CVS, it's now v2.0.

Revision 2.1 7th April 2002 Revised by Jonathan Eisenstein
A few minor corrections in layout after seeing the built HTML.

Revision 2.2 7th February 2006 Revised by Chris Lale
Modified for NewbieDOC wiki by converting source to wikitext. Updated some links and images. Modified section on plog.

Revision 2.3 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Debian help system


Abstract

This document is intended to help Debian newbies learn about ways in which they can find information to solve problems they have while using Debian GNU/Linux.

Many thanks to Brian Potkin for his direct and accurate information about /usr/share/doc, man pages, and my error on what package zless belonged to. I would also like to thank Wayne Topa for his excellent contribution for using xman and his advice on the use of the mailing lists.

Contents

1 Introduction

Many people who use Linux say that Debian is the hardest distribution to use. This is probably true for someone who is trying out Linux for the first time. Don't worry if this describes you. After reading this document, you will learn the basic information gathering skills you will need to find solutions to most of the problems that you will encounter.

This document describes the Debian help system. Debian doesn't really have a formal help system, in that, all the information resides in one place or program. One of the great things about Debian is the multitude of resources which are readily available without cost. It will take some getting used to at first, but once you have mastered how to gather information about your problem, the solutions will come easily.

Note that many of these resources are not specific to the Debian system. Unless otherwise noted, each feature can be found on most Linux systems.

2 What's Installed?

The Debian designers have gone to great lengths to ensure the system is well documented. This pursuit has led them to include most of the necessary documentation on the Debian system for the packages you have installed. Let's take a look at some of the resources that are available on your computer.

2.1 /usr/share/doc/*

Almost every package that is installed under Debian installs some type of documentation information in the directory /usr/share/doc. Underneath this directory are subdirectories named after the packages which installed them. Here's what my /usr/share/doc directory looks like:

aalib1              diff             hostname         libc6-dev
abiword             docbook          iamerican        libcdparanoia0
acroread            dpkg             imlib-base       libcomerr2
adduser             dpkg-dev         info             libdb2
alien

Since there are so many directories in /usr/share/doc, I have actually cut this short so it'll be a little more readable. We'll take a look at a specific package and its documentation. Abiword is a nice word processor which imports Microsoft Word documents and quite a few other formats. Let's take a look at the abiword subdirectory.

README.gz  changelog.Debian.gz  copyright  examples

One of the really cool things about the directory /usr/share/doc is that many times the applications have examples directories in them. These subdirectories usually contain sample configuration files for programs you may be trying to use, or tips and tricks to make them work even better. You'll also notice that many of these files have the extension .gz on them. This means that the file is compressed in the gzip format. To read it, you must first uncompress it somehow. One way is to fully uncompress the file with the gunzip command. However, this can waste a lot of space, and the purpose of having the files compressed in the first place is to save space.

An easier and more logical way to read compressed files is to use the 'zless' command. This command automatically uncompresses the file using gunzip, loads the file in memory, and uses the less command to present it to you. In order to view the README.gz file, execute the command:

$ zless README.gz
 
Tip
Tip: 
If you get an error about a command not found, you may be missing the less package. zless is installed by default on Debian systems with the gzip package, but less, which zless depends on, may not be. If you need help installing missing packages, see the Newbiedoc "apt-get intro".
 
------> README.gz <------
----------------
Release Notes
----------------

Thank you for your interest in this Preview Release of AbiWord!

---- About AbiWord

AbiWord is an "Open Source" word processor. (If you would like more information about the concept of Open Source, you might start looking at http://www.opensource.org .)

You can use the arrow keys to scroll the file up and down or use the space bar to advance one screen at a time. When you're done reading the README.gz file just simply hit the q key.

2.2 /usr/doc/*

The directory /usr/doc/ is where all the documentation used to be stored, before Debian began changing to be compliant with current Linux standards. Anything located here instead of in /usr/share/doc/ is in violation of current Debian policy and will change soon.

3 The Online Manual

3.1 The Manual

Once, in the early days of UNIX, users had the standard manuals available in print, on their shelves. 9 books were available, each one gigantic and hard to use. Someone eventually had the idea to make it standard to have all of these books on the UNIX system in the form of the man command, where it could be edited easily when new information became available, not to mention the added ease of having the manuals searchable and read quickly. These manuals are usually your first target when you have a problem, as nearly every aspect of your system is covered there.

Not only are most commands covered in the online manual, but often configuration files as well as functions for programming in Linux can be found. However, many users feel intimidated by man pages because they are often technical in nature and can be difficult to read for newbies. Once you get the hang of reading them, you'll find that the man pages are the greatest source of help on any system.

3.2 Man Page Layout

Manual pages have a very specific format that every official page should follow. Here is a sample, the documentation for the uname command. To read it, I type:

$ man uname

uname(1)					uname(1)

NAME
	uname - print system information

SYNOPSIS
	uname [OPTION]...

DESCRIPTION
	Print certain system information. With no OPTION, same as -s.

	-a, --all
		print all information

	-m, --machine
		print the machine (hardware) type

	[...]

	-v	print the operating system version

	--help	display this help and exit

	--version
		output version information and exit

AUTHOR
	Written by David MacKenzie.

REPORTING BUGS
	Report bugs to <bug-sh-utils@gnu.org>.

COPYRIGHT
	Copyright C 2000 Free Software Foundation, Inc.
	[...]

SEE ALSO
	The full documentation for uname is maintained as a Texinfo manual. If the info 
	and uname programs are properly installed at your site, the command

	info uname

should give you access to the complete manual.

NAME: Here you get a brief description of the command after its official name

SYNOPSIS: The usage of the command, with optional segments listed in brackets. When [OPTION] is specified, it means that the command can have the options listed under the next section added to it.

DESCRIPTION: Detailed information about the command, including options that can be added to it. Unless specified either here or in the synopsis, you can add as many of these options as you want.

SEE ALSO: This is an important section of the man page that is often overlooked. If the information you are looking for isn't available in this page, it may be available in one of the pages listed here. Also listed here is information referencing the info command, if that information exists. A description of the info command is in the next section.

Using man works similarly to using less, once you're reading the page. For more information, try reading the man page for man itself!

3.3 xman

xman is a graphical version of the program man described above. If you find man pages tedious, or just really like your mouse, try typing this at the command line:

$ xman &

Alternatively, you could start xman from your menu system, which should look something like Figure 1:

Image:debian-menu-xman.png

Figure 1. Starting xman from your GUI menu

Whatever method you choose to start xman you should get a nice little window like that found in Figure 2:

Image:xman.png

Figure 2. The xman program

Just click on the "Help" button to get more information or click directly on the "Manual Page" button to look up man pages.

4 Info Pages

4.1 What are Info Pages?

While man pages are great sources of information about a command or concept, the fact that it provides one long page means that longer documents are hard to read. The info format was developed as a way to store more comprehensive instructions on your system. If a particular command is more complicated than a man page can document, the author commonly writes both a man page and an info page. While the man page will be a simple reference to the command and its options, the info page will be a longer reference, like a manual.

To make it easier to read longer documents, info pages are split up into sections, with links between them, much like a web site. You should feel comfortable very quickly when using info because it is so similar to a web browser.

4.2 Using Info Pages

You can start the info program the same way as the man program. For example, to get help on the info command itself, type

$ info info

You should get a screen which looks something like this:

File: info.info,  Node: Top,  Next: Getting Started,  Up: (dir)

Info: An Introduction
*********************

   Info is a program for reading documentation, which you are using now.

      To learn how to use Info, type the command `h'.  It brings you to a
	  programmed instruction sequence.

	  * Menu:

	  * Getting Started::             Getting started using an Info reader.
	  * Advanced Info::               Advanced commands within Info.
	  * Creating an Info File::       How to make your own Info file.

The text you see at the bottom of the screen followed by :: are the links to other pages in this document. You can use your keyboard to put the cursor anywhere on the words of the link, and enter to select it. You may have some trouble navigating the pages, so here's a quick list of important keys:

Table 1. Important keys and their functions

Key Result
SPACE Page Down (To next page, if needed)
PAGE DOWN Page Down (Until end of page)
BACKSPACE Page Up (To last page, if needed)
PAGE UP Page Up (Until beginning of page)
B Beginning of page
E End of page
TAB Next link
N Next page in document
P Previous page in document
L Previous page you visited
T Beginning of document (The Menu)
Q Quit the info program

You can also use a mouse to navigate the info pages. Just click on a link to follow it.

4.3 xinfo

If you'd rather use a graphical interface to browse your info files, you can use the program xinfo if it is installed. It is very similar to xman, except for info pages instead of man pages.

5 Other Help Commands

While man pages and info pages are the most reliable sources of information on a Linux system, there are other ways to obtain information if you still can't find your answer. For instance, what if you don't know the command you're looking for?

5.1 apropos

The other day a friend of mine was having a problem with a boot disk and asked me how to fix it. So my first instinct was to try:

$ man bootdisk

Unfortunately, this is what I got:

No manual entry for bootdisk

I knew that I had read something about boot disks before, but I couldn't seem to remember where. This is where the apropos command comes in handy. Apropos is kind of like saying, "I can't quite remember what that cool movie was, but I know the title started with 'The Good'" and having a friend start giving possible movies. That's what apropos does, only for topics on a Linux system. So here's what I did:

$ apropos bootdisk
mkboot (8)           - makes a bootdisk

Just like that, apropos gave my answer! Now all I had to do was:

$ man mkboot

Sometimes it will give you back more than one answer. Just go through each one until you get what you're looking for.

5.2 Using dpkg to find information

dpkg is the program which controls all the installation of .deb packages. This program can be used to help you find particular files or information about a program you may have installed but can't seem to get working.

Suppose you just installed a program but you can't find any documentation in the usual places (i.e. /usr/share/doc/). How would you find out where the package put the documentation? Let's pretend I didn't know where Abiword installed it's documentation. I would use the dpkg command like this to find it:

$ dpkg --listfiles abiword

This simply tells dpkg to list all the files that were installed with the abiword package. Here's the result of that command:

/.
/usr
/usr/bin
/usr/bin/AbiWord_d
/usr/bin/AbiWord
/usr/bin/abiword
/usr/share
/usr/share/doc
/usr/share/doc/abiword
/usr/share/doc/abiword/examples
/usr/share/doc/abiword/examples/en-US
/usr/share/doc/abiword/examples/en-US/Latin1.abw
/usr/share/doc/abiword/copyright
/usr/share/doc/abiword/README.gz
/usr/share/doc/abiword/changelog.Debian.gz/

In the example above you can see the doc directory quite nicely but in reality when I executed this command all the files scrolled right off the screen and I wasn't able to read any of them. For especially large packages with lots of files we are going to need to enlist the help of another program called grep. Here's the new command to find what we are looking for:

$ dpkg --listfiles abiword | grep doc
 
Tip
Tip: 
The "|" character, or pipe as it's called, is typed by pressing Shift-\
 

This command tells dpkg to list all the files installed by abiword and then send that list to the program grep. grep then searches through the list looking for any occurrence of the word "doc". When grep finds the word doc on a line it prints that line to the computer screen. Here's what the output looks like:

/usr/share/doc
/usr/share/doc/abiword
/usr/share/doc/abiword/examples
/usr/share/doc/abiword/examples/en-US
/usr/share/doc/abiword/examples/en-US/Latin1.abw
/usr/share/doc/abiword/copyright
/usr/share/doc/abiword/README.gz
/usr/share/doc/abiword/changelog.Debian.gz

This is much easier to read then the previous example, and as you can see, it only printed out lines with the occurrence of "doc". The files didn't scroll of the screen and it's a nice short list. I can now look in those directories and see what I can find. This might seem like a silly example, but if you look closely you can use this to search for all kinds of things. You could replace "doc" with any word you are looking for. Some examples which come to mind might be "help", "ref", "html", "config", "conf", "etc", and "examples".

For more information about using grep, check out the NewbieDOC grep document (http://newbiedoc.berlios.de/index.php/Grep_Introduction).

6 Online resources

There are a lot of online resources for Debian. I won't be able to cover them all here, but I will cover the ones I use when I have problems or I'm just trying to learn something new.

6.1 Debian home page

The Debian home page (http://www.debian.org) is the central source for online information. There is so much to cover here that I'm going to break it out into a couple of sections. I highly recommend you go to the Debian web site and check it out. You will find more information on what Debian is about, Debian related news, security alerts and much more.

6.2 Debian mailing lists

The Debian mailing lists are the one thing which make it such an incredible distribution to use. No other distribution can claim to have such "round the clock" excellent support services for free. Debian has over 20 mailing lists covering subjects from running an ISP with Debian to issues of security. If you can think of it, Debian probably has a mailing list for it!

The best way to get familiar with the Debian mailing lists is to visit the mailing list web site (http://www.debian.org/MailingLists/). You will get some basic information about the sites and how they operate. When you're ready to subscribe to a mailing list go to the subscription page. The most important mailing list to subscribe to for new users of Debian is the debian-user mailing list. Be warned though, the debian-user mailing list is a high-volume list. It's not uncommon to get 75 or more emails a day.

Subscribing to mailing lists does bring with it some responsibilities. Here's a quick list of some of the things you ought to do when posting to the list:

  • Read the list for a few days and take note of how people ask questions. Pay particular attention to those who seem to get their questions answered quickly.
  • Gather as much information as possible about the problem you are having before you post to the list. You'll get help faster and it'll be more accurate. Check out the section called Information gathering programs for tools that can help you do this.
  • Make sure the subject line of your email is accurate and descriptive. Subjects like "I need help!!!" may be overlooked by just the expert who could answer your question. A smart thing to do is to list the package name and the problem in the subject. Many maintainers browse the mailing lists, and usually have their mail program configured to highlight subjects about their packages.
  • Tell the truth (to the best of your knowledge) about what you've done to try and fix it, what has happened as a result, and what your experience level is.
  • Realize that some of the answers may do damage to your system or may be inherently risky.
  • Get familiar with the mailing list archives (http://lists.debian.org/users.html). You can search them using Google, prefixing your search terms with:
site:lists.debian.org
It's a good idea to check there first, because your question may have already been answered. Answering the same question over and over can get very annoying; just ask anyone who has a 3 year old. (And remember, they don't love you like they do their 3 year old.)
  • If your problem was complicated, and took some time to solve, post a summary of the solution, so others can benefit as well. Use something like this in your email subject line: "Solution: problem description".

Here are some things you should NOT do when posting to the mailing lists:

  • Don't post to the list using html mail formats. This is by far the worst thing you can do on the mailing lists. It irritates everyone. 99.9% of the people who use Linux and don't use email programs that support html format. They'll tell you that's what web browsers are for (and they're right!). Make your posts in plain text only!
  • Don't post unrelated questions in one mail message. It's better to split it into multiple emails.
  • Don't give sensitive information to anyone on the list. There is absolutely no reason anyone on the list will ever need your root password, dial-up password, or any other type of private information whatsoever.
  • When posting configuration files make sure you delete or change any passwords or other sensitive information which may appear in them. When people on the list ask for configuration files and tell you to "munge" the passwords, this is what they mean.
  • Don't expect the first response to your question to always work. The Debian organization is made up of volunteers, and the person answering your question may not be an expert. What worked for others may not always work for you, but it's usually worth a try.
  • Don't flame or ridicule people for giving you incorrect advice (if you know it is incorrect). Remember, this is a volunteer list of people just like you, trying to find answers. Simply correct them (if you know you're right) and move on.

6.3 Debian GNU/Linux FAQ

The Debian GNU/Linux FAQ is a very extensive document which covers a lot of (go figure) Frequently Asked Questions. You can check it out here: http://www.debian.org/doc/FAQ/.

6.4 Finding packages

Need to find out what a specific package does? Looking for a specific package? Trying to install a specific program but you don't know the name of the package it's in? Try here: http://packages.debian.org/, or search using Google, prefixing your search terms with:

site:packages.debian.org

6.5 Debian documentation project

The Debian Documentation Project (http://www.debian.org/doc/ddp) is an ongoing project to provide quality documentation on the Debian GNU/Linux operating system for free. This is a great place to start looking when you have questions that haven't been answered elsewhere. You may also wish to browse this area in your free time, as there is a great wealth of knowledge in these guides and manuals. This is a great place to start looking when you have questions that haven't been answered elsewhere. You may also wish to browse this area in your free time, as there is a great wealth of knowledge in these guides and manuals.

6.6 NewbieDOC Project

Of course, there's always the NewbieDOC Project (http://newbiedoc.berlios.de), which aims to provide answers for commonly encountered problems that new users of Debian may encounter.

7 Information gathering programs

I'm covering these programs here just so you have a quick reference and know that they are available. Most of these programs are much more powerful and can do many more things than I'll explain. You may not ever have to use these but they may come in handy when trying to gather information so you can post an accurate question to a mailing list.

7.1 Using a terminal

Using a terminal can sometimes help you get information about a problem program. If you're running X this is really nice. Let's say that my word processing program is acting weird and won't work the way I'd like to. All I need to do is open up a terminal and execute the command to start abiword from within the terminal. Any errors that aren't shown when starting a program from a menu are displayed here. Figure 3 demonstrates this.

Image:term-deb-help-sys.png

Figure 3. Using a terminal to gather information about a malfunctioning program

As you can see in the terminal window I used the following command to open abiword:

$ abiword &

You can make this work with any X program. Just make sure you use the "&" (Ampersand) after the actual programs command name. Then you can just cut and paste the information in the terminal window into a file or email and use it to ask questions.

7.2 plog

plog is used to find problems when setting up or trying to fix your ppp connection. plog shows you the last few lines of /var/log/ppp.log. If that file doesn't exist, it shows you the last few lines of /var/log/syslog file, but excluding the lines not generated by pppd. It is common to start a terminal and then issue the command:

$ plog

Then in another terminal try and start your ppp connection. Here's what mine looks like when I shutdown my ppp connection.

 
Important
Important: 
You'll probably have to be root to use this program.
 
storm:/home/jesse# plog -f
Apr  8 23:15:14 nexus pppd[22001]: sent [LCP EchoReq id=0x28 magic=0xca942c68]
Apr  8 23:15:15 nexus pppd[22001]: rcvd [LCP EchoRep id=0x28 magic=0x55aae757]
Apr  8 23:15:44 nexus pppd[22001]: sent [LCP EchoReq id=0x29 magic=0xca942c68]
Apr  8 23:15:44 nexus pppd[22001]: rcvd [LCP EchoRep id=0x29 magic=0x55aae757]
Apr  8 23:16:11 nexus pppd[22001]: Terminating on signal 15.
Apr  8 23:16:11 nexus pppd[22001]: Script /etc/ppp/ip-down started (pid 22411)
Apr  8 23:16:11 nexus pppd[22001]: sent [LCP TermReq id=0x2 "User request"]
Apr  8 23:16:12 nexus pppd[22001]: rcvd [LCP TermAck id=0x2]
Apr  8 23:16:12 nexus pppd[22001]: Connection terminated.
Apr  8 23:16:12 nexus pppd[22001]: Connect time 21.0 minutes.
Apr  8 23:16:12 nexus pppd[22001]: Sent 23101 bytes, received 177378 bytes.
Apr  8 23:16:12 nexus pppd[22001]: Hangup (SIGHUP)
Apr  8 23:16:12 nexus pppd[22001]: Waiting for 1 child processes...
Apr  8 23:16:12 nexus pppd[22001]:   script /etc/ppp/ip-down, pid 22411
Apr  8 23:16:12 nexus pppd[22001]: Script /etc/ppp/ip-down finished (pid 22411), status = 0x100
Apr  8 23:16:12 nexus pppd[22001]: Exit.

If you're having problems with your ppp connection this can really help in finding the answer.

7.3 /var/log/syslog

/var/log/syslog works on much the same principal as plog. The only difference is you'll need to use the tail command to make it work. Also, as the name implies, this log file contains all the systems logs so there is usually a lot of information in it. Again, open up a terminal and do the tail command. Watch the log file print to screen and try and figure out what's happening that's causing you problems. Here's the command to make it work:

 
Important
Important: 
You'll probably have to be root to use this program.
 
# tail -f /var/log/syslog

7.4 tcpdump

tcpdump is a powerful tool for network monitoring and data acquisition. It allows you to dump the traffic on a network.

tcpdump can be used to print out the headers of packets on a network interface, filter packets that match a certain expression. You can use this tool to track down network problems, to detect "ping attacks" or to monitor network activities.

tcpdump is provided by the tcpdump package.

7.5 dump

Need.

7.6 lspci

lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them. The information this program outputs can sometimes be very helpful to developers who are writing device drivers and modules which make your PCI cards run. PCI cards can be sound cards, video cards, special controllers, and any number of other things. I was once asked for the output of this program when my video card wasn't recognized by the beta version of Progeny. The two most common options are -s and -n. Don't worry if you don't understand the output, you'll be sending this information to someone who (hopefully) does. Here's what they both look like on my machine:

jesse@storm:~/test$ /sbin/lspci -n
00:00.0 Class 0600: 8086:122d (rev 02)
00:07.0 Class 0601: 8086:122e (rev 02)
00:07.1 Class 0101: 8086:1230 (rev 02)
00:0e.0 Class 0300: 5333:8811

=========divider========================

jesse@storm:~/test$ /sbin/lspci -v
00:00.0 Host bridge: Intel Corporation 430FX - 82437FX TSC [Triton I] (rev 02)
        Flags: bus master, medium devsel, latency 64

00:07.0 ISA bridge: Intel Corporation 82371FB PIIX ISA [Triton I] (rev 02)
        Flags: bus master, medium devsel, latency 0

00:07.1 IDE interface: Intel Corporation 82371FB PIIX IDE [Triton I] (rev 02) (prog-if 80 [Master])
        Flags: bus master, medium devsel, latency 64
        I/O ports at ffa0

00:0e.0 VGA compatible controller: S3 Inc. 86c764/765 [Trio32/64/64V+] (prog-if 00 [VGA])
        Flags: medium devsel, IRQ 11
        Memory at ff000000 (32-bit, non-prefetchable)

8 Appendix A: Licence

Copyright © 2001, Jesse Goerz, NewbieDoc project. jwgoerz@users.sourceforge.net

Copyright © 2002, Jonathan Eisenstein. jeisen@users.sourceforge.net

Copyright © 2006-2007, Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Shortcuts_for_copying_and_pasting_text.html0000644000175000017500000002127211257474725030326 0ustar chrischris Shortcuts for copying and pasting text - NewbieDOC

Shortcuts for copying and pasting text

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History



Revision 0.1 1st February 2006 Revised byChris Lale
Initial Release.

Revision 0.2 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Shortcuts for copying and pasting text


Abstract

It is possible to copy and paste text between X applications and console applications running in a terminal window. There are both keyboard and mouse methods.

Contents


1 Introduction

If you are using Gnome or KDE or a modern window manager, you can cut, copy or paste text without using an application's built-in Edit menu. In fact, you can copy and paste text within a terminal window and between a terminal window and GUI applications. This can be useful for copying commandline output to a text editor, or for copying and pasting within a console application such as Nano.

The keyboard shortcuts can be freely mixed. In other words, you can use any method to copy followed by any method to paste. However, the mouse shortcut is best not mixed with the keyboard shortcuts.

2 Keyboard shortcuts within GUI applications

Cut - ctrl-X
Mnemonic: X looks like a symbol for scissors. Cuts text previously selected with the mouse.
Copy - crtl-C
Mnemonic: C is the initial letter of Copy. Copies text previously selected with the mouse.
Paste - ctrl-V
Mnemonic: V looks like a symbol for the tip of a glue pen. Pastes text at the insertion point.

3 Keyboard shortcuts within a terminal window

Copy - shift-crtl-C
Mnemonic: C is the initial letter of Copy. Copies text previously selected with the mouse.
Paste - shift-ctrl-V
Mnemonic: V looks like a symbol for the tip of a glue pen. Pastes text at the insertion point.

4 Mouse shortcuts for GUI applications and terminal windows

Copy
Just select text by dragging the mouse pointer with the left button pressed. Release the left button and the selected text remains ready for pasting until a new selection is made.
Paste
Click the middle mouse button (or left and right buttons simultaneously). The text is pasted at the insertion point.

5 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale. chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Using_Joe_as_your_editor.html0000644000175000017500000003643211257474725025314 0ustar chrischris Using Joe as your editor - NewbieDOC

Using Joe as your editor

From NewbieDOC


Kenward Vaughan
kaynjay@igalaxy.net (author)
Tom Huckstep
(publisher)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision v0.00 2001 Revised by Kenward Vaughan
Initial version. http://newbiedoc.sourceforge.net/text_editing/joe.html.en

Revision v0.01 22 February 2001 Revised by Tom Huckstep
First SGML draft.

Revision v0.02 26 January 2006 Revised by Chris Lale
Modified for NewbieDOC wiki by converting source to wikitext. Added an abstract.

Revision v0.03 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Using Joe as your editor


Abstract

Joe is a simple commandline editor apparently based upon/inspired by the old DOS word processor called Wordstar.


Contents


1 Why think about a file editor?

Linux works with files. All kinds of them. Configuration ones, scripts, data files, the list goes on and on. As one person (of many) once wrote, "In Linux, everything is a file." Guess what? You need a file editor. And while you might plan to spend a lot of time in X Windows, you will likely find the command line your friend after a while.

As a non-programmer/Linux-neophyte/once-GUI-oriented sort of fellow, I thought it would be nice to write up a short piece for Debian newbies (or Linux ones in general) about some apps which with almost anyone from outside Linux would quickly feel comfortable. I have used joe at the command line ever since I began with Linux. (I haven't wanted to go through the learning curve associated with emacs or vi. There are too many other things to learn...)

2 Why joe?

I can't remember where I heard about joe, but I knew that I wanted the package when I did my 1st install of Debian. It apparently is based upon/inspired by the old DOS word processor called Wordstar (which I have used at least once in the distant past). Joe was touted as a simple editor for the rest of us—those who aren't geeks by nature.

Let me explain why. First, if you haven't already installed joe, hook up to the 'Net (or get your Debian CD's out), become root, and type

# apt-get install joe

then, after installation has finished, fire it up with a simple

$ joe

or

$ joe NameOfNewFile

or

$ joe NameOfExistingFile

at the command line.

 
Warning
Warning: 
If you are still root at this point, be careful! Know what you are changing, because you are god of the system as root!
 

You'll see a blank page created (or the contents of the existing file, if that's how you invoked joe) with a single line at the top giving you some information.

3 That single line of information

The key here is the `Ctrl-K H for help' part. Help is always in front of your face. Try it now to see what's there. Push and hold the control key while pressing k then release and press h

You can see from the help screen the variety of things available (shown below). Note that many (but not all) commands start with the Ctrl-K keystrokes (the control key is commonly abbreviated as a caret, ^ ). Also note that letters do not have to be capitalized, but that undo (Ctrl-Shift--) and redo (Ctrl-Shift-6) do require shifting. If you have opened a file, play with things to see how they work (most are real obvious). Note that the arrow keys, Page Up/Page Down, and Home/End keys also do what you'd expect. Insert acts like space, though. To change to typeover you have to invoke options (^T).

CURSOR            GO TO            BLOCK       DELETE    MISC          EXIT 
^B left ^F right  ^U prev. screen  ^KB begin   ^D char.  ^KJ reformat  ^KX save
^P up   ^N down   ^V next screen   ^KK end     ^Y line   ^T options    ^C abort 
^Z previous word  ^A beg. of line  ^KM move    ^W >word  ^R refresh    ^KZ shell 
^X next word      ^E end of line   ^KC copy    ^O word<  ^@ insert     FILE 
SEARCH            ^KU top of file  ^KW file    ^J >line  SPELL         ^KE edit 
^KF find text     ^KV end of file  ^KY delete  ^_ undo   ^&[N word     ^KR insert 
^L find next      ^KL to line No.  ^K/ filter  ^^ redo   ^&[L file     ^KD save

^ is the Control key , ^[ is the same as the Escape key, and ^[L is the same as Escape-L

The big ones to note for joe newbies are ^KD (save) ^KX (save and exit) ^C (exit without save—it will ask you about saving) ^KJ (reformat paragraph after making changes which mess up the line wrapping) and the block commands (operating on chunks of text, e.g. a paragraph).

People used to a system like Windows may begin to feel anxious at this moment. "WHAT? I have to remember all of Those Things??!!" (Shudders going through body... ;-) It's not that hard, and you may already understand how it works. Have you ever hit the F1 key to get help? That key is called a shortcut because it is a lot easier and faster than moving your hand off the keys over to the mouse, then pointing and clicking on the help menu item, often followed by a necessary second choice off that menu. Joe (and many other command line apps) uses shortcuts by default.

When you exit and save changes to an existing file, joe automatically creates a backup of the old file by appending a tilde (~) to the file's name. (This happens when you use the ^KX command, but not when using the ^KD (save, then continue) command.)

Other commands of possible immediate interest are the search commands (^KF and ^L) and the spell checker (Do you have ispell installed??). All others are pretty self explanatory. One thing I certainly recommend is playing with an expendable file for a while, learning how to get the most out of joe. Such a file is easy to get—simply copy a file to a new name and toast that one...

4 Other neat things

Wow! Now that I'm doing the writing, I've actually begun to pay attention to all that joe offers, and I stumbled onto a wealth of things I didn't even know existed. This editor has far more to it than initially meets the eye. My eyes had Never picked up the phrase one can plainly read at the top of the Help window when you first type ^KH—the bit saying

more help with ESC . ([.)

I saw it just tonight as I began to write this document, and tried it. What other goodies I found really impressed this non-geek! Macros, special searches, bookmarks, a calculator, having multiple files open (multiple windows), and running a shell (command prompt) in a second window on top of your file are just part of the rest of this really nice editor.

Additionally, I have found joe to be invaluable as my email editor. It automatically does a cool trick when you are fashioning a response to a message and want to reformat the reply. When one quotes another person the quoted part sometimes gets blown off the page, extending beyond the normal limit of columns. This also happens when the other person doesn't properly line wrap their messages. On reformatting such cases, joe automatically adds more quote characters to accomodate new lines mandated by proper wrapping of the lines.

The shell session I'm also intrigued with, as it effectively becomes a whole new document. You can copy stuff over to your own document directly, save the session (which you end by typing `exit') to its own file, or just stop and close this new file with a ^C to get back to your original document.

5 Wrap-up

Joe does not have all the cool features one hears about in emacs or vi. But for someone needing a nice, very functional editor, it's great. What commands I can't remember are always there where I can see them, and joe does all I've ever needed to do to a file. It is not intimidating, and is easy to pick up since many keys do what you expect them to do. It's well worth having on your system!

6 Appendix A: Licence

Copyright (c) 2001 Kenward Vaughan, kaynjay@igalaxy.net

Copyright (c) 2001 Tom Huckstep

Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Synchronising_laptop_and_desktop_files_using_Unison.html0000644000175000017500000006667611257474725033051 0ustar chrischris Synchronising laptop and desktop files using Unison - NewbieDOC

Synchronising laptop and desktop files using Unison

From NewbieDOC


Chris Lale
chrislale users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 0.0 30th September 2006 Revised by Chris Lale
Pre-release.

Revision 1.0 5th October 2006 Revised by Chris Lale
Initial release.

Revision 1.1 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Synchronising laptop and desktop files using Unison


Abstract

If you have a home network, you can edit files on one computer and use Unison to update another computer. This is very useful if you do work on a laptop away from the network for part of the time. Unison will suggest which files on each computer should be updated with files from the other one. If there is a conflict in a file that it cannot resolve, it will suggest not synchronising that file until you have resolved the problem manually. Unison does not rely on Samba or NFS, but uses Ssh to transfer files between the computers. There is a commandline version of Unison and a GUI version using GTK. This article describes the GTK version provided in Debian Etch. The article uses the example of a laptop computer and a desktop computer on a home network, but Unison can be used for any two computers on a network, or even two computers with ethernet interfaces joined by a crossover cable.


Contents


1 Install Debian packages

You probably have the Openssh client installed on both computers already. If not, you must install the openssh-client package on the computer(s) you wish to run Unison from locally. You must install the openssh-server package on the computer(s) you want Unison to contact remotely. For example, if you wish to run Unison from a laptop computer to synchronise with files on a desktop computer, install an ssh server on the desktop. You may find it convenient to install both openssh-server and openssh-client on each computer so that you can run Unison from either machine (providing that both are running and on the network). You will also need one of the ssh-askpass packages if you are going to run Unison from a desktop menu rather than a terminal window. You will need the alacarte package if you wish to add Unison to the Gnome desktop Applications menu.

Install these packages using Synaptic, Aptitude or Apt-get:

openssh-client, openssh-server, unison-2.9.1-gtk

If you wish to add an entry for Unison to the Gnome desktop Aplications menu, install these packages:

alacarte, ssh-askpass or ssh-askpass-gnome

2 Prepare both computers

2.1 Network interface IP addresses

You need to know the IP addresses linked to the network interfaces of each of your computers. If you have no network at all, you can safely use a private network such as 192.168.1.0. In this case you can then give your computers the network addresses 192.168.1.2 and 192.168.1.3.

If you are using a broadband DSL/ADSL modem/router to connect to the internet, your computers may get their IP addresses from a built-in DHCP server. You need to reconfigure your modem/router to give your laptop and desktop machines static IP addresses. For example, if your network is 192.168.1.0 and your modem/router is at IP address 192.168.1.1, you could allocate your desktop to 192.168.1.2 and your laptop to 192.168.1.3.

Make sure that you configure the /etc/network/interfaces file on each computer to match. In this example the /etc/network/interfaces file for the desktop computer with an ethernet interface may look like this:

auto eth0

iface eth0 inet static
	address 192.168.1.2
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1

The /etc/network/interfaces file for a laptop computer with a wireless adapter may look like this:

auto wlan0
allow-hotplug wlan0

iface eth0 inet static
	address 192.168.1.3
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1
 
Note
Note: 
Check that you can ping each computer from the other using the commands ping 192.168.1.2 and ping 192.168.1.3 .
 

2.2 Link hostnames to IP addresses

It is easier to use the hostnames of your computers rather than their IP addresses. The hostname is set at boot using the name stored in the file /etc/hostname. The domain name, in the file /etc/resolv.conf.You can find out what the hostnames are using the command hostname. For example, if your laptop computer has the hostname laptop and you are using the domain name home for your home private network:

$ hostname
laptop

If you wish to change the hostname, you must do two things:

  1. set the new hostname using the hostname newname command as user root,
  2. edit the /etc/hostname file so that it contains the newname; this makes the change permanent.

You can can tell your computer about the names you have given to other IP addresses on your private network. Just add the information to each computer's /etc/hosts file. For example, this file on laptop tells the laptop computer that the computer with IP address 192.168.1.2 is called desktop and belongs in the domain home:

127.0.0.1 localhost laptop

192.168.1.2 desktop.home desktop

# The following lines are desirable for IPv6 capable hosts
[...]


Make sure that /etc/hosts for desktop contains

127.0.0.1 localhost desktop

192.168.1.3 laptop.home laptop

3 Set up Ssh

At least one of the computers must have an ssh server installed. If you run Unison from laptop, you will need an ssh server on desktop. If you run Unison from desktop, you will need an ssh server on laptop. Configure and test the ssh connection for each computer. The example that follow assumes that the desktop is the local computer (the one that you are working on), and the laptop is the remote computer.

3.1 Set up the ssh connection to the laptop from the desktop

Run ssh from a user account on the desktop and connect to a user on the laptop. In this example, both users have the same username - "chris". This is not essential, but it is probably what you want. From the desktop

$ ssh chris@laptop
	
The authenticity of host 'laptop (192.168.1.3)' can't be established.
RSA key fingerprint is 53:b4:ad:c8:51:17:99:4b:c9:08:ac:c1:b6:05:71:9b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'desktop,192.168.1.3' (RSA) to the list of known hosts.
chris@laptop's password:

Enter the password for user chris on the laptop. If you are successful, you will see the prompt for chris@laptop.

[...]
	
chris@laptop:~$

Close the ssh connection to return to the prompt for chris@desktop.

$ exit
logout
Connection to laptop closed.
chris@desktop:~$

3.2 Check that Unison will run via ssh

From desktop

$ ssh laptop unison-2.9.1-gtk -version
$ chris@laptop's password:

Enter the password for chris@laptop.

unison version 2.9.1

Close the ssh connection to return to the prompt for chris@desktop.

$ exit
logout
Connection to laptop closed.
chris@desktop:~$

3.3 Set up an ssh key

A key is a convenient alternative to a password. At the moment, you will have to supply the user's password every time that you connect with ssh. If you set up a key, you can arrange that it is supplied automatically after first use during a session.

If you do not already have an ssh key, create one using ssh-keygen. You will need to supply a pass phrase. Choose something that you will remember - a short line from your favourite song perhaps? From desktop

$ ssh-keygen -t dsa
	
Generating public/private dsa key pair.
Enter file in which to save the key (/home/chris/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/chris/.ssh/id_dsa.
Your public key has been saved in /home/chris/.ssh/id_dsa.pub.
The key fingerprint is:
93:58:20:56:72:d7:bd:14:86:9f:42:aa:82:3d:f8:e5 chris@desktop

There is now a pair of keys - a private key and a public key. Never give anyone else your private key. You can give the public key (with a .pub extension to anyone that needs it. You must give chris@desktop's public key to chris@laptop. Copy key to chris@laptop using the secure copy command scp. From desktop

$ scp ~/.ssh/id_dsa.pub chris@laptop:.ssh/authorized_keys
chris@laptop's password:
id_dsa.pub		100%  600  0.6KB/s  00:00

3.4 ssh into desktop using the key

Check that the key works. From the desktop

$ ssh chris@laptop
Enter passphrase for key '/home/chris/.ssh/id_dsa':
Linux desktop 2.6.17-2-686 #1 SMP Wed Sep 13 16:34:10 UTC 2006 i686

[...]

$ exit

3.5 Cache your identity

Repeatedly supplying the passphrase is as bad (or worse than) repeatedly supplying the password. You can get around this by using the ssh-add command. Do this once and that key will be supplied automatically until you end the session by logging out.

$ ssh-add
Enter passphrase for key '/home/chris/.ssh/id_dsa':
Identity added: /home/chris/.ssh/id_dsa (home/chris/.ssh/id_dsa)

3.6 test by ssh-ing into the laptop with your stored identity

This time you should get straight in without being asked for your passphrase.

$ ssh chris@laptop
Linux desktop 2.6.17-2-686 #1 SMP Wed Sep 13 16:34:10 UTC 2006 i686

[...]
	
$ exit

3.7 Set up ssh for the other computer

Repeat the process in this section to set up an ssh server for the other computer. Just swap "laptop" and "desktop" in the example above.

4 Test-run unison-2.9.1-gtk

To run Unison from the desktop PC, you must have an ssh server running on the laptop. If you run Unison from a terminal window, you will be asked for your passphrase in the terminal window. If you run Unison from a menu (see above), you must have one of the "askpass" packages installed. This will enable a dialogue window to pop up and ask for your passphrase at the appropriate moment.

4.1 Create test directories and files

Login as a normal user on the desktop computer. Use the file browser or the mkdir and touch commands to create a directories (folders) and empty files with this structure:

     a.tmp/
     |
     |__ d/
     |   |__ f
     |
     |__ a
     |__ b        

The commands that will do this are:

mkdir a.tmp
touch a.tmp/a a.tmp/b
mkdir a.tmp/d
touch a.tmp/d/f

Login to the laptop computer and do the same thing, only this time call the first directory b.tmp.

     b.tmp/
     |
     |__ d/
     |   |__ f
     |
     |__ a
     |__ b        

Delete file a in a.tmp. Edit the other files so that they have the following contents:

file a.tmp b.tmp
a (delete file)
b Hello Hello
c 1066
d/h Hi there Hello there

The commands that will do this on the desktop are:

rm a.tmp/a
echo Hello > a.tmp/b
echo "Hi there" > a.tmp/d/h

The commands that will do this on the laptop are:

echo Hello > b.tmp/b
echo 1066 > b.tmp/c
echo "Hello there" > b.tmp/d/h

In order to be synchronised, file a should be deleted from b.tmp, file b does not need synchronising and file c on a.tmp should be updated with the contents of a.tmp/c. Also, the two versions of file h are in conflict - they have the same filename but different contents.

4.2 Run Unison from a terminal window

Make sure that the laptop and desktop are both running. Login to the desktop as the normal user whose files you wish to synchronise. Open a terminal window and enter the command for Unison.

$ unison-2.9.1-gtk

In the dialogue for "Profiles", select the "default" profile and click on OK.

Image:dir.png

Now choose the two "roots". These are the directories that you wish to synchronise. In the first dialogue for "Root selection", type in the name of the directory on the local machine (desktop) in the "Dir:" box. Click on OK.

Image:directory.png

In the second dialogue for "Root selection", type in the name of the directory on the remote machine (laptop) in the "Directory:" box. Select the "SSH" radio button. Type the hostname of the remote coputer (laptop) into the "Host:" box. Type the username of the user on the remote coputer (laptop) into the "User:" box. Click on Continue.

Supply your passphrase. If you are running Unison from a terminal window, the message requesting the passphrase will be in the terminal window. Enter the passphrase in the terminal window.

You may see a message about contacting the server. You have just created a profile and you are running it for the first time. The first time that you run a profile you will see a warning about there being no archive files. Just click on OK.

Image:main.png

The main window appears. In the example you can see three different actions:

  • A red question mark indicates a conflict that Unison cannot resolve without your help. In this example there are two new files with the same name and different contents. Click on the Diff button and you can see the difference between the two files - one contains "Hi there" and the other contains "Hello there".
  • A green right arrow indicates that a change in the local file must be used to update the remote file. In this example the local (desktop) file has been deleted and Unison wants to delete the remote (laptop) file.
  • A green left arrow shows that a change on the remote system will be propagated to the local system.

You can override the proposed actions by highlighting the action and clicking on the left arrow and right arrow buttons. The proposed override is shown as a blue arrow.

If you are happy with the changes, click on go. Only the green and blue actions will take place. Click on the Quit button to close Unison.

5 Add Unison to the Gnome menu (optional)

Use the Alacarte Menu Editor to add Unison to the Gnome desktop Applications menu. Run Alacarte and select a suitable sub-menu from the left-hand pane. You can create a completely new sub-menu using

  • File -> New Menu

if you wish. Choose New Entry from the File menu, type "Unison" in the "Name:" box and "/usr/bin/unison-gtk" in the "Command:" box. Click OK.

  • File -> New Entry
    • Name: Unison
    • Command: unison-gtk
    • OK

Make sure that you have installed either the ssh-askpass or the ssh-askpass-gnome package, or one of the alternatives, so that you can supply your passphrase to Unison.

6 Managing profiles

Your Unison profiles are stored in the hidden directory .unison in your home directory. The profile files are plain text and have the file extension .prf. For example, the default profile is ~/.unison/default.prf. You can delete any profiles you do not wish to use. If you delete all your profiles, Unison will create a new default profile the next time you run it.


7 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale. chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Setting_up_a_serial_modem_using_Wvdial.html0000644000175000017500000004313411257474725030174 0ustar chrischris Setting up a serial modem using Wvdial - NewbieDOC

Setting up a serial modem using Wvdial

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 5th July 2005 Revised by Chris Lale
Initial release.

Revision 1.1 1st February 2006 Revised by Chris Lale
Revised for NewbieDOC wiki by converting source to wikitext. Made a few other minor alterations.

Revision 1.2 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Setting up a serial modem using Wvdial


Abstract

This article explains how to install and use a serial modem for internet access on a Debian GNU/Linux computer using Wvdial. Wvdial is a command line program. These instructions have been tested in Debian 3.1 (Sarge) with a serial port modem. They have not been tested for a USB modem. If you have an internal modem ('winmodem') go to http://www.linmodems.org/ for advice.


Contents


1 Documentation

1.1 FAQ

http://www.dsb3.com/wvdial/

1.2 Manual pages

Man pages are available after you have installed the Debian packages.

  • wvdial (1)
  • wvdial.conf (5)
  • wvdialconf (1)

You can read the man pages using the man command:

$ man 1 wvdial
$ man 5 wvdial.conf
$ man 1 wvdialconf

2 Before you start

Make sure that you have

  • your internet provider's phone number
  • your internet account login name
  • your internet account password.

Make sure that your modem is connected to the telephone socket, the serial port socket and the power supply. Remember to switch the modem on.

3 Installing and configuring Wvdial

3.1 Installing the Debian packages

Install the wvdial package as user root. You can use Aptitude, Apt-get or Synaptic (in X).

You will be asked if you wish to configure Wvdial automatically. Answer yes by pressing the 'y' key.

WVDIAL AUTOCONFIGURATION WvDial includes a program called wvdialconf, 
which can automatically detect your modem and create a /etc/wvdial.conf file. 

Autodetection may cause problems on some computers. 

Do you want to configure wvdial now? [Y/n] 
y

3.2 Autoconfiguring Wvdial

If you entered 'y', Wvdial autoconfiguration begins. You must supply your internet provider's phone number; your internet account login name and your internet account password.

Okay. You now need to specify three facts about your internet account:
- Your internet provider's phone number;
- Your internet account login name;
- Your account password.

Phone number: 0123456789
Login Name: abcdefgh
Password:
Re-enter:

Phone: "0123456789" -- Login: "abcdefgh" -- Password: 
Is this correct? [Y/n]
y

Wvdial will try to detect your modem. The screen output will look something like this:

Scanning your serial ports for a modem.

ttyS0: ATQ0 V1 E1 -- OK
ttyS0: ATQ0 V1 E1 Z -- OK
ttyS0: ATQ0 V1 E1 S0=0 -- OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyS0: Modem Identifier: ATI -- 645
ttyS0: Speed 4800: AT -- OK
ttyS0: Speed 9600: AT -- OK
ttyS0: Speed 19200: AT -- OK
ttyS0: Speed 38400: AT -- OK
ttyS0: Speed 57600: AT -- OK
ttyS0: Speed 115200: AT -- OK
ttyS0: Max speed is 115200; that should be safe.
ttyS0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
Port Scan: S2 S3 S4 S5 S6 S7 S8 S9
Port Scan: S10 S11 S12 S13 S14 S15 S16 S17
Port Scan: S18 S19 S20 S21 S22 S23 S24 S25
Port Scan: S26 S27 S28 S29 S30 S31 S32 S33
Port Scan: S34 S35 S36 S37 S38 S39 S40 S41
Port Scan: S42 S43 S44 S45 S46 S47 S48 S49
Port Scan: S50 S51 S52 S53

If all goes well, you will get a summary like this.

Found a modem on /dev/ttyS0.
Modem configuration written to /etc/wvdial.conf.
ttyS0: Speed 115200; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

Success! You can run "wvdial" to connect to the internet.
(You can also change your configuration by editing /etc/wvdial.conf)

If not, you may need to consider using pppconfig, pon and poff instead of wvdial.

3.3 Re-running wvdial autoconfiguration

If you ever wish to run the autoconfiguration again, use dpkg-reconfigure from the command line (as user root)

# dpkg-reconfigure wvdial

or use Synaptic in X

  • Package -> Configure...

4 Connecting to the internet for the first time

At first, only user root may be able to connect successfully. Enter wvdial at the root prompt to connect.

# wvdial

Wvdial initialises the modem and connects to the ISP's sever.

--> WvDial: Internet dialer version 1.54.0
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT0123456789
--> Waiting for carrier.
ATDT08451203070
CONNECT 44000
--> Carrier detected. Waiting for prompt.

Wvdial authenticates to the ISP's server.

Username:
--> Looks like a login prompt.
--> Sending: abcdefgh
abcdefgh
Password:
--> Looks like a password prompt.
--> Sending: (password)
Authentication Successful.
Entering PPP mode.
Async interface address is unnumbered (Loopback0)
Your IP address is 255.255.255.255. MTU is 1500 bytes
Header compression will match your system.
--> Looks like a welcome message

Wvdial starts the pppd daemon. This is why you have to be root on this occasion.

--> Starting pppd at Mon Jul 4 14:55:52 2005
--> pid of pppd: 5186
--> Using interface ppp0
--> local IP address 255.255.255.255
--> remote IP address 255.255.255.255
--> primary DNS address 255.255.255.255
--> secondary DNS address 255.255.255.255

5 Testing the connection

Use Ping to test the connection by querying the ISP's nameservers with a domain name eg google.co.uk. Open a terminal or terminal window and enter the ping command as user root. You should should see replies like these.

# ping google.co.uk
PING google.co.uk (216.239.57.104) 56(84) bytes of data.
64 bytes from 216.239.57.104: icmp_seq=1 ttl=244 time=159 ms 
64 bytes from 216.239.57.104: icmp_seq=2 ttl=244 time=160 ms
64 bytes from 216.239.57.104: icmp_seq=3 ttl=244 time=160 ms
64 bytes from 216.239.57.104: icmp_seq=4 ttl=244 time=160 ms
64 bytes from 216.239.57.104: icmp_seq=5 ttl=244 time=159 ms

Stop Ping with ctrl-C (hold down the Control key and press the C key).

^C
--- google.co.uk ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 159.865/160.407/160.875/0.603 ms
# 

5.1 Troubleshooting

If you do not get any replies from ping

  • Check that you are root (with the '#' prompt). If not, hang up, log in as root and reconnect.
  • Check that networking is not running on your system.
# /etc/init.d/networking stop

Hang up, and reconnect.

6 Hanging up

Hang up with ctrl-C (hold down the Control key and press the C key).

^C
Caught signal #2! Attempting to exit gracefully...
--> Terminating on signal 15
--> Connect time 0.4 minutes.
--> Disconnecting at Mon Jul 4 14:56:18 2005
#


7 Connecting as a non-root user

Users who connect to the internet must be able to start ppp. The users must belong to group dip. There are detailed instructions for managing users and groups at http://newbiedoc.berlios.de/index.php/Manage_users_and_groups.

You can check the groups you belong to with the groups command. Enter the command from the user's prompt at the command line. Here is the result for a user called username who does not belong to group dip.

$ groups
username dialout cdrom floppy audio video plugdev

Add a user to the dip group with the command adduser username dip (as root, of course).

# adduser username dip

If the user has a session running, the user must logout and login again before the new group membership takes effect. User username should now be able to connect to the internet using Wvdial.

$ wvdial

8 Appendix A: Licence

Copyright ©2005-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Mail_-_retrieving.html0000644000175000017500000003334611257474725023660 0ustar chrischris Mail - retrieving - NewbieDOC

Mail - retrieving

From NewbieDOC

Andrei Popescu
andreimpopescu at gmail dot com (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 14th July 2007 Revised by Andrei Popescu
Initial release.

Revision 1.1 27th November 2007 Revised by Andrei Popescu
Reformatted for newbiedoc package. Added Revision History, Abstract and License in Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Mail - retrieving


Abstract

Help for Debian newbies wnting to retrieve mail from a POP account using Getmail.


Contents


1 Introduction

There are many ways to retrieve mail on a Debian GNU/Linux system. Most graphical and even some non-graphical mail clients, also known as MUA (Mail User Agent) can do this. The method I describe below has the big advantage that it does not depend on any MUA. This way you can still receive mail even if your graphical mail client (or whole X) is broken for some reason. (This is almost unheard of with the stable distribution, but can happen if you run unstable).

2 Basic Setup

The best known program for this task is fetchmail. While fetchmail can do a lot of things it is not very easy to setup. For this reason I choose getmail. We need to install it first and need to be root for that:

# aptitude install getmail4

There is also a getmail package, but it is unmaintained and you shouldn't use it. After completing the installation you can (and should) continue your work from your normal account. First we need to create a directory for getmail's files. The standard location is in your own home directory (Note: I will asume you work from your homedir. If this is not the case then you must prepend something like "~/" to all paths):

$ mkdir .getmail

We also need to create a storage for the mail. A good option is the Maildir format, as it allows different programs to access the storage at the same time (as opposed to mbox). The best way would be to create this using your mail client. If the default storage of your client is not Maildir just look for the "new mailbox" or similar option. Some clients also need a separate plugin in order to use Maildir style storage. The Maildir should best be created in your homedir. Make sure you know the name of the directory as you will need it. I will assume it is 'Maildir'. Another way to create maildirs is to use the program 'maildirmake' from the maildrop package.

3 getmailrc - getmail's configuration file

In order to use getmail we need to tell it some information about our mail account. This goes to the getmailrc file. You will need to create one for each account you want to retrieve mail from. For the moment we will create just one (replace 'mcedit' with your prefered editor):

$ mcedit .getmail/getmailrc

For a typical POP3 account you will need to add something like the following (lines starting with # are just comments):

[retriever]
type = SimplePOP3Retriever
server = pop.example.com
username = your_username
password = your_password

[destination]
type = Maildir
path = ~/Maildir/

[options]
# we don't want to retrieve the same messages at each run
# remove the # from the next line *after* you are sure everything is setup ok
#read_all = False

# delete messages from the server 3 days after retrieving them
# or use 'delete = true' instead
# remove the # from the next line *after* you are sure everything is setup ok
#delete_after = 3

As you can see, the two options are commented out. This is done to prevent loss of mail in the configuration phase. After everything is setup ok you should uncomment them. We also need to make this file unreadable by other users on the system because it contains the password in clear text:

$ chmod 600 .getmail/getmailrc

We can test the configuration by invoking getmail with no arguments. The result should look like the following:

~$ getmail
getmail version 4.6.5
Copyright (C) 1998-2006 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimplePOP3Retriever:your_username@pop.example.com:110:
  msg 1/1 (3622 bytes) delivered
  1 messages retrieved, 0 skipped

Getmail retrieved the message number 1 from a total of 1. Use your mail client to read the mail. You might need to tell it to refresh folders to see the new mail (pressing the Receive/Get Mail button might be enough). If you have many messages waiting on your server you should interrupt getmail after retrieving a couple of them by using Ctrl C if you don't want all messages retrieved many times. This is only needed in the test phase, because later we will enable the necessary options in getmailrc. If the test was ok then we need some final steps.

4 Finishing touch

Obviously, we should first enable the two options in getmailrc to prevent duplicate messages. If you don't want to run getmail occasionaly (by invoking it from commandline) there is one more thing to do. Following unix philosophy, getmail does not include the possibility to run automaticaly at specified intervals, but relies on cron for that. Cron should already be installed and running on your system, so all you need is to setup a "crontab". Crontabs are just text files in a special location, but you should only create/edit them with the following command:

$ crontab -e

Depending on how your system is setup, the editor vi might be the one used. If this is not what you want (type ":q" whitout the quotes and press Enter to exit vi) then use the following (replace 'mcedit' with your prefered editor, of course):

$ EDITOR=mcedit crontab -e

For an interval of 10 minutes, your crontab should look like this:

# m h  dom mon dow   command                                                                                                 
0-59/10 * * * * /usr/bin/getmail --quiet

5 Appendix A: License

Copyright (c)2007 Andrei Popescu, andreimpopescu at gmail dot com

This document has been released by the author under a Free license (which should be indicated beneath this notice). You may use it freely according to its particular license.

Free Software License: Either GNU FDL or GNU GPL at your choice.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."
GPL This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Installing_Ndiswrapper_in_Debian.html0000644000175000017500000004665711257474725026747 0ustar chrischris Installing Ndiswrapper in Debian - NewbieDOC

Installing Ndiswrapper in Debian

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 5th May 2005 Revised by Chris Lale
Initial release on Ndiswrapper wiki.

Revision 1.1 21st May 2007 Revised by Chris Lale
Initial release on NewbieDOC wiki from archive copy after disappearance from Ndiswrapper wiki.

Revision 1.2 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package. Added Revision History, Abstract and Licence Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Installing Ndiswrapper in Debian


Abstract

Archive copy of "Installing Ndiswrapper in Debian (Sarge)" contributed to the Ndiswrapper wiki by Chris Lale. Added to NewbieDOC wiki after disappearing from the Ndiswrapper wiki.


Contents


1 Install Ndiswrapper

1.1 Either install the deb package

Add to /etc/apt/sources.list

deb http://ndiswrapper.sourceforge.net/debian/ /

Update and install ndiswrapper-source

1.2 Or download and install the source tarball

Installation guide at http://ndiswrapper.sourceforge.net/wiki/index.php/Installation (Installation) Instructions tested on Sarge using a D-link DWL-650G AirPlus cardbus adapter

2 Set up Ndiswrapper

Login as a normal user and switch user to root

$ su

(supply root password)

#

2.1 Install wireless-tools

# aptitude install wireless-tools

2.2 Make sure that kernel headers are available

Either install kernel-source-n.n.n package and compile kernel, or install a kernel-image and matching kernel-headers package (check installed kernel using uname -a).

Due to a recent upgrade in the debian package system, you now do this in Etch by running

apt-get install linux-image-`uname -r`
apt-get install linux-headers-`uname -r`

2.3 Add link to kernel headers

# ln -s /usr/src/kernel-src-n.n.n /lib/modules/n.n.n/build

2.4 Download ndiswrapper

to a suitable directory eg ~/ndis-install.

2.5 Unpack ndiswrapper

# tar -xzvf ndiswrapper-0.11.tar.gz.

2.6 Make and install ndiswrapper

cd to ~/ndis-install/ndiswrapper-0.11 and

# make install.

2.7 Copy Windows drivers

Copy Windows drivers to eg ~/wifi-drivers. Eg for D-link DWL-G650:

A3AB9x.sys
A3AB.cat
A3AB.sys
DWLInst.dll
DWLNdi.dll
NetA3AB.inf

2.8 Install the Windows driver

# ndiswrapper -i ~/wifi-drivers/NetA3AB.inf

2.9 Check Windows driver is present

# ndiswrapper -l
Installed ndis drivers:
neta3ab driver present, hardware present

2.10 Load the module

# modprobe ndiswrapper

2.11 Check that interface is available

# iwconfig

2.12 Set essid

(replace mylan with essid set up on AP).

# iwconfig wlan0 essid mylan

2.13 Check for Access Point (AP)

# iwlist wlan0 scan

2.14 Set mode

# iwconfig wlan0 mode Managed

2.15 Set WEP encryption

# iwconfig wlan0 key restricted XXXXXXXX

2.16 Take down any existing ethernet hardwired interface

Other interfaces seem to cause a conflict and prevent the wireless interface from working properly.

# ifdown eth0

2.17 Bring up wireless interface

# ifup wlan0

Note: If it complains about unknown interface wlan0, edit /etc/network/interfaces to include an entry for wlan0 mirroring eth0

2.18 Test the interface

(Replace 192.168.1.1 with the IP of your AP - the gateway.)

# ping 192.168.1.1

2.19 Make ISP's nameservers are available.

Edit /etc/resolv.conf and add a nameserver line for each of your ISP's nameservers.

search
nameserver nnn.nnn.nnn.nnn
nameserver nnn.nnn.nnn.nnn

2.20 Test nameservers

# ping google.co.uk

3 Permanent setup once everything is working

3.1 Set module to load at boot

Add line

ndiswrapper

to /etc/modules. This can also be done via the 'modconf' utility by simply installing the module (select 'misc' -> 'ndiswrapper')

3.2 Disable existing ethernet interface

Comment out any entry for eth0 in /etc/network/interfaces

3.3 Enable wireless interface

Add entry for wlan0 to /etc/network/interfaces. See man wireless and /usr/share/doc/wireless-tools/README.Debian.

Note: one of these documents documents a "wireless-" prefix for wireless command, the other gives "wireless_" (underline character instead of hyphen). Both seem to work interchangeably.

auto wlan0
iface wlan0 inet static
address 192.168.1.nnn
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
	# replace mylan with the essid set up on the AP
wireless-essid mylan
wireless-mode Managed
	# Set up encryption.
wireless-keymode restricted
wireless-key1 XXXXXXXXXX
wireless-defaultkey 1

Note: including the line

wireless-keymode open

caused a configuration error when the network started. My AP is in open mode and still works without this line.

3.4 Test

First, shut down the computer, set up encryption on the AP and boot the computer. You may have problems trying to set encryption on the AP while the computer is still connected without encryption.

# ifdown wlan0
# ifup wlan0
# ping google.co.uk

3.5 Test the init scripts

(these call ifup/ifdown)

# /etc/init.d/networking stop
# /etc/init.d/networking start
# ping google.co.uk

Exit the root user account

# exit
$

I hope it works for you. It did for me.

4 Appendix A: Licence

Copyright ©2005-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Setting_up_a_personal_firewall_on_Debian_using_Guarddog.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Setting_up_a_personal_firewall_on_Debian_using_Guarddog.ht0000644000175000017500000006425311257474725033164 0ustar chrischris Setting up a personal firewall on Debian using Guarddog - NewbieDOC

Setting up a personal firewall on Debian using Guarddog

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 0.1 6th February 2006 Revised by Chris Lale
Initial release.

Revision 0.2 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Setting up a personal firewall on Debian using Guarddog


Abstract

This HOWTO describes how to install and use the Guarddog firewall configuration tool in Debian GNU/Linux. Guarddog use a simple but flexible GUI interface to configure iptables. It makes a great personal firewall for a standalone or networked PC.


Contents


1 Documentation

2 Introduction

A firewall is software that stops your computer communicating with other computers. A PC that cannot communicate with other computers is not much good if you want to use the internet. You must make holes in the firewall to permit communication in particular protocols (languages). Having a firewall does not mean that you can forget about other security measures.

For example, the language of web pages is the HTTP protocol. The languages of email are the SMTP and POP3 protocols. You make holes in the firewall to allow these protocols by opening ports.

Guarddog sets up a firewall using iptables. iptables is the standard way of firewalling in Debian GNU/Linux. iptables is very flexible but it is difficult to set up manually. Guarddog provides an easy way of mangaging a firewall through a Graphical User Interface (GUI), with the power of iptables but without the need to know iptables syntax.

Guarddog is a configuration tool iptables. iptables continues to run even after you exit from Guarddog. iptables will run automatically every time you boot your PC, so you only need to run Guarddog if you wish to change the firewall's configuration.

3 Installing Guarddog

Install this package using Synaptic, Aptitude or apt-get:

guarddog

During installation you may see a message like this:

Setting up guarddog (2.4.0-1) ...
Unable to start guarddog firewall - /etc/rc.firewall does not exist

Don't worry. The /etc/rc.firewall configuration file will be created the first time you run Guarddog.

4 Run Guarddog

Run guarddog as root

From Gnome:

  • Applications -> System Tools -> Run as different user
    • Run: guarddog
    • As user: root
    • OK

From KDE:

  • Applications -> Guarddog

The first time you run Guarddog you may get this warning:

Guarddog was unable to find a Guarddog firewall 
at /etc/rc.firewall.

This is probably ok, it just means that this is the 
first time Guarddog has been run on this system.

But please be aware that the firewall settings 
shown may not represent the system's current
firewalling configuration.

Your Guarddog firewall will take effect once you 
use the 'Apply' button or exit Guarddog using 'Ok'.

You do not need to take any action. Just be aware that the default settings are not necessarily those of any existing firewall.

  • OK

5 Configuring an Internet firewall on your Local PC

5.1 Zones

By default, Guarddog has two zones.

Internet
This zone includes all hosts (computers) on the other side of your modem or DSL/ADSL broadband router.
Local
This is the computer that the firewall is running on - your PC.

5.2 Permitting the Domain Name System (DNS) protocol

The DNS protocol enables you to access computers on the internet using a name like google.co.uk rather than an IP address like 216.239.59.147. You need to open a port for DNS in order to use the web. Do this from the Protocol tab.

Guarddog settings to permit the DNS protocol

  • Protocol tab
    • Defined Network Zones: Internet
    • Protocols served from zone 'Internet' to clients in zones: + Network (expand)
      • Network Protocol
        • DNS - Domain Name Server
      • Local
        • protocol is permitted (tick)
 
Note
Note: 
All boxes that are unticked will be blocked. Permitting just DNS is not sufficient to receive a web page from the internet. You must also permit HTTP - see below.
 

Save and continue

  • Apply
You are about to modify the system's firewall 
configuration.

These changes may disrupt current network 
connections.

Do you wish to continue?
  • Continue
Starting firewall...

Output:

Using iptables.
Resetting firewall rules.
Loading kernel modules.
Setting kernel parameters.
Configuring firewall rules.
Finished.
  • OK

5.2.1 Test the firewall

The DNS protocol is now permitted, but HTTP is not (its Local box is still unticked). To test this, run a web browser and try to visit a site, eg google:

http://google.co.uk

Since the HTTP protocol is blocked, you should not be able to access the web page. The firewall is working!

Disable the firewall by putting a cross in the Disable Firewall box.

  • Advanced (tab)
    • Disable Firewall (cross)
  • Apply
You are about to disable the system's firewall.
This will allow all network traffic and potentially 
leave your system vulnerable to attack.

Unless you are an advanced user and know 
what you are doing I recommend that you cancel 
this action.

These changes may also disrupt current network 
connections.

Do you wish to continue?
  • Continue
Resetting firewall...

Output:

Using iptables.
Resetting firewall rules.
Finished.
  • OK

Check that you can now receive web pages. Try again to visit google:

http://google.co.uk

You should see the web page! The firewall is disabled, so the HTTP protocol (and all the others) is permitted again.

5.3 Permitting the web page (HTTP) protocol

 
Note
Note: 
Re-enable the firewall before continuing. If you disabled the firewall in the previous step and do not re-enable it, all the protocols will be greyed-out.
 

You must permit the HTTP protocol in order to be able to view web pages in your web browser. Some web pages use the secure HTTPS protocol instead eg if you are buying something online.

  • Protocol tab
    • Defined Network Zones: Internet
    • Protocols served from zone 'Internet' to clients in zones: + File Transfer (expand)
      • Network Protocol
        • HTTP - World Wide Web
      • Local
        • protocol is permitted (tick)
      • Network Protocol
        • HTTPS - World Wide Web over SSL
      • Local
        • protocol is permitted (tick)

Save and continue

  • Apply

Check that you can receive web pages with the firewall enabled. Try again to visit google:

http://google.co.uk

You should receive a web page.

6 Permit other protocols you may need

You probably need more than just HTTP. If you send email you probably use an SMTP server, and if you receive email a POP3 server. If you have a website hosted remotely you probably need to permit the FTP or SSH protocols. You may also use network tools, such as PING, on the internet. Permit just the protocols that you need. Here is a list of some common protocols that you can permit to be served from the Internet zone to the Local zone.

web pages
HTTP
HTTPS
DNS
sending email
SMTP
receiving email
POP3
may also require ident/auth for authentication
transferring files to and from a remote host (eg a hosted website)
FTP
SSH
network tests you may wish to use on the internet
PING

There are others you may need like chat, games, media, etc. Just look through the Protocol tree in the Protocols tab. If you need something not listed, you can always add user-defined protocols to the list.

Make the changes that you need and apply them with the Apply button. Test the new firewall configuration. When you are satisfied that everything is working correctly, save and exit by clicking on the OK button.

  • OK

7 Using guarddog with a Samba Network

Samba is a great way to run a small office or home network. Samba allows you to have both Linux and Windows computers on the network. Samba uses the SMB application level protocol. You must permit Windows Networking (NETBIOS) and Microsoft SMB over TCP for Windows 2000 and later. You need to know your local network's broadcast address and the addresses or address range of the computers on the network.

 
Tip
Tip: 
You can find the broadcast address with ifconfig.
 

7.1 Set up a zone for the local network

This example shows how to create a zone Home for a home LAN network with the address range 192.168.1.0/255.255.255.0 with a broadcast address of 192.168.1.255.

Create a new zone:

  • Protocol tab
    • Defined Network Zones: New Zone

Select the new zone and modify its properties:

  • Protocol tab
    • Defined Network Zones: new zone
    • Zone Properties
      • Name: Home
      • Comment: Home LAN
      • New Address
        • 192.168.1.255
      • New Address
        • 192.168.1.0/255.255.255.0


7.2 Allow you PC to connect to the network

Join the Home zone to the Local zone:

  • Protocol tab
    • Connection
      • Local (ticked)

Apply the changes.

  • Apply

7.3 Test the network connections

Check that you can access your PC from another station on the network. For Windows machines, look in 'Network Neighborhood'. For Linux machines use LinNeighborhood, or use Nautilus (Gnome File Manager) or Konqueror (KDE File Manager) to look at smb:///.

8 Adding user-defined protocols for Vipul's Razor

Check the Razor2 FAQs to find the ports you need. The FAQs are in the package documentation directory:

/usr/share/doc/razor/FAQ

For Debian Sarge, the information is:

Outgoing TCP port 2703 (Razor2) and TCP port 7 (Echo). Razor2
uses TCP pings to discover what servers are closest to it.

8.1 Add new ports for Razor2 and Echo

  • Advanced tab
    • User Defined Protocols:
      • New Protocol button
      • Name: Razor2
      • Type: TCP
      • Ports: 2703 - 2703
      • New Protocol button
      • Name: Echo
      • Type: TCP
      • Ports: 7 - 7
  • Apply

8.2 Permit Razor2 and Echo

  • Protocol tab
    • Defined Network Zones: Internet
    • Protocols served from zone 'Internet' to clients in zones: + User Defined (expand)
      • Network Protocol
        • Echo
      • Local
        • protocol is permitted (tick)
      • Network Protocol
        • Razor2
      • Local
        • protocol is permitted (tick)
  • Apply

8.3 Permit PING

  • Protocol tab
    • Defined Network Zones: Internet
    • Protocols served from zone 'Internet' to clients in zones: + Network (expand)
      • Network Protocol
        • Ping
      • Local
        • protocol is permitted (tick)
  • Apply

8.4 Test Razor

Run razor-admin as a normal user to discover razor servers. Use the debug mode:

$ razor-admin -d -discover

If successful, you should see this line at the end of the debug messages:

 razor-admin finished successfully.

If the firewall is still blocking razor, it continues to try and discover the servers, but without success.

9 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Firewall_with_masquerading.html0000644000175000017500000003110011257474725025646 0ustar chrischris Firewall with masquerading - NewbieDOC

Firewall with masquerading

From NewbieDOC

Andrei Popescu
andreimpopescu at gmail dot com (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 14th July 2007 Revised by Andrei Popescu
Initial release.

Revision 1.1 27th November 2007 Revised by Andrei Popescu
Reformatted for newbiedoc package. Added Revision History, Abstract and License in Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Firewall with masquerading


Abstract

A HOWTO to help Debian newbies to set up a simple firewall and share an internet connection with Shorewall in Debian Etch


Contents


1 Introduction

The firewall in Debian is not activated by default. Here is a short example using shorewall 3.2.6-2 from etch. The configuration described here is very simple and should be sufficient for a simple setup. Shorewall is very powerfull, if you need more complicated stuff it can probably be done. Of course, you can set up a basic firewall much easier with a GUI-based frontend (ex. Firestarter), but it's much more difficult to do it remotely. The config files for shorewall can be edited very easy over ssh, which should work even on a dial-up connection without problems. This way you can have a headless machine (no monitor) for lots of stuff which can be done without a gui. I use the firewall machine for large downloads, listening to internet radio, playing mp3, ... everything over ssh, without ever needing a monitor.

Disclaimer: This is just a basic configuration. There is much more to security then setting up a firewall so don't blame me if you get cracked. If you are serious about security you should read more documentation. The Securing Debian Manual would be a good start.

2 Main

All actions will need root privileges, so make sure you change to root with su (or use sudo). First we need to install shorewall:

#aptitude install shorewall

shorewall is installed with an (almost) empty configuration. We can use the supplied default files with a few minor changes/additions. The files also contain lots of information and many more options. Note: when you need to add lines add them at the end of the file, just above the last line. Read the instructions in the file and you should figure it out.

#cp /usr/share/doc/shorewall/default-config/* /etc/shorewall/

Now use your prefered editor (ex. mcedit) to modify some files:

#mcedit /etc/shorewall/shorewall.conf

change IP_FORWARDING to On if you want to use your computer as a gateway:

IP_FORWARDING=On

I will assume eth0 is the internet connection (with dhcp) and eth1 is the connection to the rest of your network. Change to suit your configuration:

#mcedit /etc/shorewall/interfaces

add following lines:

net        eth0        detect         dhcp
loc        eth1        192.168.0.255
#mcedit /etc/shorewall/policy

add following lines (order is important):

loc        all         ACCEPT
fw         all         ACCEPT
net        all         DROP
all        all         REJECT
#mcedit /etc/shorewall/zones

add following lines:

fw      firewall
net     ipv4
loc     ipv4
#mcedit /etc/shorewall/masq

If you need masquerading (use your computer as a gateway for your network) you will also need to change the following:

#mcedit /etc/shorewall/masq

add following line:

eth0     eth1

Now we need to activate our configuration:

#shorewall start

Check your configuration. You should be able to ping the net from the firewall machine and from the network. There are also sites that will perform a scan of your machine. If everything is ok you should have all ports "stealth" except 113 (IDENT). Don't worry if you get a warning about that, oppinions differ. Now we need to make one final change so shorewall will be started on every boot:

#mcedit /etc/default/shorewall

change the 'startup' option from 0 to 1:

startup=1


3 Goodies:

I use the firewall machine for large downloads with bittorrent. For bittorent to work correctly we need to open a few ports. This will NOT work for other machines on your network. For that you will need port forwarding which is not covered here. (Update: ktorrent seems to work very nice irrespective of the firewall)

#mcedit /etc/shorewall/rules

add following line:

ACCEPT      net      fw      tcp        6881:6889

Allow connection to port 22 (ssh) of the firewall machine from a specific ip (great for remote administration):

ACCEPT      net:123.234.123.234   fw   tcp   22

4 Appendix A: License

Copyright (c)2007 Andrei Popescu, andreimpopescu at gmail dot com

This document has been released by the author under a Free license (which should be indicated beneath this notice). You may use it freely according to its particular license.

Free Software License: Either GNU FDL or GNU GPL at your choice.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."
GPL This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Using_RSS.html0000644000175000017500000002427011257474725022134 0ustar chrischris Using RSS - NewbieDOC

Using RSS

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 24 January 2006 Revised by Chris Lale
Initial release.

Revision 1.1 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package. Added Revision History and Licence in Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Using RSS


Abstract

RSS (Rich Site Summary) is an XML document provided by a link on a website which can be read by a feed reader. It provides up-to-date information about certain pages on the site.

NewbieDOC RSS feed for the Recent changes page enables you to monitor the NewbieDOC wiki straight from your desktop.


Contents


1 Do it in 5 seconds

The trivial way to read RSS (small online news) is to just run thunderbird (email client) or opera or firefox / iceweasel (www clients) and add there a new RSS feed. In thunderbird you do it as a new account, in firefox/iceweasel by adding a new bookmark called Live Bookmark. --LimCore 04:17, 5 March 2007 (CET)

2 Liferea

Liferea is a GTK/GNOME aggregator for online news feeds (Linux feed reader). There is more information, including documentation, at http://liferea.sourceforge.net.

2.1 Installing Liferea

The liferea package is included in the Debian distribution. Install it using Synaptic in X, or from the commandline as user root:

# aptitude install liferea

2.2 Setting up Liferea for NewbieDOC

Run Liferea. (If you are using Gnome, use the Applications menu):

Applications -> Internet -> Liferea Feed Reader

Configure Liferea. You can copy the Source: URL from the rss link in the toolbox of the Recent changes page (Toolbox -> Special pages -> Recent pages, Toolbox -> rss):

Feeds -> New Subscription
   Feed Source
      Source Type: URL
      Source: http://newbiedoc.berlios.de/index.php?title=Special:Recentchanges&feed=rss
   OK

Wait, if necessary, until the next dialogue box appears, then

Subscription Properties

(Accept defaults)

OK

2.3 Reading the NewbieDOC feed

In the left-hand pane, click on the feed to read.

NewbieDOC - Recent changes [en]

The right-hand pane shows a list of NewbieDOC wiki pages. The first occurance of a new page shows the text of the edit page. Subsequent occurances should show diffs; a minus sign (-) indicates lines removed, a plus sign (+) indicates lines added. Bold indicates unread, normal font indicates read.

2.4 Getting the latest changes

Highlight the NewbieDOC feed. Update it using the menu

Feeds -> Update Selected

or right-click on NewbieDOC and click on

Update


You get a new unread feed. The older (read) versions also remain until you delete them.

3 Appendix A: Licence

Copyright © 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Managing_a_Creative_Zen_mp3_jukebox_with_Gnomad2.html0000644000175000017500000002703211257474725031706 0ustar chrischris Managing a Creative Zen mp3 jukebox with Gnomad2 - NewbieDOC

Managing a Creative Zen mp3 jukebox with Gnomad2

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 12th December 2006 Revised by Chris Lale
Initial release.

Revision 1.1 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Managing a Creative Zen mp3 jukebox with Gnomad2


Abstract

Gnomad2 transfers files to and from a Creative Zen mp3 jukebox. These instructions have been tested in Debian Etch.


Contents


1 Installation

Install the "gnomad2" package.

2 Transferring files with Gnomad2

Plug the jukebox into a USB port. Wait a few seconds for the jukebox to recognise the connection. If you wish to make sure that the jukebox is recognised, open a terminal window and enter the "lsusb" command to list USB devices. You should see something like this.

$ lsusb
Bus 005 Device 009: ID 041e:411b Creative Technology, Ltd Zen Touch

Run Gnomad2. If you are using the Gnome desktop, you can find it in the menu:

Applications -> Sound & Video -> Gnomad2

You may see some information popup windows while Gnomad2 scans for music files: "track metadata" on your computer and "jukebox library" on your jukebox.


Image:Gnomad2-small.png


Gnomad2 opens with the "Music transfer" tab active. There are two list boxes - one for your computer and one for your jukebox. The computer list contains hyperlinks that enable you to navigate between directories by double-clicking. Select a directory for storing mp3 files. Transferring files is easy. Just highlight the files you wish to transfer, and click on one of the arrow buttons between the two lists. The upper arrow button transfers files from computer to jukebox, and the lower arrow button transfers files from jukebox to computer.


3 Troubleshooting

3.1 Gnomad2 does not communicate with jukebox

3.1.1 Make sure that you belong to the "audio" group

Enter the command "groups" in a terminal window. You should see something like this.

$ groups
chris dialout cdrom floppy audio video plugdev

You must switch user ("su") to root if you need to add yourself to the audio group. Use the "adduser" command. For instance, you would add user "chris" to the "audio" group like this.

$ su
(password for user root)
# adduser chris audio
...
# exit

3.1.2 Try running Gnomad2 from a terminal window

Look for error messages in the terminal window.

$ gnomad2

You may get these messages like these in the terminal window.

   This is a PDE device
   Device was not connected.

You may also get error message in popup windows.

   Could not open jukebox:
   usb_set_configuration: Operation not permitted

3.1.3 Try running Gnomad2 as user root

Run Gnomad2 from a terminal window.

$ su
(password for user root)
# gnomad2

If Gnomad2 runs OK as user root, the problem may be in the file /etc/udev/rules.d/libnjb. rules (from the package libnjb5). These rules control the degree of access to the USB port. Open the file in a text editor (eg Nano) as user root.

# nano /etc/udev/rules.d/libnjb. rules

Look for the "MODE" entries which set access permissions for the USB port. A typical entry looks like this.

# Creative Nomad Jukebox Zen Touch
SYSFS{idVendor}=="041e", SYSFS{idProduct}=="411b", MODE="660", GROUP="audio"

If the MODE is set to "066", edit the file and change it to MODE="770".

# Creative Nomad Jukebox Zen Touch
SYSFS{idVendor}=="041e", SYSFS{idProduct}=="411b", MODE="770", GROUP="audio"

Save the file and exit the text editor. (In Nano, the commands are ctrl-O and ctrl-X.) Restart udev with the new permissions.

# /etc/init.d/udev restart

Exit from user root and test the system as a normal user.

# exit
$ gnomad2

4 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Index.html0000644000175000017500000004343111257474725021367 0ustar chrischris Index - NewbieDOC

Index

From NewbieDOC

Debian NewbieDOC Debian NewbieDOC - Debian documentation FOR newbies BY newbies (and not-so-newbies).

Everyone who uses Debian GNU/Linux was a newbie once, even if they were not a beginner. Being a Debian user also means being part of the Debian community. If the community gives you help, giving help to others is a way of giving something back to the community. One way of helping others is to document your experience of successfully solving a problem. Debian NewbieDOC helps to make this easy because the NewbieDOC website (http://newbiedoc.berlios.de) is is a wiki. Anyone can edit pages and create new ones.

This is a snapshot of some major NewbieDOC articles.


Contents


1 Help installing Debian GNU/Linux

NewbieDOC:Debian basic features
Help with the sort of things that a Debian newbie might like to know about before installing Debian on a computer.
NewbieDOC:How to download Debian GNU/Linux installation CD/DVDs with Jigdo
A guide to help any Debian newbie to download CD and DVD images of the Debian installer. The disc images can be burned to CD or DVD to make official Debian installation CDs/DVDs.
NewbieDOC:How to install Debian GNU/Linux on your computer
This HOWTO helps Debian newbies to install Debian GNU/Linux (Etch) using the Debian graphical installer ("installgui").
NewbieDOC:Installing Debian on a small partition
Help with installinstalling desktop Debian GNU/Linux 4.0 (Etch) from CD/DVD.
NewbieDOC:How to try out Debian GNU/Linux without installing it
Anyone new to Debian (Debian "newbie") might want help and advice about whether to choose Debian. This article describes how to obtain and use the LiveCD version of Debian - Debian Live.

2 Help installing software in Debian GNU/Linux

NewbieDOC:Aptitude - using together with Synaptic and Apt-get
Help for Debian users using more than one package manager. If you do not use Aptitude exclusively, it may attempt to remove packages that you do not wish to remove. Here is some help for newbies (and other Debian users) for managing this problem.
NewbieDOC:Unofficial Debian packages
Read this if you need help finding .debs for software not available on the Debian mirrors.
NewbieDOC:Module-Assistant - using upstream tarballs
A simple hack to use an upstream tarball with Debian's module-assistant for gspca-source

3 Help managing a Debian system

NewbieDOC:How to install and use Debian NewbieDOC documents on your computer
A snapshot of Debian NewbieDOC is available as a Debian package. You can install it on a Debian system and access the web pages using the "newbiedoc" command, from the Debian menu in X11 or using an online documentation reader such as "dhelp", "doccentral" or "dwww".
NewbieDOC:Commandline shortcuts
Debian newbie help with tab completion, commandline history, copying and pasting text.
NewbieDOC:Manage users and groups
Brief newbie help about how to manage users and groups in Debian using Gnome, KDE, generic desktop and commandline tools.
NewbieDOC:Run a program as a different user
Help with using su, gksu and gksuexec - a guide for Debian newbie users and others.
NewbieDOC:How to configure Sudo to run programs as a different user
A newbie guide to using Sudo in Debian GNU/Linux. A normal user can use Sudo to run particular programs with root permissions. With the help of this article, even a Debian newbie can easily configure Sudo using a simple table as an alternative to the Extended Backus-Naur Form used in the Sudoers man (5) page.
NewbieDOC:How to create a Grub disc to boot a Debian GNU/Linux system
It helps to be prepared. This NewbieDOC article helps you to plan for disaster by making a boot floppy or CD to boot your Debian system in case another operating system overwrites your MBR.
NewbieDOC:How to rescue data from a crashed disk on a Debian GNU/Linux system
Helpful suggestions for data recovery from the Debian-User mailing list.
NewbieDOC:Shutting down a Debian system
Newbies often tend to press the RESET button to stop/restart a Debian system. This is the equivalent of pulling the plug - you are risking file corruption. Here is some help about how to shut down your Debian system safely.
NewbieDOC:Cloning a hard disc
This Debian newbie HOWTO explains how to make a clone of a hard disc. If the original hard disc is a failing disc, it must still be working and readable.
NewbieDOC:Runlevels introduction
A guide to help Debian newbies to understand runlevels. Runlevels determine the behaviour of the system once it has booted.
NewbieDOC:Grep Introduction
An introduction to help Debian newbies with the very useful grep program.
NewbieDOC:Process management
Help for Debian newbies about how to manage processes under Debian GNU/Linux.
NewbieDOC:Debian help system
This document is intended to help Debian newbies learn about ways in which they can find help to solve problems in Debian GNU/Linux.
NewbieDOC:Shortcuts for copying and pasting text
Help with to copying and pasting text between X applications and console applications running in a terminal window. There are both keyboard and mouse methods. Written for Debian newbies and all Debian GNU/Linux users.
NewbieDOC:Beginner's guide to Vi Improved (Vim)
This document will help Debian newbies with the console version of vim from Debian. Although much of what is discussed here will also help if you use gvim, it may or may not work with gvim.
NewbieDOC:Using Joe as your editor
Joe is a simple commandline editor apparently based upon/inspired by the old DOS word processor called Wordstar. Help for Debian newbies.
NewbieDOC:Synchronising laptop and desktop files using Unison
If you have a Debian home network, you can edit files on one computer and use Unison to update another computer. This can help if you do work on a Debian (or other Linux) laptop away from the network for some of the time.

4 Help with network and internet

NewbieDOC:Broadband - setting up an ethernet ADSL modem/router
This newbie help is for getting an ethernet ADSL modem/router working on a Debian system. Not for a USB ADSL modem.
NewbieDOC:Setting up a serial modem using Wvdial
This Debian newbie article helps explain how to install and use a serial modem for internet access on a Debian GNU/Linux computer using Wvdial.
NewbieDOC:How to set up a wireless network card using drivers from Debian packages
Debian provides some WiFi cards with drivers in source code form. They are easy to compile and install with module-assistant - even for Debian newbies.
How to set up a wireless network card using Ndiswrapper
Both these articles offer help for setting up wireless cards on Debian systems. They seem to have disappeared from the Ndiswrapper wiki. An archive copy of the Sarge version has been added to NewbieDOC.
NewbieDOC:Installing Ndiswrapper in Debian - Installing Ndiswrapper in Debian Sarge
NewbieDOC:Setting up a personal firewall on Debian using Guarddog
Guarddog use a simple but flexible GUI interface that helps you to configure iptables. It is suitable for Debian newbies and makes a great personal firewall for a standalone or networked PC.
NewbieDOC:Firewall with masquerading
A HOWTO to help Debian newbies to set up a simple firewall and share your internet connection with Shorewall in Debian Etch
NewbieDOC:Installing Samba Linux/Windows networking
These are some notes I made when I installed Samba in Debian Sarge. I hope that they may be helpful to anyone starting with Samba.
NewbieDOC:Mail - retrieving
Help for Debian newbies wnting to retrieve mail from a POP account using Getmail
NewbieDOC:Mail - sending
Help for Debian newbies wanting to send mail using Postfix with smarthost configuration
RSS - how to use RSS feeds
Help for Debian newbies wanting to install Liferea (Linux feed reader) in Debian, and help with using it on the NewbieDOC wiki.

5 Help with multimedia in Debian

NewbieDOC:Sound in Debian GNU/Linux
Help for Debian newbies wanting to get a sound card working in Debian.
NewbieDOC:Managing a Creative Zen mp3 jukebox with Gnomad2
Help for Debian newbies setting up and using Gnomad2 to transfers files between a Creative Zen mp3 jukebox and a Debian system.
NewbieDOC:How to install a scanner in Debian GNU-Linux using Sane
This article should help you to set up a scanner in Debian. It uses the Mustek ScanExpress 1248UB as an example.

6 Help with printing

NewbieDOC:Setting up a parallel printer using CUPS
This article is to help Debian newbies install a parallel port printer on a Debian GNU/Linux computer using CUPS (the Common Unix Printing System).
NewbieDOC:Getting rid of broken print jobs (Debian using CUPS)
Debian newbie help about what to do when something goes wrong in a print job: paper jam, wrong pages, etc
Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_a_scanner_in_Debian_GNU-Linux_using_Sane.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_a_scanner_in_Debian_GNU-Linux_using_Sane.ht0000644000175000017500000003125211257474725032674 0ustar chrischris How to install a scanner in Debian GNU-Linux using Sane - NewbieDOC

How to install a scanner in Debian GNU-Linux using Sane

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 23rd April 2008 Revised by Chris Lale
Initial release.

Live Date(s): click on the history tab. Revised by: click on the history tab.
This is the live, editable version.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to install a scanner in Debian GNU-Linux using Sane


Abstract

This article should help you to set up a scanner in Debian. It uses the Mustek ScanExpress 1248UB as an example. It has been tested using Etch and Lenny.


Contents


1 Check/choose your scanner model

Check that you scanner is supported at the Sane Project website: http://www.sane-project.org/sane-backends.html. Use your browser's search function to locate your model. For instance, to search the page for the Mustek 1248UB using Firefox or Iceweasel:

Ctrl + F
1248

gives this information

Backend: gt68xx
Manufacturer: Mustek
Model: ScanExpress 1248 UB 	
Interface: USB 	
USD id: 0x055f/0x021f 	
Status: Complete

2 Install the Debian packages

sane - scanner graphical frontends sane-utils - API library for scanners -- utilities libsane - API library for scanners xsane - GTK+-based X11 frontend for SANE (Scanner Access Now Easy)

You can find out more about the backend for your scanner by looking at its manual page after you have installed libsane. Eg for the Mustek 1248UB:

$ man sane-gt68xx

You will find more general help in the manual page for sane:

$ man sane

3 Set up the software

3.1 Install the scanner firmware file

Put a copy of the firmware file from the scanner manufacturer's CD into /usr/share/sane/<backend>/.

The name of the file for the Mustek 1248UB is SBSfw.usb. Put it in

/usr/share/sane/gt68xx/

In the case of the Mustek 1248UB, you can also download a copy of the file from http://www.meier-geinitz.de/sane/gt68xx-backend/.

3.2 Check the configuration file

Look at the contents of the configuration file for your backend in /etc/sane.d/<backend>.conf. The file for the Mustek 1248UB is

/etc/sane.d/gt68xx.conf

The section for 1248 UB looks like this:

# Autodetect Mustek ScanExpress 1248 UB
usb 0x055f 0x021f

Some scanners require you to uncomment certain lines. Details are in the manual page for your backend.

4 Test the scanner

Connect your scanner to a USB port.

 
Note
Note: 
The scanner may not work correctly if you connect it via a USB hub. Connect it directly to a USB socket on the motherboard panel at the back of your computer.
 

Check that sane can find the scanner:

$ sane-find-scanner
[...]
found USB scanner (vendor=0x055f, product=0x021f [USB Scanner], chip=GT-6816) at
libusb:005:004
[...]

Check that the scanner has been correctly identified. (Do this as user root.)

# scanimage -L
device `gt68xx:libusb:005:004' is a Mustek ScanExpress 1248 UB flatbed scanner

Carry out a simple test. (This works even without a scanner connected.)

# scanimage -d test -T
scanimage: scanning image of size 157x196 pixels at 8 bits/pixel
scanimage: acquiring gray frame, 8 bits/sample
scanimage: reading one scanline, 157 bytes...   PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
[...]

Carry out a test on your backend (with scanner connected):

# scanimage -d gt68xx -T
scanimage: scanning image of size 2563x3531 pixels at 8 bits/pixel
scanimage: acquiring gray frame, 8 bits/sample
scanimage: reading one scanline, 2563 bytes...  PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
[...]

You may hear the scanner working.

Perform a scan. Put some artwork in the scanner and issue this command:

scanimage --format pnm > outfile.pnm

Open and check the file created in the current working directory.

5 Add users to the scanner group

Sane commands, and the Xsane application, are only available to user root and users in the group 'scanner'. It is not recommended to run Xsane as root.

If you add yourself to the scanner group, don't forget to logout and login again to activate the your membership of the group. Run xsane and enjoy scanning!

6 Appendix A: Licence

Copyright ©2008 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."


Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Setting_up_a_parallel_printer_using_CUPS.html0000644000175000017500000003615311257474725030422 0ustar chrischris Setting up a parallel printer using CUPS - NewbieDOC

Setting up a parallel printer using CUPS

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 2nd July 2005 Revised by Chris Lale
Initial release.

Revision 1.1 8th February 2006 Revised by Chris Lale
Adapted for NewbieDOC wiki by converting source to wikitext. Some formatting and other minor changes made. Removed the section on OpenOffice.org which is no longer relevant. Added a few screenshots.

Revision 1.2 18th April 2006 Revised by Chris Lale
Added package gs-esp to the list of packages and a recommendation for BIOS parallel port setting following discussion on the Debian-user list.

Revision 1.3 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Setting up a parallel printer using CUPS


Abstract

This article explains how to install a parallel port printer on a Debian GNU/Linux computer using CUPS (the Common Unix Printing System). These instructions have been tested with Debian 3.1 (Sarge).


Contents


1 Installing the Debian packages

Install these packages using Aptitude, apt-get or Synaptic (in X):

gnome-cups-manager (may be already installed) - CUPS printer admin tool for GNOME
cupsomatic.ppd - linuxprinting.org printer support - transition package
cups-pdf - PDF printer for CUPS
cupsys - Common UNIX Printing System(tm) - server
cupsys-bsd - Common UNIX Printing System(tm) - BSD commands
cupsys-client - Common UNIX Printing System(tm) - client programs (SysV)
cupsys-driver-gimpprint - Gimp-Print printer drivers for CUPS
gs-esp - The Ghostscript PostScript interpreter - ESP version 
 
Note
Note: 
During installation, lpr is replaced with cupsys-client.
 

During installation, you will be asked to configure cupsys-bsd.

Configuring cupsys-bsd

This package contains a server that can accept BSD-style print jobs and  
submit them to CUPS. It should only be set up if you have other 
computers that submit jobs over the network via "BSD" or "LPR" services, 
and these computers cannot be converted to use the IPP protocol that 
CUPS uses. 

Do you want to set up the BSD lpd compatibility server? 

Choose No, the default, unless you know otherwise.

2 BIOS setting for parallel port

You may need to change your printer port setting in BIOS to EPP mode.

You can access the BIOS setup program at boot time before the bootloader or Linux is booted. Usually, this means pressing the Del or F1 key a few times immediately after switching on the computer. (The key or key combination itself it usually displayed immediately after you turn the system on.)

Find the setting for parallel port and change it to EPP (Enhanced Parallel Port).

3 Checking that the kernel supports the parallel port (optional)

You can check that the kernel supports the parallel port by checking that the appropriate kernel modules are loaded. Open a terminal (or a terminal window in X) and log in as root. Use the lsmod command to list the currently loaded modules. Pipe the output through grep to filter the names of loaded modules containing 'parport'. You should find two: parport_pc and parport.

# lsmod | grep parport
parport_pc            33348  0
parport               37320  1 parport_pc

If you do not find them, use a utility such as modconf to load them.

4 Installing a printer using the CUPS web interface

Use a web browser eg Links (in a console) or Firefox (in X). To use CUPS, visit this URL:

http://localhost:631/

Image:cups-home.png

Follow the link 'Do Administration Tasks', and enter 'root' and the root password when prompted for a user.

  • Do Administration Tasks

This takes you to the Admin page.

Image:cups-admin.png

From the Printers menu choose Add Printer.

  • Printers
    • Add Printer

Enter the details for your printer and choose a driver. For instance, here is an example showing how to add a Samsung ML-1450 printer.

  • Add New Printer
    • Name: Samsung
    • Location: Office
    • Description: Samsung ML-1450
    • Continue
  • Device for Samsung
    • Device: Parallel Port #1
    • Continue
  • Model/Driver for Samsung
    • Make: Samsung
    • Continue
  • Model/Driver for Samsung
    • Model: Samsung ML-1450 Foomatic/pxlmono (recommended) (en)
    • Continue
Printer Samsung has been added successfully.

5 Configuring the printer and printing a test page

Click on the link to the printer. If you have followed the previous section, follow the link to Samsung. If you cannot see a link, choose Printers from the main menu at the top of the page first.

  • Samsung
Default Destination: Samsung

Samsung     Samsung ML-1450 Foomatic/pxlmono (recommended)     
Description: Samsung ML-1450
Location: Office
Printer State: idle, accepting jobs.
Device URI: parallel:/dev/lp0

Image:Cups-printer-screen.png

Configure the printer by clicking on the Configure Printer button in the menu.

  • Configure Printer

Check that the Page Size corresponds to your printer.

  • General
    • Media Source: Printer default
    • Page Size: A4
    • Printout Mode: Normal
  • Printout Mode
    • Resolution: Controlled by 'Printout Mode'
  • Banners
    • Starting Banner: none
    • Ending Banner: none

Print a test page and check that it prints correctly.

  • Print Test Page

Hopefully, your page will print perfectly. If the page does not fill the paper exactly, you may need to go back and choose a different driver. If the worst comes to the worst, try a generic driver such as 'Epson' or 'HP Laserjet'. Check your printer manual for the generic emulations available on your printer. If you have lost the manual, try Google.

6 Appendix A: Licence

Copyright © 2005-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Getting_rid_of_broken_print_jobs_(Debian_using_CUPS).html0000644000175000017500000001706011257474725032455 0ustar chrischris Getting rid of broken print jobs (Debian using CUPS) - NewbieDOC

Getting rid of broken print jobs (Debian using CUPS)

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 27 May 2007 Revised by Chris Lale
Initial release.

Revision 1.1 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Getting rid of broken print jobs (Debian using CUPS)


Abstract

What to do when something goes wrong in a print job: paper jam, wrong pages, etc.


Contents


1 Method 1: Browser

In your browser visit

http://localhost:631/

(localhost:631 works for me). Click on the "Jobs" tab, identify the job on the list of print jobs (probably the last one) and click on the "Cancel" button.

2 Method 2: Gnome

In Gnome, open the printer icon in the top panel.

Alternatively, from the desktop menu:

Desktop -> Administration -> Printing -> Your-printer-icon (double-click)

Identify the job on the list of print jobs, right-click on the job for the context menu and click on "Cancel".

3 Method 3: command line

To terminate all processes still using the printer device, even after deleting the job from the queue, use this command:

fuser -k /dev/lp0        

for a printer on the first parallel port, or

fuser -k /dev/usb/lp0    

for the first usb printer.

4 Appendix A: Licence

Copyright (c) 2007 Chris Lale, chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Debian_basic_features.html0000644000175000017500000006233611257474725024546 0ustar chrischris Debian basic features - NewbieDOC

Debian basic features

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 11th September 2005 Revised by Chris Lale
Initial release

Revision 1.1 7th January 2006 Revised by Chris Lale
Modified for NewbieDOC. Changed title from 'What you might like to know before you install Debian GNU/Linux'.

Revision 1.2 22nd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package.

Revision 1.3 25th September 2009 Revised by Chris Lale
Updated and checked as being compatible with Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Debian basic features


Abstract

This article describes some of the basic features of Debian GNU/Linux. These are the sort of things that you might like to know about before you install Debian on your computer.

Contents


1 What Debian is

Debian GNU/Linux is a free operating system. The engine of an operating system is called the kernel. Debian uses the Linux kernel. The rest of the operating system that lets you use the kernel consists of a number of tools. In Debian, these are provided by the GNU project.

You can install Debian as a replacement for Windows or as part of a dual-boot system.

For more detail see http://www.debian.org/intro/about.

2 Linux filesystem

Windows has a directory tree for each drive. Each tree begins with a drive letter.

Linux has only one tree called the filesystem. It starts with the symbol for the root directory: '/'. (There is a special user also called root. User root's home directory is '/root'. Be careful not to confuse the two.) The root directory has some subdirectories:

  • bin - Essential command binaries
  • boot - Static files of the boot loader
  • dev - Device files
  • etc - Host-specific system configuration
  • home - User home directories
  • lib - Essential shared libraries and kernel modules
  • media - Mountpoint for removeable media
  • mnt - Mountpoint for mounting a filesystem temporarily
  • opt - Add-on application software packages
  • root - Home directory for the root user
  • sbin - Essential system binaries
  • tmp - Temporary files
  • usr - Secondary hierarchy (for user-installed applications)
  • var - Variable data

In Linux, the user never needs to know which physical drive contains particular data. This is unlike Windows where you need to know which drive (C:, D:, etc) to use. Instead, in Linux you mount a drive to a particular mountpoint in the directory tree. For instance, the first CD drive in Windows might be D: or E: or some other drive letter and might change if other drives are added to or removed from the system. In Linux, the mountpoint for the first CD drive is /media/cdrom0. The mountpoint does not change if you add or remove devices, although you can add a convenient symlink (shortcut) to the filesystem such as /cdrom.

If you install an application in Windows, the executable and related files are normally installed to C:\Program Files. In Linux,

  • application executable files (binaries) are installed in /usr/bin,
  • manuals in /usr/share/man,
  • other documentation in /usr/share/doc,
  • etc.

Linux does not have a registry. Configuration data is normally in the form of text files installed in /etc.

3 Disc devices and partitions

In Windows, the active primary partition on the primary master IDE disc is called C:. Other partitions (and CDROM drives) are called D:, E: etc. In Windows 98 and earlier, the allocation of drive letters to partitions is automatic and fixed. From Windows NT onwards it is possible to reassign some drive letters.

In Linux, it is often said that "everything is a file". In the case of discs, the whole primary IDE master disc is the device /dev/hda, the primary slave is /dev/hdb, the secondary master is /dev/hdc and the secondary slave is /dev/hdd.

The first SCSI hard disc is /dev/sda, the second is /dev/sdb etc. SCSI CD or DVD devices are /dev/scd0 etc.

PATA drives (connected with flat cables) are treated as IDE ATA drives (/dev/hda etc). SATA drives (not connected with flat cables) are treated as SCSI drives (/dev/sda, /dev/sdb etc).

It is possible to have up to 4 primary partitions on a hard disc. One of them can be an extended partition containing up to 63 other logical partitions. The logical partitions must be contiguous. Windows uses only one primary partition and one extended partition containing logical partitions. Linux can use all the partitions, but manual configuration is needed to use more than 20 partitions per disc in Debian.

If /dev/hda is formatted with two primary partitions, the partitions would be /dev/hda1 and /dev/hda2. In a typical dual-boot (Windows/Linux) system, primary partition 1 will be Window's drive C:, so this can be accessed as /dev/hda1. Partition 2 (/dev/hda2) will be Window's extended partition, though this never needs to be accessed directly. Partitions 3 and 4 will be unused, and 5 upwards are the partitions within the extended partition. Partition 5 will be D: or /dev/hda5.

CD or DVD drives cannot be partitioned. A typical CD drive would be /dev/hdc (IDE) or /dev/scd0 (SCSI).

In Windows, there may be two floppy drives, A: and B:. In Linux, the floppy drives are /dev/fd0, /dev/fd1 etc.

4 Mounting and unmounting devices

Everything in Linux is a file - including devices such as disc drives. In order to use a drive, you must mount the device to a mountpoint in the filesystem. You can then access the drive from the mountpoint. For example, you may wish to use another hard drive to store backups of your system. To add manually an EXT3 formatted partition /dev/hdb1 you might create a new directory /mnt/backup as the mountpoint. You can then mount the partition with the mount command

$ mount -t ext3 /dev/hdb1 /mnt/backup

and unmount it with the umount command (NB only one n)

$ umount /mnt/backup

or

$ umount /dev/hdb1

The configuration file /etc/fstab contains the details of devices which are mounted automatically at boot time.

Removable media can be automatically mounted if you install an automounter. The X-window desktop Gnome includes automounting as standard. The media will not unmount or eject until all processes involving it are finished. In Gnome, right-click on the CD icon and choose eject.

5 Filesystem formats

The most common Linux format is EXT2 (the Second Extended file system format). Recent distributions use EXT3 which is EXT2 with a journaling system. The journal protects against corruption of filesystem data which might cause lost files etc. As well as being robust, EXT2/3 partitions are efficient and do not need to be defragmented. They can be checked and repaired with the filesystem checker fsck which is similar to scandisk in Windows.

Windows cannot access native Linux formatted drives, but Linux can read from and write to other formats such as FAT, FAT32, etc. However, writing to NTFS is not recommended (see http://linux-ntfs.sourceforge.net/info/ntfs.html.html#3.2).

6 Linux malware

There has not been a real Linux virus epidemic in the wild. This is because a virus (or any other program) can only carry out actions that the user running the virus is allowed to do. Normal users do not have enough privileges to cause damage to the system. Only user root can do that. You would have to run an untrusted binary as root to run any risk. Desktop users routinely do not log in as root, and only switch user to root to run specific, trusted software. You have to deliberately try to circumvent this protection and know the root password to be at risk.

Worms exploit known security holes. Generally, there are very few new or unknown holes. Defeating worms and trojans is as easy as keeping software up to date.

There are Anti-Virus scanners available for Linux (but generally speaking no Linux viruses). However, they will pick up Windows viruses and stop you spreading them to Windows users.

7 Linux security

The most important practice is never to login as user root (the superuser). Only user root has access to everything - that is why you must be root during the installation process. Always login as a normal user (low privileged user). If you need root privileges for an application, switch user to root as follows:

  • certain X applications, eg the software installer Synaptic, prompt for user root's password,
  • for other X applications, run gksu followed by space followed by the command that launches the application,
  • for console commands, switch user with the su command to obtain user root's prompt (#) then issue the command. When you have finished, enter exit or press ctrl-D to resume as the normal user ($ prompt).
  • you can also use sudo to allow access to particular commands using the user's own password rather than the root password.

Debian is installed with security features enabled by default. You can disable features that you do not need, but you are unlikely to do this unless you know what you are doing. This approach means that you are unlikely to make yourself vulnerable through ignorance or accident.

For a computer connected to the internet, keeping the system constantly up to date means that security holes are plugged almost as soon as they are discovered. You need this line (uncommented ie without a preceding #) in your /etc/apt/sources.list file:

deb http://security.debian.org/ etch/updates main contrib non-free

8 Linux bugs

Anyone finding a bug in Debian can report it using the bug tracking system. Most of the bugs are sorted out before the software moves into the stable distribution ( ie in the testing or unstable distributions). See http://www.debian.org/Bugs/.

9 Running Windows applications

There is free Wine which works by making systmem calls directly to Linux (Wine Is Not an Emulator). A commercial version called Crossover Office is very stable for apps like MS Office (see http://www.codeweavers.com/products/cxoffice/). There is also a commercial version for Windows games called cedega (http://www.transgaming.com/).

Alternatively, if you have a copy of Windows, you can set up a virtual machine running within Debian. You can use a Debian package such as virtualbox or qemu. There are commercial emulators such as Vmware.

10 Installing software

The traditional way of installing Linux software is by compiling the binary (executable file) on your own computer from source code. This is actually quite easy and is one of the reasons why viruses are not a problem in Linux - they normally hide in pre-compiled binaries but are obvious foreigners in source code. The drawback for the novice user is that Linux is modular and an application may depend on one or more other applications, which in turn may depend on other applications, etc. So you may find that compilation fails because you have not installed all the necessary depenedencies.

This is solved by Debian's packaging system Apt (Red Hat Linux has an alternative packaging system called Rpm). In Debian, the application is pre-compiled for your computer's architechture and packaged together with associated files, configuration data, etc in a single .deb file. The package also knows which other packages (dependencies) are needed and installs them too automatically. You can install packages with Synaptic (X) or aptitude or apt-get (commandline).

11 Help and support

Most problems can be solved by reading the documentation:

  • man page (eg man man diplays the manual for the man command)
  • info page (the info command)
  • Dwww (man and info pages with a web interface)
  • files in /usr/share/doc/app-name
  • HOWTOs (eg the Linux Documentation Project (http://tldp.org/)
  • Debian documentation on the web (http://www.debian.org/doc/)
  • Unofficial Debian websites eg http://www.debianhelp.org/
  • internet home page for the application
  • internet wikis
  • internet forums
  • internet mailing list archives (try Google with 'site:lists.debian.org search-term-1 search-term-2 ...')


If the problem persists read http://www.catb.org/~esr/faqs/smart-questions.html and ask at



12 Bibliography

http://www.pathname.com/fhs/ Linux Filesystem Hierarchy Standard

http://www.pathname.com/fhs/ Comparison of Windows and Linux drives and partitions

http://linux.org.mt/article/partnames?locale=mt Linux device names for IDE and SCSI

http://www.tldp.org/HOWTO/Partition/partition-2.html Viruses, security etc

http://www.patentmatics.org/pub2002/pub121.htm

http://www.dwheeler.com/oss_fs_why.pdf

http://www.seifried.org/security/index.php/Linux_and_Viruses

http://www.theregister.co.uk/security/security_report_windows_vs_linux/

http://www.debian.org/security/

13 Appendix A: Licence

Copyright (c) 2005-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Installing_Debian_on_a_small_partition.html0000644000175000017500000011642611257474724030147 0ustar chrischris Installing Debian on a small partition - NewbieDOC

Installing Debian on a small partition

From NewbieDOC


Chris Lale
chrislale AT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 27th August 2005 Revised by Chris Lale
Initial release.

Revision 1.1 24th January 2006 Revised by Chris Lale
Adapted for NewbieDOC by converting source to wikitext. Made a few minor corrections and minor additions.

Revision 1.2 16th September 2007 Revised by Chris Lale
Updated for Debian 4.0 Stable (Etch).

Revision 1.3 23rd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Installing Debian on a small partition


Abstract

This article explains how to install desktop Debian GNU/Linux 4.0 (Etch) from CD/DVD on a small hard disk or partition (around 1 GB). The instructions can also be used for installations to larger discs/partitions or installation from a preconfigured ADSL broadband ethernet modem/router, preferably with built-in DHCP. You still need the Binary-1 CD or DVD (or the 160 MB network install CD) containing the installer itself. If you do not have a CD drive, refer to the Debian GNU/Linux 4.0 -- Installation Guide. You can download ISO images of the CDs/DVDs from http://www.debian.org/CD/.


Contents


1 Documentation

Debian GNU/Linux 4.0 -- Installation Guide

Debian Reference

2 Requirements

32 MB RAM.

Hard disc space for a new partition (256 MB for the base system plus space for additional software). If you want to install the X-Window System, you'll need at least 490MB plus space for applications. For a complete desktop system, you will need a few gigabytes.

Preferably, you also need a small swap partition (rule of thumb: twice the size of your RAM).

Install HDD space needed
Basic system about 490 MB
Swap partition 50-150 MB
X Window System about 145 MB
and X window manager 1 MB upwards
or lightweight desktop (Xfce4) about 40 MB
or heavyweight desktop (KDE/Gnome) about 220 - 920 MB
Space for applications and user files

So the smallest text only installation would require at least 550MB plus space for applications and user files. The smallest X installation would be about 700MB plus space for applications and user files. An installation with a lightweight desktop would need around 740 MB plus space for applications and user files. A basic Gnome or KDE desktop needs 1GB or more and a full Gnome or KDE desktop needs 1600 MB plus space for applications and user files.

Installation will be much smoother if you know a little bit about the Linux filesystem, partition naming and other Debian basic features. If in doubt during installation, accepting the default usually works.

3 Outline

A simple install gives you a 2.4 kernel and the option to install the full desktop environment (around 1.5 Gb). There is no point in installing an old kernel in a fresh installation. Use the 'linux26' install for a 2.6 kernel. If you do not have enough room for a full desktop environment installation, you can install the base system and opt not to install the desktop environment. Then finish the installation, login as root and install the X-Window System and your own choice(s) of desktop environment (see summary below). You can run both Gnome applications and KDE applications without either the Gnome or KDE desktops installed. The package manager will automatically install any required libraries.

Although the installer is on CD or DVD, you have the option of installing the bulk of the software from CD/DVDs, PPP (dial-up modem) or network (eg ADSL/broadband ethernet router). Dial-up is unrealistic, 50M broadband takes 2-3 hours, CD/DVD less than an hour. You can setup networking during installation, but if you do, the installer will assume that you want to install from the network. This will result in delays if you are actually installing from CD/DVD as the installer checks for the (unused) network connection at various times. It is straightforward to set up the network after installation.

If you have an ethernet ADSL broadband connection, Debian will recognise any DHCP server in your modem/router and accept a connection lease from it. Otherwise you will need to know the gateway IP address provided by your modem/router (often 192.168.1.1). If you do not run a DHCP server on your network, you must give your computer a static IP address on the same network. For example, if your private network is 192.168.1.0 and the gateway is 192.168.1.1, you could assign your computers 192.168.1.2, 192.168.1.3, etc with netmasks 255.255.255.0.

3.1 Recommended approach

Disconnect any network cables and boot from the Binary-1 DVD (unless you wish to install from the network). Install the base system from DVD with the 2.6 kernel ('linux26' at the boot prompt). If you are short of space, do not install the Desktop Environment during installation. After installation you can choose leaner options separately - install X, desktop(s), X screensaver, graphical login (Gdm) and graphical software package installer (Synaptic).

3.2 Summary

install the base system with the 2.6 kernel (299 MB)

install and test the X-Window System (143MB)

install

  • full Gnome heavyweight desktop (919 MB)
  • or install minimal Gnome heavyweight desktop (391 MB)
  • or install full KDE heavyweight desktop (903 MB)
  • or install minimal KDE heavyweight desktop (213 MB)
  • or install Icewm lightweight desktop (7 MB)
  • or install a combination of desktops

install xscreensaver, gdm, synaptic

install applications

4 Installing the base system

Boot from DVD Binary-1. At the prompt enter install.

boot: install

The blue screen text interface is known as ncurses. Navigate with arrow keys, tab key, space bar and enter key.

4.1 Choose regional settings for the installer

Select regional settings to suit your computer. The examples below are typical for the UK.

Choose language
English- English
Choose country or region
United Kingdom
Select a keyboard layout
British English

4.2 Automatically detect CD/DVD and network

Detecting hardware to find CD-ROM drives
Scanning CD-ROM
Loading additional components

If a network card is detected and connected to a network with a DHCP server (eg an ADSL broadband ethernet modem/router):

Detecting network hardware
Configuring the network with DHCP

or if a network card is detected but not connected to a network:

Network autoconfiguration failed

If you know that you are connected to a network, you can configure the network manually:

Configure network manually

You must supply the following information about the new installation:

  • IP address
  • Netmask
  • Gateway
  • Name server addresses
  • Hostname
  • Domain name

If you are installing from CD/DVD and not from a network, you can leave any network configuration until after installation is complete.

Do not configure the network at this time

4.3 Set the hostname

The hostname is the nme of the computer as it appears to a network. It also appears on the commandline prompt so keep it short eg 'mybox'..

Hostname: mybox

If DHCP autoconfiguration succeded, you also need to enter the domain name (name of the local network) eg 'home'. Otherwise, go on to the next section to partition the hard disk.

Domain name: home

4.4 Partition the hard disc

Detecting disks
Starting up the partitioner

You should have a disc with enough space on it - either an empty, unpartitioned disc or a disc with some free space. The simplest option is to use all of the free space on the hard disc, although this will erase any existing systems (eg Windows). If you want to install Debian in addition to an existing system and have dual booting, read the Debian Installation Guide. Assuming that you wish to use the whole disc for Debian, follow these instructions.

Partition disks
Guided - use entire disk

Select the disc to partition and install to:

Select disk to partition
IDE1 master (hda) - 2.0 GB SOME_MANUFACTURER HARDDISK

4.4.1 All files in one partition

The easiest method is to select the simplest partitioning scheme which installs all the files into one partition. Alternatively, use guided partitioning (see next section).

All files in one partition - (recommended for new users)

Skip the next section and go straight to "Finish partitioning".

4.4.2 Guided partitioning

The hard drive will be identified by "hda", "sda" or something similar.

IDE1 master (hda) - 2.0 GB SOME_MANUFACTURER HARDDISK

If you are doing a simple installation and overwriting the whole disc, you will see one primary partition. It will be partition number 1 formatted with the "ext3" filesystem and a mountpoint of "/" ("root of filesystem")

>   #1 primary   1.9 GB B f ext3    /

There will be another small "logical" partition for the swap space. Partition number 5 is the first available logical partition. It will be formatted for use as swap.

>   #5 logical  148 MB   f swap    swap

Select the option to finish partitioning, and continue.

Finish partitioning and write changes to disk

The installer will warn you that you are about to erase your hard drive.

WARNING: This will destroy all data on any partitions ... that are going to be formatted.
[...]
Write the changes to disks?

Select "Yes", and continue.

Yes

4.4.3 Finish partitioning

Finish partitioning and write changes to disk
Write the changes to disks?
Yes

The installer creates the new partitions, formats them and sets the clock. The coloured bars show progress.

Partitions formatting
Setting up the clock

4.5 Setting up users and passwords

Your new Debian system must have an all-powerful superuser called "root". You must enter a password for user root.

Root password: ******
Re-enter password to verify: ******

Continue to the next screen. You should normally login to your new system only as a normal user. You must set up a normal user and password now. You can add more users when the installation is complete.

Full name for the new user: Firstname Surname

Continue to the next screen to set the username for the account. This name will be used to login, regulate access to certain files and to define a user area for storing personal work and configuration files called a "home directory".

Username for your account: nickname

Continue to the next screen to set a password for your new normal user.

Choose a password for the new user: ******
Re-enter password to verify: ******

4.6 Installing the base system and the boot loader

This should procede automatically. You can follow progress on the screen.

Installing the base system

The installer configures the package manager. Debian's Advanced Package Tool (APT) is a system that makes finding and installing software very easy. The installer configures APT with the settings you need. The coloured bar shows progress.

Configuring apt

The installer may ask you whether you wish to use a network mirror server for supplementary software. It is wise to answer "yes" if you are connected to a network. You can answer "No" if you are installing software only from CD/DVD.

Use a network mirror?
Yes or No (see text)

The installer tries to access security updates from a repository on the Debian website. This will fail if you are not yet connected to the internet. If you get a failure message, just continue to the next screen. You can enable security updates after installation (eg by editing the file /etc/apt/sources.list and uncommenting the line for security updates).

Cannot access security updates

The installer fetches and installs some of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.6.1 You configure the popularity contest

The popularity contest is software that sends statistics to Debian software developers about the software you use most frequently. Popularity contest needs a network connection. If you do not want to participate at the moment, choose "No" and continue. If you change your mind later, you can reconfigure "popularity-contest" with the "dpkg-reconfigure" program.

No

4.6.2 The installer selects and installs more software

The installer fetches and installs more of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.6.3 You choose some software collections to install

You will need just the core of the Debian system to start with.

Standard system

Then continue. You can watch progress with the coloured bar as the installer selects and installs the software.

Select and install software

4.6.4 Install the Grub bootloader

The bootloader is a little program used by the computer's BIOS to boot your new Debian system.

Installing GRUB boot loader

You normally install the bootloader to the MBR (Master Boot Record). The MBR is a small sector at the beginning of your first hard disc.

Install the GRUB boot loader to the master boot record? 
Yes

The coloured bar shows progress.

4.6.5 Finish the installation

Installation complete

When the installation is finished, the CDROM is ejected. You can remove the CD and continue.

Continue

Your computer will now boot into the wonderful world of Debian. This is just a basic installation without the X Window System or graphical desktops. It takes up about 476 MiB (488 MB) plus the swap partition (145 MiB, 148 MB in the example). Of course, you will need more space for applications, work/data files etc.

5 Installing X and desktop(s) after base system configuration

Login as a normal user (eg fred).

login: fred
Password: *****
$

Use Aptitude to install the packages you need from the command line. You need root's privileges for this. You can do this by switching user temporarily using Su and supplying the password you chose for user root. A normal user's prompt is $ and root's prompt is #. When you have finished, switch back by entering 'exit' or pressing Ctrl-D.

$ su
Password: *****
#

5.1 Install X using Aptitude

If you will be installing from a network (eg the internet) and not using any CDROMs or DVDs, make sure that you comment out any "deb cdrom" lines in /etc/apt/sources.list.

# nano /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 4.0 ...]/ etch main non-free contrib

If you comment out the CDROM lines, make sure that there is a line for a Debian mirror eg http://ftp.uk.debian.org.

deb http://ftp.uk.debian.org/debian/ etch main non-free contrib
# aptitude install xorg
...119 newly installed... After unpacking 143 MB will be used.
Do you want to continue? [Y/n/?] y

5.2 Configure the X server to suit your hardware

#dpkg-reconfigure xserver-xorg
Configuring xserver-xorg
Attempt to autodetect video hardware?
Yes

Please select the XKB rule set to use
xorg

Please select your keyboard model.
pc105

Please select your keyboard layout.
gb

Please select your keyboard variant.
(leave blank)

Please select your keyboard options.
(leave blank)

Please choose your mouse port.
(eg /dev/input/mice)

If your monitor is an LCD device (eg a notebook), answer 'yes' to the next question. If it is a CRT (Cathode Ray Tube) device, answer 'no'.

Is your monitor an LCD device?

Set up your monitor. If you do not know anything about your CRT monitor except its size, choose Simple. Otherwise, Medium should be fine.

Choose a method for selecting your monitor characteristics.
Medium

Set the best video mode for your monitor/video card combination. A fairly recent monitor should be capable of 1024x768 @ 75Hz. Select the video modes using the space bar.

Please select your monitor's best video mode.
(eg 1024x768 @ 75Hz)

Please select the video modes you would like the X server to use.
[*] 1024x768
[*] 800x600
[*] 640x480

Please select your default color depth in bits.
eg 24


5.3 Testing X and the TWM window manager

# aptitude install twm
...2 newly installed... After unpacking 2060 kB will be used.
Do you want to continue? [Y/n/?] y

Enter the command startx to start X.

$ startx

You should see a coarse grey screen with an X cursor. Check that the cursor responds to the mouse. Move the cursor over the terminal window to activate it (outline cursor becomes solid).

Run twm from the command prompt.

$twm

Twm provides only basic window functions). Hold down the left mouse button for the menu. Move down the menu and to the right for sub-menus. To exit, highlight 'Exit', move to the right highlight 'Yes, really quit' and release the mouse button.

Exit -> Yes, really quit

5.4 Testing X and the metacity window manager

# aptitude install metacity
...29 newly installed... After unpacking 47.3 MB will be used.
Do you want to continue? [Y/n/?] y

5.5 Testing X and the enlightenment window manager

# aptitude install enlightenment
...13 newly installed... After unpacking 8989 kB will be used.
Do you want to continue? [Y/n/?] y

5.6 Testing X and the blackbox window manager

# aptitude install blackbox
...2 newly installed... After unpacking 1040 kB will be used.
Do you want to continue? [Y/n/?] y

5.7 Testing X and the fluxbox window manager

# aptitude install fluxbox
...2 newly installed... After unpacking 2425 kB will be used.
Do you want to continue? [Y/n/?] y

5.8 Testing X and the icewm window manager

# aptitude install icewm
...12 newly installed... After unpacking 1256/2059 kB will be used.
Do you want to continue? [Y/n/?] y

5.9 Testing X and the xfce4 lightweight desktop environment

# aptitude install xfce4
...91 newly installed... After unpacking 29.6 MB/38.3 MB kB will be used.
Do you want to continue? [Y/n/?] y

5.10 Installing heavyweight desktops

These are the commands for installing various desktops. Remember to switch user to root first and switch back again when you have finished.

Full Gnome

# aptitude install gnome
...428 newly installed... 919MB will be used

Basic Gnome (accept defaults for configuration).

# aptitude install gnome-core
...221 newly installed... 391MB will be used

Fix error running due to no xscreensaver package (optional). Accept defaults for configuration.

# aptitude install xscreensaver
...8 newly installed... 12.9 MB will be used

Full KDE

# aptitude install kde
...493 newly installed... 903 MB will be used

Basic KDE

# aptitude install kde-core
118 newly installed, 213 MB will be used

5.11 Installing lightweight desktop Icewm

# aptitude install icewm
...8 newly installed... 6275kB will be used

5.12 Installing graphical login Gdm

The default graphical login is provided by X Display Manager (Xdm), but Gnome Display Manager (Gdm) has more features. The chosen display manager is loaded automatically after next reboot.

To install gdm

# aptitude install gdm
...34 newly installed... 16.7MB will be used

Later, you can configure gdm from its own login screen or using the gdmsetup command. This may be available from the desktop menu. For example, in Icewm:

Programs -> Apps -> System -> GDM Setup

5.13 Installing the graphical software installer Synaptic

Synaptic is a graphical package manager for APT (Debian's Advanced Package Tool). If you are running X, you will want to use this instead of Aptitude.

# aptitude install synaptic
...? newly installed... ???MB will be used

Synaptic may be available from the desktop menu. For example, in Icewm:

Programs -> Apps -> System -> Synaptic Package Manager

5.14 Configuring the network for broadband

Make sure that your modem/router is already configured, switched on, connected to the telephone system and connected to your PC.

If you are in X, open a terminal window.

Switch user to root and edit the file /etc/network/interfaces using Nano.

$ su
Password:
# nano /etc/network/interfaces

If you have DHCP running on the network, add these lines:

auto eth0
iface eth0 inet dhcp

If you wish instead to allocate a static IP address to your computer, add something like this (modify as needed):

auto eth0
iface eth0 inet static
 address 192.168.1.2
 netmask 255.255.255.0
 network 192.168.1.0
 broadcast 192.168.1.255
 gateway 192.168.1.1

Then save the file and exit

Ctrl-O
Ctrl-X

See man interfaces for the manual page.

Bring the interface up with Ifup and test it using Ping.

# ifup eth0
# ping google.co.uk
PING google.co.uk (216.239.39.104) 56(84) bytes of data.
64 bytes from 216.239.39.104: icmp_seq=1 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=2 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=3 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=4 ttl=243 time=107 ms

Ctrl-Z

Switch back to the normal user.

# Ctrl-D
$

The 'auto' line in the /etc/network/interfaces file ensures that the interface is brought up automatically at boot time.

6 Appendix A: Licence

Copyright (c) 2005-2007 Chris Lale. chrislale AT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Aptitude_-_using_together_with_Synaptic_and_Apt-get.html0000644000175000017500000005063011257474724032527 0ustar chrischris Aptitude - using together with Synaptic and Apt-get - NewbieDOC

Aptitude - using together with Synaptic and Apt-get

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 11th December 2006 Revised by Chris Lale
Initial release.

Revision 1.1 25th November 2007 Revised by Chris Lale
Adapted for newbiedoc package by adding Revision History, Abstract and Appendix for Licence.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Aptitude - using together with Synaptic and Apt-get


Abstract

Help for Debian users using more than one package manager. If you do not use Aptitude exclusively, it may attempt to remove packages that you do not wish to remove. Here is some help for newbies (and other Debian users) for managing this problem.


Contents


1 Introduction

Early versions of Debian used Apt-get for package management. Nowadays, Aptitude is the recommended CLI (Command Line Interface) package manager, and Synaptic is the recommended GUI (Graphical User Interface) package manager. There is also an interactive form of Aptitude which uses the ncurses interface.

Aptitude maintains a separate database of installed packages so that it knows which packages have been installed manually and which packages have been installed automatically as "dependencies" or "recommends". Aptitude automatically removes the automatically installed packages when they are no longer needed. This helps to prevent the build-up of un-needed packages ("cruft" - http://en.wikipedia.org/wiki/Cruft) on your hard disc.

This is fine if you use only Aptitude as your package manager. If you have ever used another package manager, Aptitude's database may become unreliable and Aptitude may attempt to remove packages that you do not wish to remove. Here are some suggestions for managing the use of Aptitude together with other package managers.

2 Running Aptitude after using another package manager

(Adapted from a post by Florian Kulzer at http://lists.debian.org/debian-user/2006/12/msg00288.html.)

2.1 Check Aptitude's internal database

Aptitude remembers intended actions, even if you change the package states and/or configuration settings.

If you have been using another package manager since you last used Aptitude, you should check Aptitude's intended actions before proceding. Whenever in doubt, check Aptitude's intentions with a simulated ("-s") run to fix ("-f") packages that it thinks are broken. Since -s simulates it is safe to avoid the prompting by saying yes with ("-y").

# aptitude install -sfy

If Aptitude wrongly wants to remove packages, apply one of the fixes below.

2.2 Global fix of Aptitude's internal database

Tell Aptitude to "keep-all" installed packages. This cancels all scheduled actions on all packages (including installation, removal, or upgrade).

# aptitude keep-all
 
Tip
Tip: 
If you ever need to avoid trouble, "aptitude keep-all" restores sane behavior.
 

2.3 Fix just the "automatically installed" flag

A common problem is that some packages may be wrongly marked as automatically installed. Aptitude may wrongly want to remove some of them. You can fix this by telling Aptitude to unmark ("unmarkauto") all such packages that are currently installed ("--schedule-only '~i'"). This command is more specific than "aptitude keep-all" and may be sufficient to fix the problem. It has the advantage that it does not modify any other "sticky" flags (eg "hold" or "forbid-version").

# aptitude unmarkauto --schedule-only '~i'

Aptitude tries to react immediately to changes in package states, including the "automatically installed" ("A") flag. If you want to run several successive "(un)markauto" commands to change/fix your system then you have to use "--schedule-only" to keep Aptitude from doing something unintended halfway through the operation.

If you want to be on the safe side you can always run "aptitude install -sfD" afterwards to check whether any of your previous commands has caused Aptitude to schedule unwanted actions. The "-D" option shows brief explanations of automatic installations and removals.

# aptitude install -sfD

If this shows any unwanted actions, you can always run "aptitude keep-all" to revoke all scheduled actions. Of course, this will also remove any "markauto", "hold" and "forbid-version" specifications that you may have flagged manually. If you are fine-tuning to this extent, you should probably install one of the "aptitude-doc-??" packages and check the documentation in /usr/share/doc/aptitude/html.

# aptitude keep-all

If you are running Aptitude interactively, another helpful stop-gap measure is temporarily to set a configuration file option directly with the "-o" option. (See /usr/share/doc/aptitude/html/en/ch02s04s05.html#configKeep-Unused-Pattern after installing the aptitude-doc-en package or one of the other language versions.) The term "~T" matches any package. Set the configuration file option to keep any packages marked as unused.

# aptitude -o Aptitude::Keep-Unused-Pattern='~T'

3 The Sudo pitfall (Sarge only)

In Sarge, the location of aptitude's configuration file depends on whether it is run as root or with "sudo" (unless you change your sudo set_home configuration). This can lead to inconsistent behavior. "sudo -H" takes care of this. Sudo's -H (HOME) option sets the HOME environment variable to the homedir of the target user.

$ sudo -H aptitude ...
 
Tip
Tip: 
You can define an alias for "sudo -H aptitude" to ensure safe typing:
alias saptitude='sudo -H aptitude'
 

This problem has been fixed in Etch.


4 Upgrade non-agressively

If Aptitude runs into problems when trying to upgrade packages (eg because the updated versions of some dependencies are still missing) it will normally propose the least harmful action first (e.g. keeping a few packages at their presently installed version). However, if you run another upgrade command after the harmless actions have been carried out, then aptitude will assume that you want it to be more aggressive. "keep-all" helps again, as well as CTRL + U or "Cancel Pending Actions" in interactive mode.

# aptitude upgrade
# aptitude keep-all
# aptitude upgrade

5 Upgrading from Sarge to Etch

(Adapted from a post by Osamu Aoki at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401317.)

Upgrading from Sarge stable to Etch using the Sarge version of Aptitude may be a problem if your system has a large number packages installed. The Sarge version of Aptitude has fewer features than the Etch version. Here is a suggested process that does not try to update the Desktop. The idea is to remove big dependency-rich sets of packages in Sarge and reinstall them in Etch using the newer version of Aptitude.

Step 1. Kernel upgrade in sarge (2.2, 2.4 --> 2.6 with udev).

Step 2. Remove all Desktop Environment in Tasksel placing "-" over it and do "g". This removes many files but at least you know what has been removed. You never need these while upgrading. (Actually cyclic dependency keeps some packages.)

Step 3. Point /etc/apt/sources.list to etch (include nonfree contrib if GFDL doc packages and others are needed.) Do "aptitude update". (Do not worry about warning.)

Step 4. Partial upgrade to Etch (aptitude, tasksel and its dependencies).

# aptitude install aptitude tasksel

Step 5. Start new aptitude and set Desktop task.

# aptitude
 ... press "+" over "End-user" in "Tasks".  So we get new full
     etch desktop. 
 ... press "U" to upgrade all and try resolving with "e" and "!" "g"
 ... press "Y" for `/etc/dpkg/dpkg.cfg'
 ... After everythng, do it again. press "+" over "End-user". 
 ... No problem (no red resolver).  "g"
 ... Hmmm... Let's remove Obsolete interactively.  "g".

This is a much saner upgrade than upgrading with Desktop.

6 Install without bloat

By default, Aptitude installs "recommended" packages as well as just "dependencies". This means that you may end up installing more packages than you would expect if you used other package managers. You can avoid this by using the "-R" (or "--without-recommends") option.

# aptitude install -R ...

7 Get rid of unused packages

You can tell Aptitude to purge any packages that are no longer required by any installed package.

--purge-unused

8 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale. chrislale AT users DOT berlios DOT de

This document has been released by the author under a Free license (which should be indicated beneath this notice). You may use it freely according to its particular license.

Free Software License: Either GNU FDL or GNU GPL at your choice.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."
GPL This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Process_management.html0000644000175000017500000005303411257474725024132 0ustar chrischris Process management - NewbieDOC

Process management

From NewbieDOC


Romain Lerallut
rom1 AT users DOT sourceforge DOT net (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision v0.01 5 May 2001 Revised by Romain Lerallut
Started this whole thing. http://newbiedoc.sourceforge.net/utils/process.html.en

Revision v0.02 24 May 2001 Revised by Romain Lerallut
Added the FDL License.

Revision v0.03 30 May 2001 Revised by Romain Lerallut
Changes in the title page.

Revision v0.04 26th January 2006 Revised by Chris Lale
Adapted for NewbieDOC wiki by converting source to wikitext. Made some cosmetic changes.

Revision v0.05 12th March 2007 Revised by Chris Lale
Modified "Killing processes" section after comments about the scripts. Added a link to the discussion page for comments.

Revision v0.06 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Process management


Abstract

A document about how to manage processes under Linux.

Contents


1 Introduction

One of the strengths of Linux is its excellent process management. A crashing process cannot bring down the system with it, and a lot of work has been done on multitasking so that each process gets its share.

1.1 Credits

Thanks to the NewbieDoc team, to Ken Thomson and Dennis Ritchie for Unix, and to the Linux developers for Linux !

1.2 Feedback

As usual, comments, corrections, flames, are all equally welcome !

2 Unix and processes

Most of what will be said in this doc is not Linux-specific, but should apply to most Unix systems

A process running on a Unix system can be managed using five numbers:

Process ID
a number defined by the system when the process starts. It is unique: you may have many xterms running but only one will have 123 as its PID.
 
Note
Note: 
Each process has a parent (except init, being The First) and keeps the parent's PID stored somewhere called PPID.
 
User ID
usually the UID of the user that started the process, it is used to manage permissions and accounting.
Priority
a number ranging from -20 to +20, negative numbers being reserved for the Superuser.

The lower a job's priority number, the more important it is, go figure... Use nice (renice) to define (modify) a process's priority when starting it (any time).

3 Process Management

3.1 Finding info about a process

There are two tools used to find info about running processes: ps and top

3.1.1 Static Process Management: ps

ps is a tool found on most if not all flavours of UNIX. Its syntax varies a lot, and for the sake of clearness I will speak only about the GNU-ps' syntax.

At the shell prompt, type

$ ps

you should see something like:

PID TTY        TIME CMD
10923 pts/3    00:00:00 bash
12494 pts/3    00:00:00 ps

which are the currently running process that are attached to your shell.

To see all your processes, type

$ ps xu

with x for "all processes even those that are not launched from a terminal" and u for slightly more detailed info

To see all processes, including those belonging to others type

$ ps axu
 
Note
Note: 
some older versions of ps use the ps -axu syntax, however it is deprecated.
 

See the ps manpage of the column headers of ps' output to find which column refers to what field.

 
Tip
Tip: 
use ps and grep together to find a specific process:
$ ps axu | grep my_process_name
 

3.1.2 Dynamic Process Management: top

top is a nice useful tool that acts like ps but with an auto-refresh.

just type

$ top

and get my meaning. You'll see all your running processes ordered by decreasing CPU usage.

Common interactive options are:

  • p: sort by CPU usage (default)
  • m: sort by memory usage
  • s: adjust time between refreshes.
  • q: quit

top displays first general info about your system, such as uptime, number of users ,etc.

Then it reports global CPU and memory usage

Then come the list of running processes. Interesting fields are:

  • PID: PID of the process
  • user: owner of the process
  • PRI: priority, note that top's priority floats around 19
  • SIZE: size of the process, RSS is the size of the physical memory allocate, SHARE being the size of shared memory
  • STAT: state of the process: R for running, S for sleeping, Z for zombies.

The remaining columns should be easy to understand :-)...

3.2 Signals

3.2.1 What are signals?

In Unix the owner of a process (or the superuser) can send a signal to a process he owns (any process for the SU).

Some of these signals can be recognized by processes which can act accordingly.

Example: say you have a laptop, and a battey-monitoring tool. If the battery runs low, your monitoring program can send signals (SIGPWR, I guess) to your running programs so that they shut down correctly and then poweroff the computer.

3.2.2 Which signals should I know of?

  • SIGKILL (IMPORTANT): kills a process using deadly force. The process doesn't stand a chance of survival, and exits without performing any action, such as save-and-exit. USE CAUTION !
  • SIGTERM (IMPORTANT): asks strongly to a program to nicely stop. Most evolved programs "trap this signal" , and run some save-and-exit code. It might not work if the program is stone-dead, since it won't execute any code at all.
  • SIGINT: it's one you already know about ! That's what Ctrl-c sends. It's a nice way of saying goodbye to a process.
  • SIGQUIT: you already know this one also, it's usually what Ctrl-d sends when typed in a terminal.
  • SIGSTOP et SIGCONT: to temporarily halt a process or to ask it to continue. (Ctrl-z sends SIGSTOP whereas fg and bg send SIGCONT).

3.2.3 How do I send a signal?

It is simple. You must know the PID of a process and then:

$ kill -signal_number PID

for example:

$ kill -9 123

or

$ kill -SIGKILL 123

will terminate with maximum prejudice process #123.

You can find the conversion table between signals' names and numbers by doing

$ kill -l

3.3 Nice and priorities

 
Tip
Tip: 
If you want to run a process without hogging 99% of the CPU and upset other users, nice is for you.
 

A process is usually run with the priority of its parent. To know your shell's priority type:

$ nice

To run a niced command type:

$ nice my_command

It will (by default) add 10 to your shell's priority and define it as the process' priority. If your shell's priority is 0, your new process will have priority of 10.

To specify the nice-level (relative to current shell's priority):

$ nice -n 14

so the priority of the new process will be current_shell_priority+14.

3.4 Renice a job's priorities

To renice a job's priority, use renice.

$ renice +5 my_pid

You can also specify "all the processes of a user":

# renice +20 -u patient_guy

This will add 20 to the priority of all patient_guy's processes. (you usually need to be root to do this, and to be able to run fast :-)

4 Tips and Tricks

4.1 Killing processes

Let's face it: the only time we use kill to send a signal is to kill a process. And that's why it's called kill.

I usually have netscape crashes. Here is a small script that might be useful:

#!/bin/sh 
ps xu | grep netscape | grep -v grep | awk '{ print $2 }' | xargs kill -9


This is what is would do:

  1. prints all my processes
  2. takes only the lines containing 'netscape"
  3. discards the line about 'grep netscape'
  4. selects the second column of ps xu ( the one showing the PID)
  5. xargs builds the command "kill -9 PID" by taking everyword coming from the pipe and launching kill -9 on it. If I had several PIDs coming down the pipe, xargs would launch a kill -9 on each of those PIDs.

Unfortunately is uses five processes. Also another process containing the word 'netscape'would also be killed by this script. It could be done better like this.

$ ps -C netscape -o pid= | xargs kill -9

There's a slight problem with the '-C' option when using 'ps' - it doesn't work with the 'U/-U/-u/' as one would expect it to work. However if you are not root, this is not a problem.

Alternatively, you could use pgrep (which is also in the procps package).

$ pgrep -u $USER -x netscape | xargs kill -9

Better yet:

$ pkill -KILL -u $USER -x netscape

One more point: only use the KILL signal as a last resort. For alternatives see Useless use of kill -9.


5 Appendix A: Licence

Copyright (c) 2001 Romain Lerallut, rom1@users.sourceforge.net.

Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Beginner's_guide_to_Vi_Improved_(Vim).html0000644000175000017500000020167011257474725027422 0ustar chrischris Beginner's guide to Vi Improved (Vim) - NewbieDOC

Beginner's guide to Vi Improved (Vim)

From NewbieDOC

Jesse Goerz
jwgoerz@users.sourceforge.net (author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Revision History

Go to NewbieDOC index


Revision v0.1 6 January 2002 Revised by Jesse Goerz
Initial Release. http://newbiedoc.sourceforge.net/text_editing/vim.html.en

Revision v0.2 1 February 2006 Revised by Chris Lale
Revised for NewbieDOC wiki by converting source to wikitext. Modified the top of the document slightly, including the Abstract.

Revision v0.3 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Beginner's guide to Vi Improved (Vim)


Abstract

This document will cover the console version of vim from Debian. Although much of what is discussed here will also apply to gvim, it may or may not work with gvim.


Contents


1 Introduction

Learning vim can be a bit of a trial but it is well worth it in the long run. The most important thing you can do is read the section Vim's built in help. Once you figure out how to use vim's built-in help effectively, you'll learn vim much more comfortably.

No introduction to vim would be complete without a warning. Vim is not a difficult editor to learn but it won't be like any other editor you've used. In the beginning you'll find that the movement and editing commands can be quite irritating. However, with a bit of patience and perseverance you will become quite adept at using it.

If it is so irritating why would you want to learn how to use it? Good question. My primary motivation to learn vim was watching someone who was good with vim edit a configuration file. Without moving his hands from the keyboard he cut large blocks of text and moved them around quite rapidly. This simple textual explanation just doesn't do justice to what I witnessed that day. Vim offers you the ability to rapidly search, edit, copy, and "read in" files in far less time then your average editor. Vim can also do things you just can't do in other editors. Once you get good enough, vim saves you a lot of time over conventional editors.

Before we move on to the next section I would like to pass on a couple quick tips.

 
Tip
Tip: 
Beware the caps-lock key!
 


Because vim uses the keyboard as a primary means of navigation, you need to make sure the caps-lock key is not depressed. If you're trying to move around in vim and strange things are happening, check to make sure the caps-lock key is not depressed.

 
Tip
Tip: 
Tapping the Escape key twice in quick succession will clear any commands you have begun to type incorrectly.
 

2 Installing vim

To install vim on Debian simply become the root user and type this at the command line:

# apt-get install vim vim-rt

The package vim contains the executable, and the vim-rt package contains all the files necessary to get syntax highlighting to work.

 
Tip
Tip: 
If you want to install the graphical version of vim install the packages vim-gtk and vim-rt.
 
 
Tip
Tip: 
Programming - If you're going to be doing programming, you'll also want to install the package exuberant-ctags.
 

3 Vim's built in help

Learning the way the help system system works in any application you use is always a good idea. In vim, it isn't just a good idea, it's essential. When I first started using vim I put it off for the longest time. I wish I wouldn't have done that!

3.1 Tutor me!

Thanks to vim's hard working developers vim has a very extensive built-in help system. As part of their work they developed a tutor which will walk you through the basics.

To start the tutor simply type this command at the console:

$ vimtutor

Vim should start and look something like this:

===============================================================================
=    W e l c o m e   t o   t h e   V I M   T u t o r    -    Version 1.4      =
===============================================================================

Vim is a very powerful editor that has many commands, too many to
explain in a tutor such as this.  This tutor is designed to describe
enough of the commands that you will be able to easily use Vim as
an all-purpose editor.

The approximate time required to complete the tutor is 25-30 minutes,
depending upon how much time is spent with experimentation.

The commands in the lessons will modify the text.  Make a copy of this
file to practice on (if you started "vimtutor" this is already a copy).

It is important to remember that this tutor is set up to teach by
use.  That means that you need to execute the commands to learn them
properly.  If you only read the text, you will forget the commands!

Now, make sure that your Shift-Lock key is NOT depressed and press
the   j   key enough times to move the cursor so that Lesson 1.1
completely fills the screen.

Simply follow along with the tutor. Below is the outline of what the tutor covers in case you are already familiar with vim. I recommend you continue using the tutor until you can complete it "out of sequence." In other words, you ought to be able to jump around throughout the tutor, doing sections at random, before continuing with the rest of this document.

  1. Moving the cursor
    1. Entering and exiting vim
    2. Text editing-deletion
    3. ext editing-insertion
  2. Deletion commands
    1. More deletion commands
    2. On commands and objects
    3. Exceptions to command-object
    4. The undo command
  3. The put command
    1. the replace command
    2. The change command
    3. More changes using "c"
  4. Location and file status
    1. The search command
    2. Matching parentheses search
    3. A way to change errors
  5. How to execute an external command
    1. More on writing files
    2. A selective write command
    3. Retrieving and merging files
  6. The open command
    1. The append command
    2. Another version of replace
    3. Set option
  7. Online help commands

3.2 Navigating vim's help

Vim has an extensive help system. The most basic command is:

:help

This command will take you to vim's help text. Throughout the help files you will see tags like this: |bars|. By positioning your cursor over these tags and hitting CTRL-] you can jump directly to the subject. To get back to your original position simply type CTRL-t.

 
Tip
Tip: 
You can quit the help window by typing :q.
 

A variation of the above command is this:

:help subject

Where subject is the information you are looking for. One thing to note about the above command is that it takes you to the subject reference. What this means is that this type of help is aimed at users who are already familiar with vim's help syntax. The vimtutor command in the Tutor me! section covers this in Lesson 2 of the vimtutor. You did do the vimtutor didn't you?

 
Tip
Tip: 
You can also access vim's help by pressing the F1 function key.
 

Vim's help also contains some quick reference links which you can locate by typing:

:help quickref

If you're looking for less terse explanations a good place to start is with the vim introduction. In addition to the introduction you can find more detailed help with this command:

:help doc-file-list

4 Modeful editing

If you haven't noticed by now, vim is a modeful editor. Vim has 6 different basic modes of operation. The modes are Normal, Visual, Select, Insert, Command line, and Ex. Each mode is suited to a particular purpose. The following sections will cover the basics of each of these modes.

 
Tip
Tip: 
If you are not sure which mode you are in simply tap the Escape key twice and you will be put into Normal mode.
 

To get more information on modes type:

:help vim-modes

4.1 Normal mode

Normal mode is the mode vim normally starts in. Normal mode is also known as command mode. Be careful not to confuse this with Command line mode.

Normal mode is where you use most of the built in commands and is primarily used to move the cursor around.

To get some basic information about normal mode type:

:help normal-mode

4.2 Visual mode

Visual mode is a nice way to select large blocks of text so that you can perform other operations on them. You enter visual mode by pressing v (lowercase v), V (capital V), or CTRL-V. The v command highlights the block of text by character, the V command highlights text by the line, and the CTRL-V highlights the text by block.

Once you enter visual mode you can use the movement keys (h, k, j, l, w ...) to change which text is highlighted. You can then enter a sequence of Normal commands to manipulate the text. You can also enter Command line mode by typing the : (colon) and then entering a command.

If you enter command line mode from visual mode you'll notice this in the "status bar":

:'<,'>

This is just vim's notation for selecting that block of text. Don't backspace over it. It will be part of the command you enter.

As an example, open vim and create a new document, or simply use vimtutor and manipulate that file. Type several sentences on several different lines. Press V to enter "linewise" visual mode. Use your cursor/movement keys to select the first line and type: gU. This should change the entire selected text to all uppercase letters. Once the text is highlighted you can also use the (y)ank and (d)elete commands to "copy" or "cut" the text so you can paste it elsewhere with the (p)aste command. Experiment with it a little. You'll use these commands a lot.

TODO. Need some useful examples of visual mode. Anyone want to coauthor?

To get more information on what's possible type:

:help visual-mode

4.3 Select mode

TODO. Need some useful examples of select mode. Anyone want to coauthor?

To get more information on what's possible type:

:help select-mode

4.4 Insert mode

Insert mode is the mode in which the letters you type are input into the document. This mode resembles a regular editor. There are other options which will allow you to do additional things as well. For instance, if you use vim with languages which have accented characters that do not appear on your keyboard you can use the digraph option to type those characters.

To use digraphs you need to issue the command:

:set digraph

Note

If you get an error after using this command your version of vim was not compiled with digraph support. The default version of vim in Debian has digraph support.

Digraphs are used by typing a character, the Backspace key, and then another character. These combinations of characters are called maps. You can see which digraph maps are available to you by typing:

:digraph

Here is the output of that command:

~! ¡ 161   c| ¢ 162   $$ £ 163   ox ¤ 164   e= ¤ 164   Y- ¥ 165   || ¦ 166   pa § 167
"" ¨ 168   cO © 169   a- ª 170   << « 171   -, ¬ 172   -- ­ 173   rO ® 174   -= ¯ 175
~o ° 176   +- ± 177   22 ² 178   33 ³ 179   '' ´ 180   ju µ 181   pp ¶ 182   ~. · 183
,, ¸ 184   11 ¹ 185   o- º 186   >> Â» 187   14 ¼ 188   12 ½ 189   34 ¾ 190   ~? ¿ 191
A` À 192   A' à 193   A^ Â 194   A~ Ã 195   A" Ä 196   A@ Å 197   AA Å 197   AE Æ 198
C, Ç 199   E` È 200   E' É 201   E^ Ê 202   E" Ë 203   I` Ì 204   I' à 205   I^ Î 206
I" à 207   D- à 208   N~ Ñ 209   O` Ò 210   O' Ó 211   O^ Ô 212   O~ Õ 213   O" Ö 214
/\ × 215   OE × 215   O/ Ø 216   U` Ù 217   U' Ú 218   U^ Û 219   U" Ü 220   Y' à 221
Ip Þ 222   ss ß 223   a` à 224   a' á 225   a^ â 226   a~ ã 227   a" ä 228   a@ å 229
aa å 229   ae æ 230   c, ç 231   e` è 232   e' é 233   e^ ê 234   e" ë 235   i` ì 236
i' í 237   i^ î 238   i" ï 239   d- ð 240   n~ ñ 241   o` ò 242   o' ó 243   o^ ô 244
o~ õ 245   o" ö 246   :- ÷ 247   oe ÷ 247   o/ ø 248   u` ù 249   u' ú 250   u^ û 251
u" ü 252   y' ý 253   ip þ 254   

The columns are arranged so that the first character is typed followed by a backspace and then the second character is typed. For example, to get the ¡ (an upside down exclamation point) character I would simply type ~-Backspace-!.

 
Note
Note: 
These mappings seem to change between systems and versions of vim. Make sure you double check what your maps are so you get what you expect.
 
 
Tip
Tip: 
If you use these characters frequently you may wish to explore the langmap option as well. For more information type the command :help langmap.
 

To get more information on what's possible with digraphs type:

:help digraphs

To get more information on what's possible with insert mode type:

:help insert-mode

4.5 Command line mode

Command line mode is entered by typing : (the colon). Once typed the "status bar" along the bottom of the console shows the colon and whatever you type. All the previous :help commands you have typed are examples.

 
Tip
Tip: 
Command line mode is entered from Normal mode. If you type the colon and can't seem to get into command line mode try tapping the escape key twice and then type the colon.
 

Command line mode contains a "history" much like the shell does. By typing the beginning of your command and then using the arrow keys you can scroll through a list of the previous commands you entered.

Command line mode also has "tab-completion" much like the shell does. By typing the beginning of your command and then the TAB key the command line will complete the available commands for you.

To get more information on what's possible with command line mode type:

:help cmdline-mode

4.6 Ex mode

TODO. Anyone want to coauthor?

TODO. Need some useful examples of ex mode.

5 Common commands

The most common commands used in vim are covered in the Tutor me! section. You did the tutor right? The following sections contain some additional commands.

5.1 Movement commands

Movement commands

G
Move to the end of the file.
gg
Move to the beginning of the file.
CTRL-b
Move back a page.
CTRL-f
Move forward a page.
CTRL-u
Scroll up.
CTRL-d
Scroll down.
 
Tip
Tip: 
If you don't like the way the scrolling works you can adjust it with the scroll, scrolloff, and scrolljump options. Type :help scroll for more information. The vimrc files section explains how to make these adjustments permanent.
 
CTRL-e
Expose another line at the top. Useful for scrolling the screen without moving your cursor from its position.
CTRL-y
Expose another line at the bottom. Useful for scrolling the screen without moving your cursor from its position.
}
Move forward a paragraph. Useful for moving through documents which have blank lines separating paragraphs or blocks. An easy way to distinguish between this and { is to remember it points in the direction you wish to go.
{
Move backward a paragraph. Useful for moving through documents which have blank lines separating paragraphs or blocks.
)
Move forward a sentence. An easy way to distinguish between this and ( is to remember it points in the direction you wish to go
(
Move backward a sentence.
:number
Where number is a decimal number indicating the line number you wish to jump/move to.
'0
Vim creates a "bookmark" each time you exit Vim. The last "bookmark" is '0. So if you have a file you haven't edited in a long time and can't remember where you left off simply type this command and it will take you to the place you last edited. You can find out what marks are set by typing :marks.

Reference

:help navigation 

and

:help motion 

for more information on motion commands.

5.2 Search commands

Search commands

/text
Search forward in the document for text. If found, vim will move the cursor to that position in the file. Once / is typed, text will show up in the status bar as you type it.
?text
Search backward in the document for text. If found, vim will move the cursor to that position in the file. Once ? is typed, text will show up in the status bar as you type it.
 
Tip
Tip: 
Normally the search commands stop at the end or beginning of the file depending on which direction you are searching. You can force the search to "wrap around" the file using the wrapscan option. Type :help wrapscan for more information.
 
*
This is a search command which will find the next occurance (forward) of the word the cursor is currently on.
n
Find the (n)ext occurance of the previous search. It will use the same direction (i.e. forward vs. backwards) of the previous search as well.

There are several options which allow you to enhance your searching. The hlsearch option highlights the text of the search. The incsearch option highlights and shows possible matches as you type the text. You can get more information on these options by typing

:help hlsearch 

and

:help incsearch

The vimrc files section explains how to make these adjustments permanent.

5.3 Simple editing/combination commands

5.3.1 Deleting/selecting parts of a line

dfx
Delete forward until you find x (inclusive). If x is found, vim will delete everything from the current cursor position to and including x.
This one and its variations dFx, dtx, and dTx are very useful when editing mark-up languages like html and sgml. It is especially useful in deleting and changing quoted attributes within mark-up tags.
This is a combination of the (d)elete command and the (f)ind motion command. You may also substitute other commands for the delete portion of that command, such as visual by character, or yank.
dFx
Delete backward until you find x (inclusive). If x is found, vim will delete everything from the current cursor position to and including x.
dtx
Delete forward until you find x (exclusive). If x is found, vim will delete everything from the current cursor position to, but not including x.
dTx
Delete backward until you find x (exclusive). If x is found, vim will delete everything from the current cursor position to, but not including x.

5.3.2 Deleting/selecting spanning multiple lines

d/x
Delete forward until you find x (exclusive). If x is found, vim will delete everything from the current cursor position to, but not including x, spanning multiple lines if necessary.
x doesn't have to be one character. It's most likely to be a word or several characters. If you're editing your email, you could use this to delete all text up to your signature by executing d/--.
This is a combination of the (d)elete command and the (/) search forward motion command. You may also substitute other commands for the delete portion of that command, such as visual by character, Visual by line, or yank.
d?x
Delete backward until you find x (exclusive). If x is found, vim will delete everything from the current cursor position to, but not including x, spanning multiple lines if necessary.

5.3.3 Cut, copy, and paste

V-any_motion_command
V selects the text by the line. Simply use j, k, or the paragraph motion commands ({, }) to select the block of text. Now type d to delete (cut) it, y to yank (copy) it, and p to paste it.

5.3.4 Spell checking

TODO

   TODO. 

5.3.5 Find and replace

This topic is covered extremely well by Sven Guckes. You can read the document here: http://www.math.fu-berlin.de/~guckes/vi/subst.html

Do you have a simple editing option you use frequently? Please add it to the discussion/talk page http://newbiedoc.berlios.de/index.php?title=Talk:Beginner%27s_guide_to_Vi_Improved_%28Vim%29&action=edit.

6 Personalizing vim

6.1 vimrc files

Vim is a very customizable editor. Many of the options you can set require you to type in a command like this:

:set autoindent

This is the option to set autoindent which keeps the indentation level you are currently at when you hit the enter key. Rather than retype this command every time you want this option enabled, vim has a resource file it checks to see which options you would like set when vim starts. Technically, there are two such files, /etc/vimrc, and ~/.vimrc. Within these files you can set standard options which will automatically be set when you start vim.

The /etc/vimrc is the system wide configuration file and shouldn't really be edited unless you know what you are doing or you're the administrator for that machine. The ~/.vimrc file is located in your home directory (that's what the ~/ means, in case you were wondering) and is meant specifically for the purpose of customization.

 
Warning
Warning: 
Before editing a vimrc file it's a good idea to back it up just in case you mess it up beyond repair.
 

You can see a list of available options that can be set by typing the following command:

:set all

The output of that command looks something like this:

autoindent          noincsearch         scroll=18           textwidth=0
noautowrite         noinfercase         noscrollbind        notildeop
background=dark     noinsertmode        scrolljump=1        timeout
backspace=2         isprint=@,161-255   scrolloff=0         timeoutlen=1000
nobackup            joinspaces          nosecure            notitle
backupext=~         key=                selectmode=         titlelen=85
nobinary            keymodel=           shell=/bin/bash     titlestring=
nocindent           keywordprg=man      shellcmdflag=-c     nottimeout
cinoptions=         langmap=            shellquote=         ttimeoutlen=-1
cmdheight=1         laststatus=1        shellxquote=        ttybuiltin
columns=98          nolazyredraw        noshiftround        ttyfast
nocompatible        nolinebreak         shiftwidth=4        ttymouse=xterm
noconfirm           lines=38            noshortname         ttyscroll=999
cpoptions=aABceFs   nolisp              showbreak=          ttytype=xterm
dictionary=         nolist              noshowcmd           undolevels=1000
nodigraph           listchars=eol:$     noshowfulltag       updatecount=200
display=            magic               showmatch           updatetime=4000
noedcompatible      makeprg=make        showmode            verbose=0
endofline           matchtime=5         sidescroll=0        viminfo='20,"50
equalalways         maxfuncdepth=100    nosmartcase         visualbell
equalprg=           maxmapdepth=1000    nosmartindent       warn
noerrorbells        maxmem=5120         nosmarttab          noweirdinvert
noexpandtab         modelines=5         startofline         wildcharm=^@
noexrc              nomodified          statusline=         wildignore=
fileencoding=ansi   more                swapfile            nowildmenu
fileformat=unix     mouse=              swapsync=fsync      wildmode=full
filetype=           mousemodel=extend   switchbuf=          winheight=1
formatoptions=tcq   mousetime=500       syntax=             winminheight=1
formatprg=        nonumber              tabstop=4           wrap
nogdefault          nopaste               tagbsearch          wrapmargin=0
grepprg=grep -n     pastetoggle=        taglength=0         wrapscan
helpheight=20       patchmode=          tagrelative         write 

As you can see there are a lot of options to set/unset. To get more information on what an option does simply type :help name_of_option replacing name_of_option with the option you're interested in.

Once you decide how you want an option to be set you can add it to your ~/.vimrc file. Using the autoindent example above, simply add this line to your vimrc file:

set autoindent "this sets the autoindent option
" set noautoindent

Comments are created in vimrc files using the " (quote) character. As you can see I put a comment next to the autoindent option and also added a "commented out" option which disables the previous noautoindent option I had set. Most of the options follow this convention; if you wish to disable it, simply put no in front of the option.

For more information about vimrc files type:

:help vimrc

6.2 Color Schemes

TODO. Need some useful examples of color schemes. Anyone want to coauthor?

For more information about color schemes type:

help

6.3 Syntax highlighting

If you installed the vim-rt package described in Installing vim, all you have to do to enable syntax highlighting is add syntax on to your .vimrc file. The highlighting syntax is chosen based on filename extension so it happens pretty much automatically.

You can change the default colors of a syntax highlight by using the highlight command. For example, to change all comments to the color green type:

:highlight Comment ctermfg=green

The second argument to that command is the group name. To make the setting permanent simply add it to your .vimrc.

 
Note
Note: 
In order for the color change to work the highlight command should come after the syntax on command in your .vimrc.
 

To see what group names are available to be changed type:

:help group-name

The available colors can be found by typing:

:help cterm-colors
 
Note
Note: 
Some colors may not be available. Reference :help xterm-colors and :help xiterm for more information.
 

TODO. Need some useful examples of customized syntax. Anyone want to coauthor?

For more information about syntax highlighting type:

:help syntax

6.4 Abbreviations

Abbreviations are just shortcuts you type which expand to longer versions of themselves. You can create an abbreviation simply by typing:

:ab dmv Department of Motor Vehicles

Abbreviations take the form:

:ab abbreviation Full text, spaces are ok

What happens is when you type the abbreviation in vim, as soon as you hit the space bar it is expanded to the full text. The abbreviation dmv in the prior example would expand to "Department of Motor Vehicles." If you close vim these settings are lost unless you commit them to your .vimrc file.

Unless you are only using the abbreviation on a small document, abbreviations are usually added to your personal .vimrc file. This is accomplished by adding the abbreviation like this:

ab abbreviation Everything after abbreviation will be input
 
Tip
Tip: 
To find out which abbreviations you currently have defined, just type :ab and hit enter and the abbreviation definition will show up in the "status bar."
 

For more information about abbreviations type:

:help ab

7 Mapping Keys

Mapping keys is one of the most useful and productive operations that vim performs. Mapping keys is just a method to map a complex command to a particular keystroke or sequence of keystrokes. If you find yourself routinely performing the same commands to edit a document there is a good possibility you could create a map to make your editing easier.

For instance, if you write html, xml, or sgml documents in a text editor you know it can become quite tedious typing out all those tags all the time. Markup language tags may also include attributes which you also have to type in or cut and paste from other locations. This can slow your work down quite a bit. There are gui programs which sort of solve this but many of them can't always give you the control you need and you end up resorting to hand editing the file anyway. The simple solution in vim is to create a map.

There are several different types of maps you can create but the two we will concentrate on are Normal mode and Insert mode maps. Normal mode maps begin with the command map and look something like this:

map keyboard_key command_to_execute

Insert mode maps begin with the command map! and look something like this:

map! keyboard_key command_to_execute
 
Warning
Warning: 
Avoid re-mapping the F1 key as this is always mapped to vim's help.
 

The complexity of the map is pretty much limited to your imagination. Here is a simple map you might use to open a letter:

map <F2> iTo whom it may concern, <CR><CR><TAB>

This is a Normal mode map set to use the F2 key. It won't work when you're in insert mode. When you press the F2 key, vim executes the insert command (because it's still in Normal mode), it then types all the letters as it sees them (because now it's in Insert mode) until it hits CR. This is how you type a Carriage Return in maps. So vim executes a carriage return. It then executes the next carriage return and then indents that line with one tab. At this point the map is finished. If you would like to test this map go ahead and copy the map into vim by typing : and then pasting the map into the status bar. Press Return. Now try pressing the F2 key and see what it does. One thing to notice is the map exits while in insert mode. This allows you to start typing immediately.

 
Tip
Tip: 
If you forgot what maps you have or just want to see what maps you have defined you can simply type: :map or :map! and hit enter. The defined maps will show up in the "status bar."
 
 
Tip
Tip: 
To make maps permanent add them to your .vimrc file.
 

Earlier I talked about how maps can make working with markup languages easier. Here are several example Insert mode maps which can be used to create headings in html:

map! ,h1 <H1></H1><ESC>2ba
map! ,h2 <H2></H2><ESC>2ba
map! ,h3 <H3></H3><ESC>2ba

We will focus on the first map. This map is executed while you are typing in insert mode. After you type ,h1 vim types <H1></H1> for you. It then sees the escape command which just like any other time you're in insert mode takes you back to Normal mode. Vim then sees the command to move back 2 words (2b) which puts the cursor on the ">" of the first <H1> tag. Vim then sees the a command so it moves one space to the right and enters insert mode. At this point the map is finished, your tags have been written, you are in insert mode and ready to type the heading. The beauty of maps like this is you never leave insert mode (at least from your perspective) and you type only 3 characters and get many more. Once you get used to your personal maps it's easy to forget about all the tags and concentrate more on your content.

If you would like to try these maps out simply copy and paste them into vim like the previous example.

There are several things you should notice about the previous examples. Insert mode maps are generally used to enter portions of text which are repetitive or time consuming. They work extremely well for inserting markup text and then positioning your cursor where you would logically type next. They take care of "closing" tags for you which can cut down on nesting errors and ill formed documents.

When creating maps, selection of your assigned keystrokes is pretty much up to you. I would recommend you avoid re-mapping standard commands as this makes it difficult for you to transition to someone else's machine unless you carry around a copy of your .vimrc on a floppy (which I've often thought about :) ). When you choose a sequence of commands for Insert mode choose a sequence which is unlikely to be typed. In the previous example I chose the "," because in almost every type of document it is always followed by a space. The reason for this is vim has to pause for a second whenever the first character of one of its maps is pressed. It does this to see if you are typing a map or just a sequence of characters that just happens to start with the mapped character. By choosing the comma, every time I type a comma and then the following space, vim knows almost immediately that I don't want a map.

For more complex map examples see the section Example maps and vimrc files.

For more information about mapping keys type:

:help key-mapping

8 Writing Functions

TODO. Need some useful examples. Anyone want to coauthor?

For more information about built-in functions type:

:help functions

For more information about user defined functions type:

:help user-functions

9 Programming with vim

This subject is covered very well by a document at the Linux Documentation Project. Please reference the C-editing-with-VIM-HOWTO at http://www.tldp.org/HOWTO/C-editing-with-VIM-HOWTO.

10 Example maps and vimrc files

Following is my "system" using a combination of vimrc files and maps.

What I did was create a basic .vimrc file in my home directory and map the function keys (except F1) to source each of the custom vimrc files. Here is my example ~/.vimrc.

The custom vimrc files were placed in the ~/.vim_custom directory. Currently those files consist of vimrc files for editing shell scripts, php scripts, C/C++ programming, and sgml source files.

 
Note
Note: 
If you're going to copy and paste these into files please beware of the CTRL-D character. That character has to be typed into your file with this key combination: CTRL-V and then CTRL-D. It will display in the file like this: ^D. A quick way to convert all these is to do this:
:%s/\^D/CTRL-V CTRL-D/g
Everything in that command is typed as printed on this document except CTRL-V CTRL-D which is typed as explained above.
 

Each vimrc file calls a function which unmaps the function keys except for the F2 function key which is always mapped to re-source the base ~/.vimrc file. It then maps the function keys and any other custom maps specific to its purpose.

I chose to do it this way for several reasons. The first reason was modularity. If I find someone else's vimrc file which includes some neat functions or mappings it's easy to incorporate them into my existing "system" without messing with what's already there. Second, I don't use the function keys for anything else so it seemed the logical thing to do. Third, it seemed to follow a sort of "menu" approach to doing things.

If you have an approach to doing this which you like and would like to include it in this document please send in your vimrc/functions/mappings to newbiedoc-discuss@lists.sourceforge.net so we can add it to this document.

11 References and links

12 Contributors

These folks have contributed in one way or another, I've tried to include what is was but chances are I screwed it up. If I did, my apologies, and thanks!

  • Allan M. Wind (d/x and d?x)
  • Romain Lerallut (*)

13 Appendix A: My examples

13.1 Example A-1. My ~/.vimrc

" Global variable which holds the path to my customization files
" You'll need to edit this so it matches your system
let g:VIM_CUSTOM = "/home/jesse/.vim_custom/"

set visualbell
set background=dark
set tabstop=4
set showmatch
set showcmd
set autowrite

""""""""""""""""""""""""""""""""""""""""""""""""""
"                 Color scheme                   "
""""""""""""""""""""""""""""""""""""""""""""""""""

" Some custom color modifications.  reference :help highlight and :help cterm
highlight ModeMsg cterm=bold ctermfg=2 ctermbg=black	" set mode message ( --INSERT-- ) to green
highlight StatusLine ctermfg=7 ctermbg=9		" set the active statusline to black././@LongLink0000000000000000000000000000017000000000000011563 Lustar  rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_set_up_a_wireless_network_card_using_drivers_from_Debian_packages.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_set_up_a_wireless_network_card_using_drivers_from_D0000644000175000017500000007463611257474725033416 0ustar  chrischris

	
		
				
		How to set up a wireless network card using drivers from Debian packages - NewbieDOC
		
                
	

	

How to set up a wireless network card using drivers from Debian packages

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 21st May 2007 Revised by Chris Lale
Initial release.

Revision 1.1 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to set up a wireless network card using drivers from Debian packages


Abstract

Debian provides some WiFi cards with drivers in source code form. They are easy to compile and install with module-assistant - even for Debian newbies.


Contents


1 Introduction

This article shows you how to compile and install wireless network (wifi) card drivers from the source provided by a Debian package. This procedure has worked using Debian Etch (Stable). This article is based on notes made at the time and has not been fully tested in the form presented here. If there are any omissions, amendments, comments etc, please edit this article and add them. The Edimax EW-7128g is used as an example in this article.

2 Short version if you are impatient

2.1 Build source

It's so simple these days. Eg to install the Ralink 2500 driver:

Build the driver (from the command line as user root):

# aptitude install rt2500-source module-assistant
# m-a prepare
# m-a a-i rt2500-source

Install the driver:

# modprobe rt2500

2.2 Configuration using Gnome GUI tool

Set up your interface from Gnome with

Desktop -> Administration -> Networking
Connections tab -> Wireless connection Properties
	Interface name wlan0
	Enable this connection (tick the box)
	Network name (ESSID): (Enter the ESSID of your wireless Access Point)
	Key type: Plain (hexadecimal)
	WEP key: Enter the WEP key configured in your AP setup
	Connection settings: DHCP if this is configured on your AP; 
        otherwise Static and fill in details.

Set up your nameservers

DNS tab -> Add

(You can use DNS servers at opendns.com eg 208.67.222.222, or the ones provided by your ISP.)

Activate the wireless interface:

Connections tab -> Wireless connection ... wlan0 -> Activate

2.3 Manual configuration

Configuring the wireless interface with the command line (wireless-tools package) is straightforward. Modify your /etc/network/interfaces file. In this example the network is 192.168.1.0 with the Access Point (wifi/modem/router) at 192.168.1.1. If you use Gnome Network Administration Tool (Desktop -> Administration -> Networking) it will modify this file for you. A handwritten file looks like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet static
#address 192.168.1.4
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.1


# wireless interface
iface wlan0 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid my-network-id
wireless-key NNNNNNNNNN

auto wlan0
allow-hotplug wlan0

I commented out my ethernet interface (eth0) when everything was working to make sure that the computer always uses the wireless interface. It was a problem if the signal was too weak to be picked up continuously.

Leave out "wireless-key NNNNNNNNNN" until you have a working connection. Then add it in and configure encryption on your AP.

"allow-hotplug wlan0" lets you hotswap the pcmcia card and get an automatic connection while the computer is running.

Commands to get you started are

  • "iwconfig" (to check/configure the interface)
  • "iwlist wlan0 scan" (to check for the wireless AP)
  • "ifdown eth0" and "ifup wlan0" to take down/bring up the interface
  • "/etc/init.d/networking stop", "/etc/init.d/networking start" to restart network service

You may need to add nameservers to /etc/resolv.conf. Mine looks like this:

domain home
#nameserver 192.168.1.1
nameserver 208.67.222.222
nameserver 208.67.220.220

These are the OpenDNS nameservers. If you have set up DHCP on your modem/router then use the commented-out line instead of the last two. Test with something like "ping bbc.co.uk".

What follows is some extra detail.

3 Find out your card's chipset

The driver is based on the card's chipset. You might find out which chipset using a pcmcia database such as

http://tuxmobil.org/pcmcia_linux.html

or by using a search engine. For instance, if you were looking for the chipset of the Edimax EW-7128g pci card, this Google search string

edimax EW-7128g chipset

might turn up this page: http://www.linuxquestions.org/hcl/showproduct.php/product/2361 . This shows you that the chipset for the Edimax EW-7128g is

Ralink RT2500

4 Find out whether there is a Debian source package

You can use Synaptic to search for "source", or use Aptitude on the command line. In a terminal or a terminal window enter

$ aptitude search source

This will give you a list of all packages with "source" in the package name. Narrow down your search using Grep. For the Ralink RT2500 chipset try

$ aptitude search source | grep rt2500
p   rt2500-source                   - RT2500 wireless network drivers source

If you want to be sure that this is what you need, look at the description provided by entering

$ aptitude show rt2500-source

5 Install the Debian packages

You need the source package (eg rt2500-source) and the Module-assistant tool. This tool will pull in any other packages you might need (eg kernel headers), compile the driver module as a new Debian package and install it.

Switch user ("su") to root and install the packages.

$ su
(Enter password for user root)
# aptitude install rt2500-source module-assistant

6 Build and install the driver

6.1 Pcmcia cards only

If the card is a pcmcia card, insert the card. Check that it has been detected with dmesg.

# dmesg

There will be a message near the end of the output to say that the card has been detected.

6.2 All cards, including pcmcia and PCI

Use the module-assistant tool. You can use "m-a" instead of "module-assistant" to save typing.

6.2.1 Clean up if necessary

If you have previously installed the source package you can clean up

# m-a purge --force rt2500-source

6.2.2 Prepare the system Module-assistant

Module-assistant prepares your system by installing any other packages that you need.

# m-a prepare

6.2.3 Build and automatic install using module-assistant

Module assistant builds the kernel module, creates a .deb package and installs it automatically ("a-i").

# m-a a-i rt2500-source

You can follow progress on the blue Ncurses screen.

The .deb is created in /usr/src and installed. You can check the location and name of the package using Synaptic.

Package -> Check Properties -> Installed Files

Alternatively, you can use the "find" command to locate the driver module.

# find /lib/modules -name rt2500.ko

You should find the module somewhere like

/lib/modules/2.6.16-2-686/kernel/drivers/net/wireless/rt2500.ko

7 Insert the driver module into the kernel

First, check that the module is not already loaded.

# lsmod | grep rt2500

Then, insert the module using "modprobe" and check again.

# modprobe rt2500
# lsmod | grep rt2500

In the system log (syslog) or the output of dmesg you should see something similar to the following messages for successful insertion of the module.

# tail /var/log/syslog
# dmesg | grep rt2500
rt2500 1.1.0

8 Configure the network card interface using the command line

8.1 Install wireless-tools

# aptitude install wireless-tools

8.2 Temporary checks

8.2.1 Check that the interface is available

# iwconfig

8.2.2 Set essid

(replace mylan with essid set up on your Access Point).

# iwconfig wlan0 essid mylan

8.2.3 Check for Access Point (AP)

# iwlist wlan0 scan

8.2.4 Set mode

# iwconfig wlan0 mode Managed

8.2.5 Set WEP encryption

# iwconfig wlan0 key restricted XXXXXXXX

8.2.6 Take down any existing ethernet hardwired interface

Other interfaces seem to cause a conflict and prevent the wireless interface from working properly.

# ifdown eth0

8.2.7 Bring up wireless interface

# ifup wlan0

Note: If it complains about unknown interface wlan0, edit /etc/network/interfaces to include an entry for wlan0.

8.2.8 Test the interface

(Replace 192.168.1.1 with the IP address of your AP - the gateway.)

# ping 192.168.1.1

8.2.9 Make ISP's nameservers are available

Edit

/etc/resolv.conf

and add a nameserver line for each of your ISP's nameservers.

search
nameserver nnn.nnn.nnn.nnn
nameserver nnn.nnn.nnn.nnn

8.2.10 Test nameservers

# ping google.co.uk

8.3 Permanent setup once everything is working

8.3.1 Modify the /etc/network/interfaces file

8.3.2 Disable existing ethernet interface

Comment out any entry for eth0 in /etc/network/interfaces

8.3.3 Enable wireless interface

Add entry for wlan0 to /etc/network/interfaces. See man wireless and /usr/share/doc/wireless-tools/README.Debian.

Note: one of these documents documents a "wireless-" prefix for wireless command, the other gives "wireless_" (underline character instead of hyphen). Both seem to work interchangeably.

auto wlan0
iface wlan0 inet static
address 192.168.1.nnn
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# replace mylan with the essid set up on the AP
wireless-essid mylan
wireless-mode Managed
# Set up encryption.
wireless-keymode restricted
wireless-key XXXXXXXXXX

4. Test

Set up encryption on the AP. Take down the interface and bring it up again.

# ifdown wlan0
# ifup wlan0
# ping google.co.uk

5. Test the init scripts

(these call ifup/ifdown)

# /etc/init.d/networking stop
# /etc/init.d/networking start
# ping google.co.uk

Exit the root user account

# exit
$

9 Configure the network card interface using GUI tools

Here are some very brief notes about GUI alternatives.

9.1 Wlassistant

Install package "wlassistant" and run it.

Radio of your wireless is off.
Would you like to turn it on?

Yes

Be patient 

(Refresh as needed)

Click on the detected essid to get

First Connection Wizard
Interface Configuration

(Automatic (DHCP) or Manual)

If Manual, here are some example settings. Substitute the IPs for your system.

IP:192.168.1.3
Broadcast: 192.168.1.255
Netmask:255.255.255.0
Gateway:192.168.1.1
Domain: home
Primary DNS:192.168.1.1
Secondary DNS:

WEP Configuration:

WEP Configuration
Which WEP mode would you like to use?
Open System or Shared Key (Open recommended)
WEP key: XXXXXXXXXXX

Done

Press Finish to connect.

Card's LEDs come on.

To modify settings later: right-click on essid,

Edit Settings

9.2 Gnome Network Tools

Applications -> System Tools -> Network Tools
Devices tab
Network device: (Select wlan0)
Click configure

9.3 Gnome Network Administration Tool

Desktop -> Administration -> Networking

9.4 Gnome Network Monitor Applet

Right click on icon -> Properties
Connections tab, select 'Wireless connection' and click Properties

Interface properties dialogue
Connection
Interface name: wlan0
Tick 'Enable this connection'
Wireless settings
Connection settings

Activate

10 WEP or WPA encryption

If you want WPA encryption, you must install the "wpasupplicant" package. Configuration not covered here.

11 Appendix A: Licence

Copyright ©2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Sound_in_Debian_GNU/0000755000175000017500000000000011257474726023157 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Installing_Samba_Linux/0000755000175000017500000000000011257474726024014 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Broadband_-_setting_up_an_ethernet_ADSL_modem/0000755000175000017500000000000011257474726030317 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_rescue_data_from_a_crashed_disk_on_a_Debian_GNU/0000755000175000017500000000000011257474726032221 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_create_a_Grub_disc_to_boot_a_Debian_GNU/0000755000175000017500000000000011257474726030471 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_try_out_Debian_GNU/0000755000175000017500000000000011257474726024425 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_Debian_GNU/0000755000175000017500000000000011257474726024366 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_download_Debian_GNU/0000755000175000017500000000000011257474642024524 5ustar chrischrisnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Sound_in_Debian_GNU/Linux.html0000644000175000017500000004763211257474725025157 0ustar chrischris Sound in Debian GNU/Linux - NewbieDOC

Sound in Debian GNU/Linux

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 20th December 2006 Revised by Chris Lale
Initial release.

Revision 1.1 12th July 2007 Revised by Chris Lale
Added section on alsaconf/OSS bug.

Revision 1.2 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package. Added Revision History and Licence in Appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Sound in Debian GNU/Linux


Abstract

This article explains how to set up sound in Debian GNU/Linux. It has been tested using Etch.


Contents


1 Install ALSA packages

ALSA is the Advanced Linux Sound Architecture. It may already be installed on a desktop system. If not, install these packages.

alsa-base

The "alsa-base" package contains various configuration files for the ALSA drivers. For ALSA to work on a system with a given sound card, there must be an ALSA driver for that card in the kernel. Linux 2.6 as shipped in linux-image packages contains ALSA drivers for all supported sound cards in the form of loadable modules.

For either Linux 2.6 or Linux 2.4 a custom alsa-modules package can be built from the sources in the "alsa-source" package using the "make-kpkg" utility (included in the "kernel-package" package). This is not covered here.

alsa-utils

The "alsa-utils" package contains utilities for configuring and using ALSA, including:

  • amixer: command line mixer
  • alsaconf: utility for configuring sound cards
  • alsamixer: curses mixer
  • amidi: read from and write to ALSA RawMIDI ports
  • aplay, arecord: command line playback and recording
  • aplaymidi, arecordmidi: command line MIDI playback and recording
  • aconnect, aseqnet, aseqdump: command line MIDI sequencer control
  • speaker-test: a utility for testing that sound is working
alsamixergui

The "alsamixergui" package is a GUI (Graphical User Interface) tool for the X Window System. It is a frontend for the alasmixer mixer program for use with the ALSA soundcard drivers. It supports multiple soundcards with multiple devices. It provides exactly the same functionality as "alsamixer".

alsaplayer

Alsaplayer is a generic music player that can play back a large number of file formats. It is a CLI (Command Line Interface) application.

totem-xine

Totem is a simple media player for the Gnome desktop based on xine. It will play any xine supported file, including audio files.

2 Check your hardware

Many motherboards now have integrated sound. If you have any trouble getting a PCI sound card to work, it may be because the system had auto-detected the integrated sound. You can find out whether you have more than one sound card using the "lspci" command to list PCI cards. Filter the output using "grep" to find only "audio" cards. The output for two cards would look something like this.

$ lspci | grep -i audio
00:0e.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
 
Note
Note: 
Use the -i option with the grep command because the output from lspci may contain "Audio" instead of "audio".
 

3 Choose and configure a card

In a terminal, or in a terminal window, switch user ("su") to user root

$ su
(password for user root)
#

Run "alsaconf" to select and configure a sound card. The output to the terminal should look something like this. (The sound card selection dialogue itself is curses-based.)

# alsaconf
Terminating processes: 2497.
Unloading ALSA sound driver modules: snd-seq-dummy snd-seq-oss snd-seq-midi
snd-seq-midi-event snd-seq snd-cmipci snd-via82xx-modem snd-via82xx
snd-ac97-codec snd-ac97-bus snd-opl3-lib snd-pcm-oss snd-mixer-oss
snd-hwdep snd-pcm snd-mpu401-uart snd-rawmidi snd-seq-device snd-timer snd-page-alloc.
Building card database...

(Sound card selection dialogue)

Running update-modules...
Loading driver...
Setting default volumes...

Now ALSA is ready to use.

Exit from user root.

# exit
$

4 Test that ALSA sound is working

4.1 Test and adjust levels

Make sure that your speakers, or headphones, are connected to the sound card and run "speaker-test" from a terminal/terminal window. You can stop "speaker-test" using the "Ctrl-C" key combination.

$ speaker-test

You should hear static/white noise.

Adjust the sound levels with "alsamixer" (CLI) or "alsamixergui" (GUI).

If you are using "alsamixer", run "speaker-test" in one terminal/terminal window and "alsamixer" in a second terminal/terminal window. You can quit "alsamixer" using the "Esc" key.

$ alsamixer
(Quit using Esc)

4.2 Play a sound file

You can play a sound file with "aplay" (CLI) or "totem" (GUI).

$ aplay test.wav
(Ctrl-C to interrupt)

Totem may be available from the Gnome Applications menu as "Movie Player".

5 Setting default sound card

(Adapted from a post to the debian-user list by Felipe Sateler on 19 Dec 2006 - if I were a newbie how would I get sound?)

If you have two sound cards you must configure them so that they come up in the right order. This is an example of a system with a "SB Live!" PCI card and an integrated sound card. This configuration makes sure that the SB card is the default card.

$ cat /etc/modprobe.d/sound
alias snd-card-0 snd-emu10k1
options snd-emu10k1 index=0

alias snd-card-1 snd-via82xx
options snd-via82xx index=1
$

This configuration makes sure that the SB card (snd-emu10k1) is the default card. You can adjust your own configuration by editing the files /etc/modprobe.d/sound:

# nano /etc/modprobe.d/sound

Note that alsaconf doesn't do this.

6 Troubleshooting

6.1 Check file permissions

The normal user should be in group "audio".

$ groups
chris dialout cdrom floppy audio video plugdev

If "audio" does not appear in the list of groups, add the user to group audio. (You must switch user to root to do this.) The following example would add normal user "chris" to group "audio".

$ su
(password for user root)
# adduser chris audio
...
# exit

And do not forget: this user must logout and login before it works.

6.2 Another way of testing the speakers

You must do this as user root. (Kill with Ctrl-C.)

# cat /dev/urandom > /dev/audio
(Ctrl-C)

You should get static/white noise.

6.3 Some applications (OSS applications) produce no sound in ALSA

(Section added by --Chris Lale 18:11, 12 July 2007 (CEST)

ALSA is able to emulate OSS, so applications written for or configured for OSS should work transparently. These applications include, for example, XMMS, Audacity and RealPlayer. If you find that these applications give no sound and produce error messages when they are run, it may be a problem caused by running alsaconf (bug .html#432678 alsa-utils: alsaconf kills OSS applications). There are more details about this issue in the Debian-User list ([1] and [2]).

This is caused when alsaconf removes the kernel module snd_pcm_oss and fails to reload it, thus destroying the device /dev/dsp. Check that /dev/dsp exists:

# file /dev/dsp

If the device exists, you should get a message like

/dev/dsp: character special (14/3)

and the problem lies elsewhere. If the device does not exist you should get a message like:

/dev/dsp: ERROR: cannot open `/dev/dsp' (No such file or directory)

You can restore functionality temporarily by loading the module manually:

# modprobe snd_pcm_oss

However, the problem will recur next time you run alsaconf. There may also be other modules that alsaconf has failed to reload. This may cause other problems. The problem in alsaconf is the result of the presence of the file /etc/modprobe.conf. This causes /etc/modprobe.d/ to be ignored by Debian packages (including alsaconf) which store their configuration files in /etc/modprobe.d/. The permanent solution is to move /etc/modprobe.conf out of the way. Do not delete it just in case there are modules listed in it by other applications that you may need to know about if those applications start misbehaving. Rename the file instead:

# mv /etc/modprobe.conf /etc/modprobe.conf.obsolete

Now run alsaconf again and everything should work.

6.3.1 Alsaconf is broken and will not be fixed in Debian Etch

(Section added by --Chris Lale 09:18, 18 September 2007 (CEST))

Alsaconf is so buggy that it is best not to use it at the moment (according to [bug no 432678]).

You now have to use udevtrigger instead of alsaconf. See [bug no 430624].

Run udevtrigger as user root:

# udevtrigger --verbose

This should reload the modules you need. On next reboot, your system will find your soundcard. The module management is done by udev. You should not need to use alsaconf any more. If this does not work for you, please send a message to the [Debian-User list] with the details.

Alsaconf will be fixed for PnP cards in 1.0.14-2 upload - Unstable (Sid) and Testing (Lenny) - see http://lists.debian.org/debian-user/2007/09/msg01370.html.

7 Appendix A: Licence

Copyright ©2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Installing_Samba_Linux/Windows_networking.html0000644000175000017500000003072311257474725030607 0ustar chrischris Installing Samba Linux/Windows networking - NewbieDOC

Installing Samba Linux/Windows networking

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 9th March 2006 Revised by Chris Lale
Initial release.

Revision 1.1 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Installing Samba Linux/Windows networking


Abstract

These are some notes I made when I installed Samba in Debian Sarge. I hope that they may be helpful to anyone starting with Samba.


Contents


1 Background

For background theory see http://searchopensource.techtarget.com/tip/1,289483,sid39_gci1138772,00.html

2 In Win98

In control panel -> CLient for Microsoft Networks -> File and Print Sharing tick I want to be able to give others access to my files.

(Insert win98 CD when asked and reboot after files are installed.)


3 In Debian

install samba etc

choose encrypted passwords choose to create samba password database (add passwords later using smbpasswd)

smbpasswd
pw ********

4 swat

By default, swat is not enabled. This has been done for security reasons. To enable swat you need to edit /etc/inetd.conf, uncomment the swat entry (usually at the end of the file), and then restart inetd. (Remove #<off># )

# /etc/init.d/inetd stop
Stopping internet superserver: inetd.
# /etc/init.d/inetd start
Starting internet superserver: inetd.
#
"http://localhost:901/".

Login as user root using the system root password.

username root
pw ********

4.1 Check connection

In Win98 look in Network Neighbourhood Should see both Linux PC (eg Sempron) and Win98 PC (eg Win-notebook).

In Debian (commandline)

# smbclient -L win-notebook
Password:

       Sharename       Type      Comment
       ---------       ----      -------
       IPC$            IPC       Remote Inter Process Communication

       Server               Comment
       ---------            -------

       Workgroup            Master
       ---------            -------
#


5 Share win98 drive C

5.1 In Win98

My Computer -> right-click drive C -> Sharing Shared As -> Share Name C Passwords -> Full Access Password -> normal-user-password

5.2 In Debian

$ LinNeighborhood

Edit -> Prefeneces -> Post Mount Tick Run File Manager after mounting nautilus --no-desktop --browser $MOUNTPOINT

Add -> Machine/Group/IP Address eg Win-notebook Double-click Win-notebook Double-click C (User password required, normal-user-name normal-user-password.)

6 Share Debian /home/*

6.1 In Debian

Set Samba passwords for users, keeping Windows usernames and passwords the same as Samba usernames and passwords.

# smbpasswd -a username

6.2 In win98

Contol Panel -> Users -> add user normal-user-name with password normal-user-password Start - logoff current user & login again as normal-user-name. Network Neighborhood -> double-click on name of Debian local host eg Sempron.


7 Share Debian printer

# adduser --system --disabled-password smbprint
Adding system user `smbprint'...
Adding new user `smbprint' (108) with group `nogroup'.
Creating home directory `/home/smbprint'.

The Samba configuration file is /etc/samba/smb.conf. 
The following is an example configuration file set up to
use CUPS with the "smbprint" user:
 
Pick relevant from these:
[global]
*  printcap name = cups  
*  printing = cups   
  security = share   
[printers]   
*  browseable = yes   
  printable = yes   
  public = yes   
  create mode = 0700   
*  guest only = yes   
  guest account = smbprint   
*  path = /home/smbprint   
 

7.1 CUPS

Now CUPS must be told to allow connections from other machines on the network. Add these lines to /etc/cups/cupsd.conf:

<Location /printers>
 AuthType None
 Order Deny,Allow
 Deny From None
 Allow From All
</Location>

As in the Samba configuration, this configuration allows any computer to connect to your printers

Add printer to win98 and install driver.

8 Appendix A: Licence

Copyright © 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/Broadband_-_setting_up_an_ethernet_ADSL_modem/router.html0000644000175000017500000003675511257474725032544 0ustar chrischris Broadband - setting up an ethernet ADSL modem/router - NewbieDOC

Broadband - setting up an ethernet ADSL modem/router

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 0.1 11th March 2006 Revised by Chris Lale
Initial release.

Revision 0.2 27th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package. Added Revision History, Abstract and Licence notice in appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Broadband - setting up an ethernet ADSL modem/router


Abstract

This document is for getting an ethernet ADSL modem/router working on a Debian system. Not for a USB ADSL modem.


Contents


1 Connecting the ASDL modem/router

These instructions are for an ethernet ADSL modem/router, not a USB ADSL modem.

Assume router without DHCP (which dynamically allocates your PC an address on the network if it does not have one). You can enable Your router's DHCP server later, if it has one.

Connect router's ADSL socket to telephone socket (via microfilter usually). Connect router's ethernet port to PC's ethernet socket using cat 5 cable.


2 Configuring the ethernet interface

Without DHCP, you have to give your PC an IP address on the router's network.

Your PC must be running on the same network as your router. This network is set by default by the router manufacturer, but you can change it later. The network is usually one of the private networks in the range 192.168.nnn.0 with netmask 255.255.255.0. (The netmask means that the first three address numbers are fixed, but the fourth number can have any value.) To find the network, look in the router's documentation for the router's IP address. It is usually the first address in the network eg 192.168.nnn.1. Since the router is going to be your gateway to the internet, this will also be your PC's gateway address.

In this example, the router's address is 192.168.1.1. This means that the address representing the whole network is 192.168.1.0, and the broadcast address is 192.168.1.255. (The router sometimes needs to send packets of information to all devices on the network, so every device must have this broadcast address in its configuration.) You can choose an address for your PC from the remaining addresses in the range. In this example, the PC's ethernet card is configured to use address 192.168.1.2.

The configuration of your PC's ethernet card(s) is held in the file /etc/network/interfaces. If you have only one ethernet card (eth0) the file will contain two entries - one for the loopback device (lo) and one for the ethernet card (eth0). Edit the file as root and add/modify the address (192.168.1.2), netmask (255.255.255.0), network (192.168.1.0), broadcast(192.168.1.255) and gateway (192.168.1.1) addresses. You can use Nano from a terminal or terminal window to do this.

$ su
Password:
# nano /etc/network/interfaces
 
...

# exit
$

The resulting /etc/network/interfaces file should look something like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	address 192.168.1.2
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers nnn.nnn.nnn.nnn nnn.nnn.nnn.nnn
	dns-search home
	name Ethernet LAN card

3 Configuring the PC's hostname

3.1 Check the PC's hostname

Check your PC's hostname with fully qualified domain name switch

$ hostname --fqdn
sempron.home

If you get localhost.localdomain or a hostname but no domain name, use the alias switch to find out if there is a named domain.

$ hostname --alias
localhost  sempron  sempron.home

In this example the hostname is sempron, the domain name is home and the fully-qualified domain name is sempron.home. You may not have a domain name if you did not enter one when you installed Debian.

3.2 edit /etc/hosts

You can use Nano from a terminal or terminal window to do this.

$ su
Password:
# nano /etc/hosts
 
...

# exit
$

Add the IP address for your PC if it is not present (and remove other references from eg first line). Include the hostname aliases.

The /etc/hosts file should look something like this:

192.168.1.2 sempron.home sempron
127.0.0.1 localhost.localdomain localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

4 Configure nameservers

Your broadband supplier may provide you with the IP addresses of its DNS servers. These are used by your router to convert domain names like 'google.co.uk' into IP addresses like 216.239.57.104. As root, modify the file /etc/resolv.conf with these addresses. It should look something like this:

nameserver nnn.nnn.nnn.nnn
nameserver nnn.nnn.nnn.nnn
search home

5 Connect your PC to the router's network

Bring up the eth0 interface with the new configuration by restarting the networking service. Do this as root.

# /etc/init.d/networking restart

6 Checking the network

Power up the router. You can check that your PC can communicate with the router using Ping.

$ ping -c3 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.388 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.384 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.384 ms

--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.384/0.385/0.388/0.016 ms

If you get an error like

From 192.168.1.2 icmp_seq=1 Destination Host Unreachable

go back and check your documentation for the router's address.

7 Configuring the router

Open a browser and enter the router's address in the location bar.

http://192.168.1.1

Follow your router's setup instructions and configure the router with the settings, username and password from your broadband provider.

Save the settings. The router should reboot automatically.

If you may have leds on the front of the router. You should see this sequence:

  1. Power
  2. ASDL - physical connection made
  3. Online - username and password accepted.

See your router's documentation for particular details.

8 Check that you can connect to the internet

8.1 Check that the router is working

$ ping -c3 216.239.57.104

8.2 Check that DNS is working

$ ping -c3 google.co.uk

8.3 Check that your browser works

Visit

http://google.co.uk

9 Appendix A: Licence

Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_rescue_data_from_a_crashed_disk_on_a_Debian_GNU/Linux_system.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_rescue_data_from_a_crashed_disk_on_a_Debian_GNU/Lin0000644000175000017500000002310311257474724032663 0ustar chrischris How to rescue data from a crashed disk on a Debian GNU/Linux system - NewbieDOC

How to rescue data from a crashed disk on a Debian GNU/Linux system

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 1.0 7th September 2007 Revised by Chris Lale
Initial release

Version 1.1 26th November 2007 Revised by Chris Lale
Reformatted for newbiedoc package; Added revision history, abstract and licence appendix.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to rescue data from a crashed disk on a Debian GNU/Linux system


Abstract

Here are some suggestions from the Debian-User list (August 2007 and September 2007) for recovering data from a crashed hard disc or floppy disc. They were used successfully by the original poster.

Contents


1 Outline procedure

The most important thing is to avoid using the disk as much as possible (do not apply power, do not 'spin up' the disk).

Then you need a set up to 'rescue' the data. If you have a second computer with Linux then you're off to a good start. You will need to:

1.1 Create an image of the failed disc

Determine how large a disk you need to create an image of the partitions on your failed drive. Of course you probably need to go out and buy some storage...

Copy all readable blocks from the failed drive.

The tools for this allow you to power up the bad drive and copy whatever is possible with the minimum use of the disk. It is not unusual for a disk to be permanently destroyed during this process or shortly afterwards - no fault of the tools, that's just the general way a disk fails.

I would suggest 'ddrescue' which acts like 'dd' but skips bad blocks and simply moves on to the next block. This is the behavior you want - you don't want to attempt a retry at this stage because that can make matters worse. After your image recovery operation then you may consider a second image using something like gddrescue to try to get even more data.

It is very important that you don't try to hurry things - remember you will be lucky to have 1 shot at recovering data from a bad disk; you need to make absolutely sure that first try goes without a flaw. After setting up, practise using these tools on another disk - maybe a faulty floppy, or even just a good disk. You really don't want to make any mistakes when you get to the real job; especially not with a 'dd'-like tool.

Once you have recovered an image with ddrescue (and maybe a second image with gddrescue) then you can take your time finding other recovery tools to extract even more data. Remember to mark these images 'read only' - you don't want to accidentally write to them.

1.2 Examine the image for the data you want

I would suggest the 'testdisk' package. It is generally used when people accidentally wipe the partition table, but it has good tools for recovering photos.

You can try to repair your partition table with TestDisk and/or to recover your photos with PhotoRec; both these tools are available in package "testdisk".

The "scalpel" package is another option for trying to extract the files if you cannot restore the partition table.


2 Appendix A: Licence

Copyright (c) 2005-2007 Chris Lale. chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_create_a_Grub_disc_to_boot_a_Debian_GNU/Linux_system.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_create_a_Grub_disc_to_boot_a_Debian_GNU/Linux_syste0000644000175000017500000003115311257474724032743 0ustar chrischris How to create a Grub disc to boot a Debian GNU/Linux system - NewbieDOC

How to create a Grub disc to boot a Debian GNU/Linux system

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 26th February 2007 Revised by Chris Lale
Initial release.

Revision 1.1 22nd November 2007 Revised by Chris Lale
Modified to include Revision History, Abstract and Appendix for Licence, so that a stable version can be included in the "newbiedoc" package.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to create a Grub disc to boot a Debian GNU/Linux system


Abstract

It helps to be prepared. This NewbieDOC article helps you to plan for disaster by making a boot floppy or CD to boot your Debian system in case another operating system overwrites your MBR.


Contents


1 The advantage of having a Grub boot disc

If you have more than one operating system on a dual- or multi-boot Debian system, you run a small risk of damaging the Grub bootloader. This might happen if another operating system overwrites the boot sector. It might also happen if you have several versions of Debian on different partitions and you remove one of them. The answer is to create a Grub boot disc (floppy or CD) that will boot into Debian on a partition that you know will never be moved or removed.

2 Create a boot floppy

The way to create a Grub boot floppy for Debian, based on the article at http://www.linuxjournal.com/comment/reply/4622, is as follows.

Boot into your Debian system. If you have more than one, boot into the system that you know will remain permanently on your hard drive. Insert a floppy disc in your floppy drive and format it. Add a file system. This could be anything that Debian will recognise (eg ext2), but these commands will add an MSDOS filesystem.

fdformat /dev/fd0
mkfs -t msdos /dev/fd0

Mount the floppy and copy the /boot/grub directory and its contents from the running system to the floppy. Unmount the floppy.

$ mount -t msdos /dev/fd0 /media/floppy
$ mkdir -p /media/floppy/boot/grub
$ cp /boot/grub/* /media/floppy/boot/grub
$ umount /media/floppy

Install the GRUB boot loader in the MBR of the floppy itself. Run grub and enter these commands at the grub prompt.

$ grub
grub> root (fd0)
grub> setup (fd0)
grub> quit

That's it! To test the floppy, restart the system with the floppy in the drive. You can select which operating system to boot from the usual blue menu.

3 Create a boot CD

You can find basic instructions for creating a bootable Grub disc in the manual at http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD_002dROM.html.html#Making-a-GRUB-bootable-CD_002dROM. By adding a slightly modified menu.lst you can create a CD which will boot your system from the usual blue menu.

In your "home" directory create a directory (eg "iso") in which to place the files for the CD.

$ cd ~
$ mkdir iso

Make a directory for Grub and copy the file "stage2_eltorito" to it from /usr/lib/grub/i386-pc/.

$ mkdir -p iso/boot/grub
$ cp /usr/lib/grub/i386-pc/stage2_eltorito iso /boot/grub

Also copy the menu.lst file to it from /boot/grub.

cp /boot/grub/menu.lst iso/boot/grub 

Now edit iso/boot/grub/menu.lst and remove any lines identical to "savedefault". Leaving these commands will cause an error because the CD is a read-only disc. A typical menu entry will look like this once "savedefault" has been removed:

title		Debian GNU/Linux, kernel 2.6.18-3-686
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-3-686 root=/dev/hda6 ro 
initrd		/boot/initrd.img-2.6.18-3-686

Finally, make a ISO9660 image file called "grub.iso".

$ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
   -boot-load-size 4 -boot-info-table -o grub.iso iso

Burn the image file onto CD or a DVD. If you are using K3B or GnomeBaker, choose "Burn CDROM Image" from the "Tools" menu. If you are using the command line, you can use cdrecord. There is an explanation of how to do this at http://www.debian-administration.org/articles/273.

 
Note
Note: 
mkisofs has already set up the disc to boot from the boot/grub/stage2_eltorito file, so there is no need to setup GRUB on the disc. The -boot-load-size 4 bit is required for compatibility with the BIOS on many older machines.
 

That's it! To test the CD, restart the system with the CD in the drive. You can select which operating system to boot from the usual blue menu.

4 How to use the Grub boot disc to repair the MBR

--Chris Lale 15:32, 2 March 2007 (CET)

Your system may stop booting from the hard drive if you install Windows or install another instance of Debian and then remove it.

Just boot from your Grub floppy or CD, login, switch user to user root and re-install the Grub bootloader. If your first master hard disc is IDE, enter

# grub-install /dev/hda

If your first master hard disc is SCSI or SATA, use

# grub-install /dev/sda

5 Appendix A: Licence

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_try_out_Debian_GNU/Linux_without_installing_it.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_try_out_Debian_GNU/Linux_without_installing_it.html0000644000175000017500000003304211257474724033115 0ustar chrischris How to try out Debian GNU/Linux without installing it - NewbieDOC

How to try out Debian GNU/Linux without installing it

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 0.1 14th February 2007 Revised by Chris Lale
Initial release.

Version 0.2 25th November 2007 Revised by Chris Lale
Adapted for newbiedoc package by adding Revision History and Abstract.

Version 0.3 26th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to try out Debian GNU/Linux without installing it


Abstract

Anyone new to Debian (Debian "newbie") might want help and advice about whether to choose Debian. This article describes how to obtain and use the LiveCD version of Debian - Debian Live.

Contents


1 About live distros

A live distro is a complete system that can be held on a medium such as a CDROM (Live CD), DVD (Live DVD) or a USB flash drive (Live USB). It contains an operating system which boots directly from the medium without any installation on a hard drive. In other words, a live distro does not modify your hard drive - it does not add anything, delete anything or reformat (erase) your hard drive. This makes a live distro the ideal way to try out Debian and see if you like it.

2 About the Debian Live project

The Debian Live system is a Debian live distro. It runs from media (such as a CDROM or a USB-stick) or over a network. Debian Live uses only official packages from the Debian repository - the "main" section (and possibly the "contrib" section). The "non-free" section is not used at all for the live system. What this means is that not all the software available to Debian users is provided in the live distro. You must install Debian on your hard drive if you want to have access to all the software available.

The Debian Live project does not change any packages. This means that it is the only live distro to be 100% Debian.

3 Create a Debian Live CD

3.1 Download and the CD image (ISO)

The Debian Live project maintains a number of live CD images for the i386 PC ("i386" refers to PCs with Intel processors). Each Debian Live CD ISO image is a single ".iso" file. The ISOs for Unstable (Sid) are updated weekly. You can download them from the "daily-builds/"directory at http://live.debian.net/cdimage/. The ISOs for Stable are in the directory named after the release. For example, when the current Stable version was called Lenny, the ISOs were in http://live.debian.net/cdimage/lenny-builds.

Debian uses the Gnome desktop by default, so the Gnome desktop ISO is a good choice. You can download the Stable version (eg Lenny) from http://live.debian.net/cdimage/lenny-builds/current/i386/iso-cd/debian-live-502-i386-gnome-desktop.iso The download is 691MB, or so, and may take around three hours on a 512 kb/s broadband connection. A 56k dialup modem will take 10 times as long. Save the ISO to your hard drive.

3.2 Burn the CD image (ISO) onto a CDROM

Do not burn the ISO to a CDROM as an ordinary file - the CDROM will not be able to boot the computer if you do. Use your software's special method for CDROM images.

Linux CDROM burning software has special options to burn an ISO image. In "GnomeBaker" or "K3B" choose "Burn CDROM Image from the "Tools" menu.

The procedure with Windows depends on the CDROM burning software you use. In "Nero", select the ISO file, enable the "Finalize CD" option and burn the CD. In "Roxio Easy CD Creator", select the ISO file, choose to "Create CD", make sure the Write Method is set to "Disc-At-Once" and "Close CD". Burn the CD. You can find more details about these, and other CDROM burning software for Windows, at http://iso.snoekonline.com/iso.htm.

4 Prepare the computer to boot from CD

Modern computers can boot directly from CDROM, but this feature may not be enabled on your computer. You must check that your BIOS is set to enable booting from CDROM. The BIOS starts you computer and connects it to the keyboard and screen. Then it looks for an operating system, such as Linux or Windows, to start the boot process. You must set CDROM as the "first boot device" so that the BIOS will look for a CDROM before it looks for a hard disc.

Make sure that your computer is switched off. Switch on the computer. Look at the text messages on the screen and find the BIOS "setup" key. In modern computers this is normally the "Del" key. The initial screen message may look something like this:

Press DEL to run Setup

You will only have a few seconds to press the setup key. If you miss it you may have to switch off and try again.

Navigate the BIOS setup menus with the arrow keys. Look for a menu involving the "boot" process. Change the boot device priority so that the CDROM appears as the first device. You should have something like this:

1st Boot Device	[CDROM]
2nd Boot Device	[Hard Drive]

Save the changes and exit setup. In many BIOSs you can do this by pressing the F10 key. Look for help at the top or bottom of the menu screen.


5 Running the computer from the live CD

Switch on the computer and immediately insert the live CD. If you take too long the computer will boot normally from the hard disc. If this happens, just reboot (restart) the computer normally with the disc still in the CDROM drive. Your computer will boot into Debian from the CDROM. Remember that a CDROM is much slower than a hard disc, so be patient. Enjoy the experience of Free software.

6 Appendix A: Licence

Copyright (c) 2007-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_install_Debian_GNU/Linux_on_your_computer.html0000644000175000017500000012641211257474724032047 0ustar chrischris How to install Debian GNU/Linux on your computer - NewbieDOC

How to install Debian GNU/Linux on your computer

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 1.0 16th February 2007 Revised by Chris Lale
Initial release for Etch (Testing).

Version 1.1 25th May 2007 Revised by Chris Lale
Added link to install CD/DVD vendors on www.debian.org.

Version 1.2 14th June 2007 Revised by Chris Lale
Revised for compatibility with the Debian 4.0 Stable (Etch) installer.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to install Debian GNU/Linux on your computer


Abstract

This HOWTO walks you through the installation of Debian GNU/Linux using the graphical installer ("installgui"). It covers some common scenarios - complete over-write of everything on an existing hard drive, dual-boot with another operating system (eg Windows) and installation from CD/DVD and network ("netinst"). This article is based on the Debian 4.0 Stable (Etch) i386 installer.


Contents


1 Introduction

This article explains how to install Debian GNU/Linux on a new computer or a computer already containing an operating system like Windows. You can choose to remove Windows completely or to keep it alongside Debian. You can install Debian from CD or DVD, or from a network connection to the internet.

Installing from CD and replacing Windows completely is very easy. Setting up a dual-boot system, or installing from a network, requires a little more work but is still straightforward. For a net install, your computer needs access to the internet via a network card.

 
Note
Note: 
At the time of writing, there was a problem with the "netinst" CD. You can find more details about this on the Debian installer webpage.
 

Two types of installation are covered.

Simple installation
This is the easiest installation but it erases your hard disc first.
Dual-boot installation
This keeps your existing operating system (eg Windows) providing that enough free space is available. After installation, every time that you switch on the computer, or reboot it, you can choose which system to use. The installer can shrink your Windows partition or you can fit an extra hard drive for Debian. Backup any important files first.

Two installation methods are covered.

Installation from a physical medium.
The installation medium is normally CD or DVD. You can use a complete disc set, but you only the first disc in the set to install Debian. The other discs are useful if you cannot use the internet to download extra software in the future. You can either buy the discs or download them for free from the Debian website.
Installation from a network or the internet.
You can install directly from the internet. You need a "netinst" version of the installation CD (from the Debian website) and a connection to the internet via your computer's "network" socket. This could mean that your computer is connected either to a network or to a DSL/ADSL broadband modem/router with an RJ45 network cable.

2 What you need

2.1 Hardware and media

These are the items you will need in order to install Debian.

  • a computer with
    • a bootable CD/DVD drive and
    • EITHER a hard drive that is empty or that you do not mind erasing completely
    • OR a hard drive that has enough free space for adding Debian, or an additional hard drive for Debian;
  • one of the official Debian installation media:
    • first disc of CD or DVD set or
    • netinst CD

2.2 Information you supply to the installer

The installer will ask you to supply this information. You can choose some of it from lists provided by the installer.

2.2.1 Installation from CD/DVD

  • Language used during installation (chosen from a list).
  • Country in which the computer will be used (chosen from a list).
  • Keyboard layout of the computer's keyboard (chosen from a list).
  • Hostname used to identify the computer (made up by you).
  • Password for the administrative superuser "root" (made up by you).
  • User name of someone who will use the computer for normal (non-administrative) purposes. (This will normally be your name).
  • Username, or nickname, to be used by the computer to recognise the normal user. (This could be your firstname.)
  • A different password for the normal user (made up by you).

2.2.2 Installation from Network

The installer will want all the information needed when installing from CD/DVD and these additional items.

  • Domain name of the network to which computer belongs (supplied by the network administrator or made up by you for a home network or modem/router).
  • Debian archive mirror server used to supplement the software on the CD/DVD. This is often something like ftp.<your country code>.debian.org (chosen from a list).

3 Outline of installation

  1. Boot from the installation CD/DVD.
  2. Choose a language.
  3. Choose a country.
  4. Choose a keyboard layout.
  5. Set the computer's hostname.
  6. Set the network domain name (only if connected to a network).
  7. Partition the hard drive.
    1. Choose the partitioning method - whether to erase the hard drive or shrink an existing partition (eg a Windows partition); whether to use the entire hard drive or just part of it.
    2. Choose the partitioning scheme - whether to put all files in one partition or to use additional partitions for different parts of the filesystem.
  8. Set up users and passwords.
  9. Choose a Debian archive mirror server (only if connected to a network).
  10. Configure the popularity contest - a survey to measure the most frequently used Debian software.
  11. Install optional software collections eg a desktop environment.
  12. Install the Grub bootloader.
  13. Reboot the computer.

4 Installation in detail

4.1 Boot from the install CD/DVD

Switch on the computer and immediately insert the installation CDROM or DVD. If you are using a disc set, insert the first disc. If you are installing from the internet via a network connection, insert the "netinst" CD. If you take too long the computer will not boot from the CD/DVD but will boot normally from the hard drive. Just reboot (restart) the computer with the CD/DVD still in the drive. If the computer still does not boot from the installation CD/DVD, check your BIOS settings. The Appendix gives instructions for this.

You will see the installer's boot screen with a message and a flashing cursor at the bottom.

Press F1 for help, or ENTER to boot:


The installer boot screen has a flashing cursor.

Fig 1: The installer boot screen has a flashing cursor.

A GUI is a Graphical User Interface which enables you to use a mouse. The GUI version of the Debian installer will not become the default until Debian Lenny is released. However, you can opt to run the GUI installer by entering "installgui" at the flashing prompt.

installgui

The computer will boot into the GUI version of the installer.

4.2 How to use the installer

The installer's screens have buttons to enable you to move forwards and backwards through the installation process. You can provide information by choosing from lists, ticking boxes and entering text into boxes. On some screens there are progess bars to show you how far the installer has got.

You can interact with the installer's screens using the mouse in the normal way. Alternatively, you can use the arrow, tab, spacebar, Esc and Enter keys. The table shows how you can do this.

Mouse command Keyboard command
Continue Click "Continue" or double-click on item Press "Enter" key
Go Back Click "Go Back" Press "Esc" key
Select list item Click item Press "Up-arrow" or "Down-arrow" key
Select other items Click item Cycle selection with "Tab" key
Tick items Click tick box Select item and press "Tab", then "Spacebar" then "Tab"
Radio choice items Click radio button Select item and press "Spacebar"
Enter text Select text box and type text Select text box and type text


4.3 You choose a language

The first screen asks you to choose the language to be used for the rest of the installation.

The installer GUI screen for choosing language.

Fig 2: The installer GUI screen for choosing language.

Select a language (eg "English") from the list and click on the "Continue" button (or press the "Enter" key). Alternatively, you can double-click on "English".

English

Continue

4.4 You choose a country

If the installer knows about your location (country, territory or area), it can make guesses about other configuration options. Select country (eg "United Kingdom") from the list and continue to the next screen.

United Kingdom

Continue

4.5 You choose a keyboard layout

There is a list of keymaps. A keymap is a map of the position of every key on the computer's keyboard. Select a keymap (eg "British English") from the list and continue to the next screen.

British English

Continue

4.6 The installer fetches files from the CDROM

The installer finds the CDROM, then detects and mounts it. It then gets the files it needs from the CDROM. You can follow the installer's progress on the screens with coloured bars.

Detecting hardware to find CD-ROM drives
Scanning CD-ROM
Loading additional components 

The coloured progress bar progress

Fig 3: The coloured bar shows progress.

4.7 The installer configures the network

The installer can use a network connection to fetch the latest security updates. It can also use the network connection as an alternative installation source instead of CD/DVD.

Most modern computers have a network card. The installer checks to see if you have one. If your network card is connected to a DSL/ADSL broadband modem, or if it is part of another network, the installer tries to connect to it. It does this by looking for a "DHCP" server on the network and asking it for a connection.

The coloured bars show progress.

Detecting network hardware
Configuring the network with DHCP

If your computer is not connected to a network, automatic network detection will fail.

Network autoconfiguration failed

Continue

This does not matter - just leave the network unconfigured. It just means that the installer will not fetch any security updates during installation. You can always fetch them later (eg by reconfiguring the repositories list using the "Synaptic" program).

Do not configure the network at this time

Continue

4.8 You set the computer's hostname

The hostname[1] is the name that identifies the computer . It will be used in a variety of situations including the commandline prompt, logs, messages, and network connections. You must set a hostname even if the computer is not connected to a network at the moment. The default hostname is "debian", but you can change it to something else. For instance, to change it to "mybox", enter "mybox" into the "Hostname" text box.

Hostname: mybox

Continue


4.9 You set the network domain

You only need to do this if your computer is connected to a network. Otherwise the installer will go straight to partitioning your hard drive (described in the next section).

You must tell the installer about the domain name (the segment of the network to which the computer will belong). If you are setting up a simple home network, you can make something up eg "myhome". All the computers in a simple network must have the same domain name.

Domain name: myhome

Continue

The installer detects and identifies your hard drives and other hardware needed for sound, printing, etc. The coloured bar shows progress.

Detecting disks

4.10 You partition the hard drive

You can follow the coloured progress bar as the installer sets up the partitioning software.

Starting up the partitioner

4.10.1 You choose the partitioning method

You have a choice between guided and manual partitioning. For a simple installation choose one of the guided methods.

4.10.1.1 Simple installation - erase everything on the hard drive

If your hard drive is empty, or you do not mind erasing it completely, choose the "Guided" method that will guide you through using the whole disc:

Guided - use entire disk

Continue
 
Warning
Warning: 
This method will erase the entire disc. You will lose anything that is already on the hard drive that you choose.
 

If you have only one disc, the installer will show only one entry in the list of discs to partition eg "IDE1 master(hda)":

IDE1 master(hda) - 8.4GB SOME MANUFACTURER HARDDISK

Continue

If you have more than one disc, the installer will ask you which one to partition. If you wish to install Debian on a second hard drive, choose that disc. It will be "IDE2 master(hdb)" or something similar.

Go straight on to choosing the partitioning scheme.

4.10.1.2 Dual-boot installation - shrink an existing partition

If have only one hard drive and you wish to keep an existing operating system, you must make room for a Debian partition on the hard drive. Choose the "Manual" method.

Manual

Continue

Select the partition containing the existing operating system. It will probably be the first ("#1")primary partition on the first master disc ("hda"). In this example of a typical Windows system, the partition size is 8.4 GB, it is bootable ("B") and is formatted with the "ntfs" file system.

>   #1 primary  8.4 GB B ntfs

Continue

Now you can resize the existing partition to free up some space for Debian partitions.

 
Warning
Warning: 
Make sure that you have backed up any important files before continuing.
 
Resize the partition (currently 8.4 GB)

Continue

Write previous changes to disk and continue?
Yes

Continue

The amount that you can shrink the partition depends on how much free space there is inside the partition. For example, if the existing partition has something over 50% free space inside it, you could shrink the partition by 50%. In practice, you should plan to end up with adequate free space inside the existing partition after it has been resized.

New partition size:
50%

Continue

You can follow progress with coloured bar. It may take a while.

Please wait...

Eventually, you will see the new partition table including the free space.

IDE1 master (hda) - 8.4 GB SOME_MANUFACTURER HARDDISK
  > # 1 primary  4.2 GB B ntfs
  >   pri/log    4.2 GB   FREE SPACE

Now you must partition the FREE SPACE for Debian. Select the FREE SPACE.

  >   pri/log  4.2 GB   FREE SPACE

Continue

Now you must choose how to partition this free space. Choose the partitioning scheme in the next section.

4.10.2 You choose the partitioning scheme

Select the simplest scheme which installs all the files into one partition.

All files in one partition - (recommended for new users)

Continue

You can follow the coloured progress bar as the installer works out how best to fit the partition onto the hard drive.

4.10.3 You check the proposed partition information

The partitioner will propose setting up a "primary" partition for all files and and a "logical partition for swap. (Swap is temporary storage and improves you computer's performance.)

The hard drive will be identified by "hda", "sda" or something similar.

IDE1 master (hda) - 8.4GB SOME_MANUFACTURER HARDDISK

If you are doing a simple installation and overwriting the whole disc, you will see one primary partition. It will be partition number 1 formatted with the "ext3" filesystem and a mountpoint of "/" ("root of filesystem")

>   #1 primary   8.3 GB B f ext3    /

If you are doing a dual boot installation you will see two partions -one containing your original operating system and a new one for the Debian root filesystem.

>   #1 primary  4.2 GB     ntfs
>   #2 primary  4.1 GB B f ext3    /

There will be another small "logical" partition for the swap space. Partition number 5 is the first available logical partition. It will be formatted for use as swap.

>   #5 logical  156 MB   f swap    swap

Select the option to finish partitioning, and continue.

Finish partitioning and write changes to disk

Continue

The installer will warn you that you are about to erase your hard drive.

WARNING: This will destroy all data on any partitions ... that are going to be formatted.
[...]
Write the changes to disks?

Select "Yes", and continue.

Yes

Continue

4.10.4 The installer partitions the hard drive

The installer creates the new partitions, formats them and sets the clock. The coloured bars show progress.

Partitions formatting
Setting up the clock

4.11 You set up users and passwords

Your new Debian system must have an all-powerful superuser called "root". You must enter a password for user root.

Root password: ******

Re-enter password to verify: ******
Continue

Continue to the next screen. You should normally login to your new system only as a normal user. You must set up a normal user and password now. You can add more users when the installation is complete.

Full name for the new user: Firstname Surname

Continue

Continue to the next screen to set the username for the account. This name will be used to login, regulate access to certain files and to define a user area for storing personal work and configuration files called a "home directory".

Username for your account: nickname

Continue

Continue to the next screen to set a password for your new normal user.

Choose a password for the new user: ******
 
Re-enter password to verify: ******

Continue

4.12 The installer installs the base system

The installer fetches and installs files need for the base Debian system from the CD. The coloured bar shows progress. It may take a few minutes.

Installing the base system

4.13 The installer configures the package manager

Debian's Advanced Package Tool (APT) is a system that makes finding and installing software very easy. The installer configures APT with the settings you need. The coloured bar shows progress.

Configuring Apt

The installer may ask you whether you wish to use a network mirror server for supplementary software. It is wise to answer "yes" if you are connected to a network. You can answer "No" if you are installing software only from CD/DVD.

Use a network mirror?
Yes or No (see text)

Continue

Choose a repository from the list. If you live in the UK, you might choose the following archive mirror server:

United Kingdom

Continue

ftp.uk.debian.org

Continue 

You can also configure an HTTP proxy if you use one. If you don't have one, or don't know what this means, leave the HTTP proxy entry blank and continue.

Configuring Apt

The installer tries to access security updates from a repository on the Debian website. This will fail if you are not yet connected to the internet. If you get a failure message, just continue to the next screen. You can enable security updates after installation (eg using the "Synaptic" program for installing software).

Cannot access security updates

Continue

4.14 The installer selects and installs software

The installer fetches and installs some of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.15 You configure the popularity contest

The popularity contest is software that sends statistics to Debian software developers about the software you use most frequently. Popularity contest needs a network connection. If you do not want to participate at the moment, choose "No" and continue. If you change your mind later, you can reconfigure "popularity-contest" with the "Synaptic" program.

No

Continue

4.16 The installer selects and installs more software

The installer fetches and installs more of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.17 You choose some software collections to install

You will need more than just the core of the Debian system. For a desktop system (including mouse, menus, taskbar, etc), tick the boxes for Standard system and Desktop environment.

Standard system
Desktop environment

If you are installing on a laptop, also tick the box for Laptop.

Laptop

Then continue. You can watch progress with the coloured bar as the installer selects and installs the software.

Continue

Select and install software

4.18 You install the Grub bootloader

The bootloader is a little program used by the computer's BIOS to boot your new Debian system.

Installing GRUB boot loader

You normally install the bootloader to the MBR (Master Boot Record). The MBR is a small sector at the beginning of your first hard disc.

Install the GRUB boot loader to the master boot record? 
Yes

Continue

The coloured bar shows progress.

Install the GRUB boot loader on a hard disk

4.19 You finish the installation

When the installation is finished, the CDROM is ejected. You can remove the CD and reboot the computer.

Installation complete

Continue

Your computer will now boot into the wonderful world of Debian.

5 Comments

If you find any mistakes or you have any ather comments, please add them to this article's discussion page

6 Appendix A: Configure the computer BIOS to boot from CD

Modern computers can boot directly from CDROM, but this feature may not be enabled on your computer. You must check that your BIOS is set to enable booting from CDROM. The BIOS starts you computer and connects it to the keyboard and screen. Then it looks for an operating system, such as Linux or Windows, to start the boot process. You must set CDROM as the "first boot device" so that the BIOS will look for a CDROM before it looks for a hard disc.

Make sure that your computer is switched off. Switch on the computer. Look at the text messages on the screen and find the BIOS "setup" key. In modern computers this is normally the "Del" key. The initial screen message may look something like this:

Press DEL to run Setup

You will only have a few seconds to press the setup key. If you miss it you may have to switch off and try again.

Navigate the BIOS setup menus with the arrow keys. Look for a menu involving the "boot" process. Change the boot device priority so that the CDROM appears as the first device. You should have something like this:

1st Boot Device	[CDROM]
2nd Boot Device	[Hard Drive]

Save the changes and exit setup. In many BIOSs you can do this by pressing the F10 key. Look for help at the margins of the menu screen.


7 Appendix B: Licence

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.
newbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_download_Debian_GNU/Linux_installation_CD/0000755000175000017500000000000011257474726030755 5ustar chrischris././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_download_Debian_GNU/Linux_installation_CD/DVDs_with_Jigdo.htmlnewbiedoc-0.8.0/newbiedoc.berlios.de/wiki/How_to_download_Debian_GNU/Linux_installation_CD/DVDs_with0000644000175000017500000005462711257474724032547 0ustar chrischris How to download Debian GNU/Linux installation CD/DVDs with Jigdo - NewbieDOC

How to download Debian GNU/Linux installation CD/DVDs with Jigdo

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Version 1.0 17th February 2007 Revised by Chris Lale
Initial release

Version 1.1 25th May 2007 Revised by Chris Lale
Updated Jigdo file URLs for Etch (Stable) and added a section about Network Install.

Version 1.2 22nd November 2007 Revised by Chris Lale
Modified for inclusion in the "newbiedoc" package.

Version 1.3 25th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to download Debian GNU/Linux installation CD/DVDs with Jigdo


Abstract

This article describes how to download CD and DVD images of the Debian installer. The images can be burned to disc to make copies of the official installation CDs/DVDs.


Contents


1 Collect information from the Debian "Download with Jigdo" webpage

Visit debian.org to find the URL for the disc images.

http://www.debian.org/CD/jigdo-cd/

You probably want the official images for the Stable release. You can find these at:

http://www.debian.org/CD/http-ftp/.html#stable

For example, the 32-bit Intel PC (i386) images for the Stable release 5.0.3 ("Lenny"), were at:

http://cdimage.debian.org/debian-cd/5.0.3/i386/jigdo-cd/
http://cdimage.debian.org/debian-cd/5.0.3/i386/jigdo-dvd/
http://cdimage.debian.org/debian-cd/5.0.3/i386/jigdo-bd/

for CD, DVD and blu-ray respectively.

You will need at least the first disc of any set in order to be able to install Debian. The download of each disc image is controlled by a ".jigdo" file. Make a note of the URL of each ".jigdo" file you need. In the example above, the ".jigdo" file for the first CD disc image of Stable is (all on one line):

http://cdimage.debian.org/debian-cd/5.0.3/i386/
    jigdo-cd/debian-503-i386-CD-1.jigdo

2 Install Jigdo (the Jigsaw Download software)

If Debian's CDs and DVDs were distributed as full .iso images, they would take up hundreds of GigaBytes on each of the mirror servers. Nobody is prepared to mirror such a huge amount of data!

Jigdo (Jigsaw Download) makes it possible to distribute very large files over the internet. It does not need the full CD/DVD images be stored on the servers. Instead, it can download the individual files from a normal Debian mirror and only assemble the image on the user's machine.

Jigdo is available for Linux, Windows and MacOS, amongst others, from http://atterer.net/jigdo/.

2.1 Install Jigdo in Debian

If you are already running Debian, install the package "jigdo-file" from a terminal as user root.

# aptitude install jigdo-file

2.2 Install Jigdo in another flavour of Linux

Download jigdo-lite for Linux from http://atterer.net/jigdo/ and extract it to a suitable directory eg ~/jigdo.

2.3 Install Jigdo in Windows

Download jigdo-lite for Windows from http://atterer.net/jigdo/ and unzip it to a suitable directory eg C:\jigdo.

3 Run jigdo-lite

3.1 Run jigdo-lite in Debian

Create a directory to store the download files eg ~/jigdo, and change directory to it. Run jigdo-lite.

$ mkdir ~/jigdo
$ cd ~/jigdo
$ jigdo-lite

3.2 Run jigdo-lite in another flavour of Linux

Change directory to the folder containing the executable "jigdo-file" and the shell script "jigdo-lite" eg ~/jigdo. The downloaded files will also be stored here. Run jigdo-lite.

$ cd ~/jigdo
$ ./jigdo-lite

3.3 Run jigdo-lite in Windows

Change directory to the folder containing the executable "jigdo-lite.bat". The downloaded files will also be stored here. Execute jigdo-lite.bat.

4 Download a disc image with jigdo-lite

4.1 Initial information

Jigdo-lite runs in text mode.The first text to appear on the screen is the copyright notice.

Jigsaw Download "lite"
Copyright (C) 2001-2005  |  jigdo@
Richard Atterer          |  atterer.net

4.2 URL of the ".jigdo" file

After a brief explanation, jigdo asks for the URL of the ".jigdo" file on the Debian website

To start a new download, enter URL of .jigdo file.

Enter the URL by typing it (in a continuous line) and pressing the "Enter" key.

jigdo: http://http://cdimage.debian.org/debian-cd/5.0.3/i386/
     jigdo-cd/debian-503-i386-CD-1.jigdo

4.3 Download the ".jigdo file

Jigdo downloads the "jigdo" file.

Downloading .jigdo file
--2009-09-25 18:38:34--  http://cdimage.debian.org/debian-cd/5.0.3/i386/jigdo-cd/debian-503-i386-CD-1.jigdo
Resolving cdimage.debian.org... 130.239.18.173, 130.239.18.137, 2001:6b0:e:2018::137, ...
Connecting to cdimage.debian.org|130.239.18.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31564 (31K) [text/plain]
Saving to: `debian-503-i386-CD-1.jigdo'

100%[======================================>] 31,564      52.6K/s   in 0.6s    

2009-09-25 18:38:35 (52.6 KB/s) - `debian-503-i386-CD-1.jigdo' saved [31564/31564]

Jigdo then gives you some information about the image you are about to download.

4.4 Reuse files from a previous version

Jigdo can use files from a previous downloaded version if they are still current and you have them on a CDROM. You probably do not want to do this. Just leave "Files to scan:" empty and press Enter.

select the respective entry for scanning:
  1: /cdrom
Files to scan:

4.5 Choose a Debian mirror server

You must choose which Debian mirror you are going to get your downloads from. You can try a two-letter country code such as "uk", or a country name like "United Kingdom" if you are not sure.

Debian mirror [http://ftp.uk.debian.org/debian/]: uk

You will get a list of suitable mirrors with entries like these:

http://ftp.uk.debian.org/debian/         # GB Great Britain (London)
http://mirror.ox.ac.uk/debian/           # GB Great Britain (Oxford)

Enter your chosen mirror.

Debian mirror []: http://ftp.uk.debian.org/debian/

4.6 Download the ".template" file

Jigdo will contact the mirror and download the ".template" file.

Downloading .template file
--2009-09-25 18:43:13--  http://cdimage.debian.org/debian-cd/5.0.3/i386/jigdo-cd/debian-503-i386-CD-1.template
Resolving cdimage.debian.org... 130.239.18.173, 2001:6b0:e:2018::173, 2001:6b0:e:2018::137
Connecting to cdimage.debian.org|130.239.18.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28005948 (27M) [text/plain]
Saving to: `debian-503-i386-CD-1.template'

 3% [>                                      ] 1,055,200   53.6K/s  eta 6m 5s  

4.7 Download the files needed for the image

Jigdo uses the ".template" file to identify all the files it needs to build the CD image.

Merging parts from `file:' URIs, if any...
Found 0 of the 1097 files required by the template

Jigdo then downloads the files and builds the image. Each downloaded file results in a message like this.

--19:46:24--  http://ftp.uk.debian.org/debian/pool/main/z/zlib/zlib1g_1.2.3-13_i386.deb
           => `debian-testing-i386-CD-1.iso.tmpdir/ftp.uk.debian.org/debian/pool/
                   main/z/zlib/zlib1g_1.2.3-13_i386.deb'
Resolving ftp.uk.debian.org... 83.142.228.128
Connecting to ftp.uk.debian.org|83.142.228.128|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 70,528 (69K) [application/x-debian-package]

100%[====================================>] 70,528        61.26K/s

19:46:37 (61.15 KB/s) - `debian-testing-i386-CD-1.iso.tmpdir/ftp.uk.debian.org/debian/pool/
                             main/z/zlib/zlib1g_1.2.3-13_i386.deb' saved [70528/70528]

4.8 Burn the completed image to CD

When downloading has finished, jigdo tells you that there is a high chance of success that your image is complete. You can now burn the resulting ".iso" image to CD using the special tools provided with your CD burning software. Do not burn the image file to a CDROM as an ordinary file - the CDROM will not be able to boot the computer if you do.

Linux CDROM burning software has special options to burn an ISO image. In "GnomeBaker" or "K3B" choose "Burn CDROM Image" from the "Tools" menu.

The procedure with Windows depends on the CDROM burning software you use. In "Nero", select the ISO file, enable the "Finalize CD" option and burn the CD. In "Roxio Easy CD Creator", select the ISO file, choose to "Create CD", make sure the Write Method is set to "Disc-At-Once" and "Close CD". Burn the CD. You can find more details about these, and other CDROM burning software for Windows, at http://iso.snoekonline.com/iso.htm

5 Network Install

There is also a "network install" CD. This is a small image (180Mb). It is enough to start the installation. Installation continues by downloading the files directly from the internet, so you need to have an internet connection during installation. You must download the complete ISO file rather than use Jigdo. The ISO file for the network install is here:

http://www.debian.org/CD/netinst/

Use a tool that supports resuming. Under Unix, you can use aria2, wxDownload Fast or (on the command line)

wget -c URL

or

curl -C - -L -O URL

Under Windows, you might want to try Free Download Manager or GetRight.

Under Mac OS, have a look at Speed Download.

6 Appendix A: Licence

Copyright (c) 2007-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."


Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.