From 7b00251e5638fc6b043ab25f94e6cef655c42566 Mon Sep 17 00:00:00 2001 From: Klaatu Date: Sat, 23 Jun 2012 22:04:36 -0400 Subject: Beefed up pine and mutt in ch16 Added dual booting section in ch03 per TODO file --- chapter_03.xml | 275 +++++++++++++++++++++++++++++++++++-- chapter_16.xml | 419 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 664 insertions(+), 30 deletions(-) diff --git a/chapter_03.xml b/chapter_03.xml index 4b70d0b..9368969 100644 --- a/chapter_03.xml +++ b/chapter_03.xml @@ -2,7 +2,7 @@ - + Booting @@ -20,7 +20,7 @@ multiple operating systems, such as other Linux distributions or Microsoft Windows. -
+
<application>mkinitrd</application> @@ -120,7 +120,8 @@ explanation, check the manpage or run argument. -darkstar:~# mkinitrd --help + +darkstar:~# mkinitrd --help mkinitrd creates an initial ramdisk (actually an initramfs cpio+gzip archive) used to load kernel modules that are needed to mount the root filesystem, or other modules that might be needed before the @@ -142,7 +143,8 @@ using the huge kernel, you can easily find this information with the /proc/mounts. -darkstar:~# mount + +darkstar:~# mount /dev/sda1 on / type ext4 (rw,barrier=1,data=ordered) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) @@ -227,7 +229,7 @@ mkinitrd -c -k 2.6.33.4 -f ext3 -r /dev/sda3 -m \
-
+
LILO @@ -235,7 +237,7 @@ LILO is the Linux Loader and is currently the default boot loader installed with Slackware Linux. If you've used other Linux distributions before, you may be more familiar with GRUB. If you prefer to use GRUB instead, you can easily find it in the -extra/ directory on one of your Slackware CDs. +extra/ directory on one of your Slackware CDs. However, since LILO is the default Slackware bootloader, we'll focus exclusively on it. @@ -375,7 +377,7 @@ other = /dev/sda3 For Linux operating systems like Slackware, the image line specifies which kernel to boot. In this case, we're booting /boot/vmlinuz-generic-2.6.29.4. The remaining -sections are pretty self-explainatory. They tell LILO where to find the +sections are pretty self-explanatory. They tell LILO where to find the root filesystem, what initrd (if any) to use, and to initially mount the root filesystem read-only. That initrd line is very important for anyone running a generic kernel or using LVM or software RAID. It @@ -407,6 +409,263 @@ should be just fine. In particular, the LBA32 addressing warning is commonplace. -
+
+ +
+Dual Booting + + + A bootloader (like LILO) is a very flexible thing, since it exists + only to determine which hard drive, partition, or even a specific + kernel on a partition to boot. This inherently suggests a choice + when booting, so the idea of having more than one operating system + on a computer comes very naturally to a LILO or GRUB user. + + + + People "dual boot" for a number of reasons; some people want + to have a stable Slackware install on one partition or drive and a + development sandbox on another, other people might want to have + Slackware on one and another Linux or BSD distribution on another, + and still other people may have Slackware on one partition and a + proprietary operating system (for work or for that one application + that Linux simply cannot offer) on the other. + + + + Dual booting should not be taken lightly, however, since it usually + means that you'll now have two different operating systems + attempting to manage the bootloader. If you dual boot, the + likelihood of one OS over-writing or updating the bootloader entries + without your direct intervention is great; if this happens, you'll + have to modify GRUB or LILO manually so you can get into each OS. + + + + There are two ways to dual (or multi) boot; you can put each + operating system on its own hard drive (common on a desktop, with + their luxury of having more than one drive bay) or each operating + system on its own partition (common on a laptop where only one + physical drive is present). + + +
+Dual Booting with Partitions + + + In order to set up a dual-boot system with each operating system on + its own partition, you must first create partitions. This is easiest + if done prior to installing the first operating system, in which + case it's a simple case of pre-planning and carving up your hard + drive as you feel necessary. See for + information on using the fdisk or + cfdisk partitioning applications. + + + + + If you're dual booting two Linux distributions, it is inadvisable + to attempt to share a /home directory between the + systems. While it is technically possible, doing so will increase + the chance of your personal configurations from becoming mauled by + competing desktop environments or versions. + + + + It is, however, safe to use a common swap partition. + + + + + You should partition your drive into at least three parts: + + + + + + One partition for Slackware + + + + + + One partition for the secondary OS + + + + + + One partition for swap + + + + + + First, install Slackware Linux onto the first partition of the hard + drive as described in . + + + + After Slackware has been installed, booted, and you've confirmed + that everything works as expected, then reboot to the installer for + the second OS. This OS will invariably offer to utilize the entire + drive; you obviously do not want to do that, so + constrain it to only the second partition. Furthermore, the OS will + attempt to install a boot loader to the beginning of the hard drive, + overwriting LILO. + + + + You have a few possible courses of action with regards to the boot + loader: + + + + + Possible Boot Loader Scenarios + + + + + If the secondary OS is Linux, disallow it from installing a boot + manager. + + + + + If you're dual booting to another Linux distribution, the + installer of that distribution usually asks if you want a boot + loader installed. You're certainly free to not install a boot + manager for it at all, and manually manage both Slackware and + the other distribution with LILO. + + + + Depending on the distribution, you might be editing LILO more + frequently than you would if you were only running Slackware; + some distributions are notorious for frequent kernel updates, + meaning that you'll need to edit LILO to reflect the new + configuration after such an update. But if you didn't want to + edit configuration files every now and again, you probably + wouldn't have chosen Slackware. + + + + + + + If the secondary OS is Linux, let it overwrite LILO with GRUB. + + + + + If you're dual booting to another Linux distribution, you are + perfectly capable of just using GRUB rather than LILO, or + install Slackware last and use LILO for both. Both LILO and GRUB + have very good auto-detection features, so whichever one gets + installed last should pick up the other distribution's presence + and make an entry for it. + + + + Since other distributions often attempt to auto-update their + GRUB menus, there is always the chance that during an update + something will become maligned and you suddenly find you can't + boot into Slackware. If this happens, don't panic; just boot + into the other Linux partition and manually edit GRUB so that it + points to the correct partition, kernel, and initrd (if + applicable) for Slackware in its menu. + + + + + + + Allow the secondary OS to overwrite LILO and go back later to + manually re-install and re-configure LILO. + + + + This is not a bad choice, especially when Windows is the + secondary OS, but potential pitfalls are that when Windows + updates itself, it may attempt to overwrite the MBR (master boot record) + again, and you'll have to re-install LILO manually again. + + + + To re-establish LILO after another OS has erased it, you can + boot from your Slackware install media and enter the setup + stage. Do not re-partition your drive or + re-install Slackware; skip immediately to . + + + + Even when using the "simple" option to install, LILO + should detect both operating systems and automatically configure + a sensible menu for you. If it fails, then add the entries + yourself. + + + + + + + + +
+ +
+ Dual Booting from Hard Drives + + + Dual booting between different physical hard drives is often + easier than with partitions since the computer's BIOS or EFI + almost invariably has a boot device chooser that allows you to + interrupt the boot process immediately after POST and choose what + drive should get priority. + + + + The snag key to enter the boot picker is different for each brand + of motherboard; consult the motherboard's manual or read the + splash screen to find out what your computer requires. Typical + keys are F1, F12, + DEL. For Apple computers, it is always the + Option (Alt) key. + + + + If you manage the boot priority via BIOS or EFI, then each boot + loader on each hard drive is only aware of its own drive and will + never interfere with one another. This is rather contrary to what + a boot loader is designed to do but can be a useful workaround + when dealing with proprietary operating systems which insist upon + being the only OS on the system, to the detriment of the user's + preference. + + + + If you don't have the luxury of having multiple internal hard + drives and don't feel comfortable juggling another partition and + OS on your computer, you might also consider using a bootable USB thumbdrive or even a + virtual machine to give you access to another OS. Both of these + options is outside the scope of this book, but they've commonplace + and might be the right choice for you, depending on your needs. + + +
+ +
diff --git a/chapter_16.xml b/chapter_16.xml index 484ede3..97a0fee 100644 --- a/chapter_16.xml +++ b/chapter_16.xml @@ -13,7 +13,7 @@ chapter is for you.
-Network Diagnostic Tools + Network Diagnostic Tools Slackware Linux includes a great many networking tools for @@ -158,7 +158,7 @@ every Linux, UNIX, and BSD distribution today makes use of OpenSSH, or commonly used network tools today and makes use of the strongest cryptographic techniques. ssh has many features, configuration options, and neat hacks, enough to fill its own -book, so we'll only go into the basics here. Simply run +book, so we'll only go into the basics here. Simply run ssh with the user name and the host and you'll be connected to it quickly and safely. If this is the first time you are connecting to this computer, ssh @@ -169,7 +169,8 @@ because it is possible that some one is attempting to hijack the connection using what is known as a man-in-the-middle attack. -darkstar:~# ssh alan@slackware.com + +darkstar:~# ssh alan@slackware.com alan@slackware.com's password: secret alan@slackware.com:~$ @@ -180,10 +181,13 @@ If you leave off the username part, ssh will use your current username when establishing the connection. + + +
-
-tcpdump +
+ tcpdump So far all the tools we've looked at have focused on making connections @@ -232,6 +236,9 @@ each one individually, telnet to each port you're interested in, and note every detail, but that's very tedious and time consuming. A much easier alternative is to use a port scanner, and nmap(1) is just the tool for the job. + + + nmap is capable of scanning TCP and UDP ports, determining the operating system of a network device, probing each located service to determine its specific type, and much much @@ -301,7 +308,7 @@ slackware.com mail is handled by 1 mail-mx.cwo.com.
-
+
dig @@ -353,7 +360,8 @@ In this case we looked for an "A" record which returned an IPv4 address.
-
finger +
+finger finger(1) isn't exactly a network diagnostic @@ -387,7 +395,7 @@ No Plan.
-Web Browsers + Web Browsers Slackware includes a variety of web browsers. If you're using a @@ -436,7 +444,8 @@ formats web pages better.
-
wget +
+ wget Unlike the other browsers we've looked at, @@ -477,7 +486,18 @@ Length: 75306 (74K)
Mail Clients -
pine + +Slackware also includes a variety of email clients. If you're using a +graphical desktop, you'll find Thunderbird, +Kmail, sylpheed +and others. As with web browsers, there are also applications that +function within the shell. Once you start using an email client in the +console, you may find yourself not wanting to use anything else; the +flexibility and configurability can be addicting. + + +
+pine pine is one of the oldest command-line @@ -494,7 +514,7 @@ pine-clone distributed with Slackware, was born. To start using alpine, simply type pine at the command line. Using it is very simple due to its menu-driven system as well as the -command referance neatly located at the bottom of the screen. See for +command reference neatly located at the bottom of the screen. See for yourself: @@ -524,6 +544,106 @@ Messages O OTHER CMDS > [ListFldrs] N NextCmd K KBLock + + Before configuring any mail client, you should check the + documentation of your mail server to gather all of the pertinent + information about what protocols and security measures your mail + service uses. This will help you configure + pine correctly. + + + + To start configuring pine, you should be + able to enter the [S]ettings menu, and then the [C]onfig + screen. There are about a hundred different options, but the most + common and most important ones would be your Personal Name, Inbox + Path, and SMTP Server. + + + + Pine Settings + + + + Personal Name + + + + The name you wish people to see in the "From" field of your + emails. + + + + + + + Inbox Path + + + + + Your mail server. The server itself is often something like + mail.example.com (although it may not be; check with your + host to be sure), but if that server requires login information then you + may need to set it to something like alan@mail.slackermedia.info + or similar. + + + + + + SMTP Server + + + The server through which you will send your email; often this + is smtp.example.com or outgoing.example.com or some variation + on that theme. It often requires authentication, but you + should be prompted for this in + pine when sending mail. + + + + + + + A sample configuration might look a little something like this: + + + + Sample Pine Configuration + + + + Personal Name + Alan Hicks + + + SMTP Server + smtp.lizella.net + + + Inbox Path + {imap.lizella.net/user=alan@lizella.net}inbox + + + Warn if Blank Subject + X + + + Sort Key: Arrival + X + + + +
+ + + And so on. Once you have it configured according to your mail + server's settings, you will be able to navigate the application from + the main menu. It's quite intuitive, with a persistent list of + keyboard shortcuts at the bottom of the screen. + +
@@ -535,7 +655,7 @@ want more control. Some people want a fully-configurable mail client with plugin support and a no-nonsense attitude. Those people use mutt(1). mutt isn't as user friendly as pine, but makes up -for it with power. You won't find the user-friendly command referance +for it with power. You won't find the user-friendly command reference at the bottom of the screen, mutt uses every last inch of real-estate for mail processing duty. It's feature support is extensive: threaded displays are no problem for the mighty @@ -562,14 +682,266 @@ for that, muttrc(5). You might want to read up on it. 3185 N Jan 11 Robby Workman (3.4K) └─> 3186 N Jan 12 SlackBuilds@cat (3.4K) └─> 3187 N Jan 11 Robby Workman (4.5K) └─> -3188 N Jan 12 Robby Workman (2.3K) [Slackbuilds-users] Unavailability of mai -3189 N Jan 13 Mr. B-o-B (3.7K) └─> -3190 N Jan 13 Josiah Boothby (3.2K) [Slackbuilds-users] Ted's Word Processor -3191 N Jan 14 Adam Swift (7.4K) [Slackbuilds-users] Web submission failur -3192 N Jan 14 Rob McGee (3.5K) └─> +3188 D Jan 12 Klaatu (3.5K) [Slackbuilds-users] LiVES updates +3189 N Jan 12 Robby Workman (2.3K) [Slackbuilds-users] Unavailability of mai +3190 N Jan 13 Mr. B-o-B (3.7K) └─> +3191 N Jan 13 Josiah Boothby (3.2K) [Slackbuilds-users] Ted's Word Processor +3192 N Jan 14 Adam Swift (7.4K) [Slackbuilds-users] Web submission failur +3193 N Jan 14 Rob McGee (3.5K) └─> -
+ + Using mutt is unique because it is by + nature a Mail User Agent (MUA), meaning its true purpose is to read + and sort email. This was its only job originally, although some + additional features such as retrieving mail via POP3 and even very + basic transfering messages via SMTP have snuck into the application. + + + + As is so often the case with robust console-based applications, the + configuration options are myriad, and there is no "right" or + "wrong" way of using mutt as long + as it does what you want it to do. Here is a simple example of a + system utilizing mutt, with a toolchain + consisting of: + + + + + + fetchmail to pull mail from your mail server + via POP3 + + + + + + procmail to sort the mail as needed. + + + + + + mutt to read, sort, and send email. + + + + + + formail to re-format your mail if needed + (depending on your mail server settings) + + + + + + fetchmail is a simple application that exists + only to pull mail from mail servers and copy those email messages to + your local hard drive. The configuration is fairly simple: + + + + darkstar:~$ 'poll pop.slackermedia.info with proto pop3: user +"klaatu@slackermedia.info" there has password "secretpassword" is klaatu +here and wants mds "/usr/bin/procmail"' >> ~/.fetchmailrc + + + +Fetchmail Configuration Explained + + + poll + + + Defines the mail server to check + + + + + + with proto + + + Defines the protocol used; in this case, POP3. + + + + + + user + + + Your email username. Sometimes this is just the string in front + of the @ at symbol, othertimes it is your whole email address. + Again, see your provider's documentation to find out what + you should be using. + + + + + + there has password + + + + Your email password. This is entered as plaintext into your + config file, but since this is in your home directory, it is only + readable by you. + + + + + + is username here + + + Defines which user on your local computer this email account + actually belongs to. For instance, if my email account is + notklaatu@slackermedia.info but my username on my Slackware box + is klaatu, then obviously there would be no way for + fetchmail to know who + notklaatu@slackermedia.info is. This defines it. + + + + + + and wants mda "/usr/bin/procmail" + + + + Tells fetchmail what application will + be sorting the email once it is pulled from the mail server. + Procmail ships with Slackware, so this + will probably not change for you and is not dependent upon your + mail server whatsoever. + + + + + + + Now that fetchmail is configured, it will successfully pull your + email from the server. But what will your computer do with all of + that mail? This is the job of procmail. + + + + The settings for procmail can be stored + in ~/.procmailrc and is also fairly simple; for example: + + + + PATH=/usr/bin + MAILDIR=$HOME/Mail + DEFAULT=$MAILDIR/Inbox + LOGFILE=$MAILDIR/logs + + + + Now procmail is configured, so your mail + will be sent to the right place. There is much more you can do with + procmail so feel free to investigate its + many filtering functions (or "recipes") later, once you have + everything working. + + + + At this point, your email will be pulled from the server by + fetchmail and sorted on your local system + by way of procmail. You need to + configure mutt so that it knows where to + find your email messages so that you can view them. + + + + Because mutt is such an extensible program, it's + a good idea to make a folder for its configuration file. Your + initial configuration will be frightfully simple, but if you ever + look for new configurations of mutt you might be happy to have a + whole folder to play around in. + + + + darkstar:~$ cat ~/.mutt/.muttrc + set realname="klaatu" + set from="notklaatu@slackermedia.info" + set spoolfile=/home/klaatu/Mail/Inbox + set mbox=/home/klaatu/Mail/mbox + set record=/home/klaatu/Mail/sent + set postponed=/home/klaatu/Mail/postponed + set sort=reverse-date + set editor=emacs + set smtp_url="smtp://notklaatu:secretpassword@smtp.slackermedia.info:465" + + + + In this sample configuration, the spoolfile + defines the incoming messages that you have not read yet (you + might recognize it as the end destination for + procmail), while mbox + defines where mail that you have read and responded to will be + stored. All other settings are self-explanatory, and all have been + drawn directly from the muttrc man page. + + + + + If your mail server delivers your email in a format that + mutt cannot understand, use the + formail mailbox converter, a part of the + procmail distribution. For example: + + + + darkstar:~$ formail -ds < ~/Mail/Inbox >> ~/Mail/Muttbox + + + + + + The commands used to navigate around in mutt are highly + customizable but the defaults can be listed by typing + ?. + + +
+ Adding SSL Support + + + If your mail server supports SSL then you can and should use SSL + for better security. Most graphical clients have common SSL + certificates built into them; mutt does + not but it's trivial to configure. + + + + Download an SSL trust certificate (the most common set is from + Thawte) and place it in your Mutt or Mail folder, and list it + as a certificate_file in your + .muttrc file. If your mail server is not using + Thawte, then they may be using either another SSL certificate + authority or they may be their own certificate authority, but + if an unknown certificate is encountered, + mutt will prompt you to accept it (or + not). If you do accept it, the certificate can be saved into + this certificate file. + + + + To obtain the Thawte certificate: + + + + bash$ wget + http://www.thawte.com/roots/thawte_Premium_Server_CA.pem -P + ~/Mail/ + + +
+ +
mailx @@ -708,7 +1080,8 @@ downloaded in source code or binary form via FTP, so knowing how to retrieve this information is a handy skill. -
ftp +
+ftp The simplest FTP client included with Slackware is named simply, @@ -753,7 +1126,8 @@ ftp> bye
-
ncftp +
+ncftp ncftp(1) (pronounced nick-f-t-p), is a more @@ -788,7 +1162,8 @@ ncftp ...ware/slackware-current > bye
-
lftp +
+lftp The last client we're going to look at is @@ -815,7 +1190,7 @@ lftp ftp.osuosl.org:/pub/slackware/slackware-current> bye
-
+
rsync -- cgit v1.2.3