Sunday, September 13, 2009

Configuration and Tweaking

It is certainly nice that Slackware is up and running, but I need Internet. I'm sure I'll also find other things to tweak on the way. The first project, though, is to create a new user so I'm not running as root.

adduser me (well, choose an appropriate username unless you really want a user named 'me') is the command to create a new user. There was a brief series of questions, to which I pressed enter each time. Enter a new password, and it's done.

Then to switch users, type logout

Sign in as the new user so that it's harder for you (and the other creatures in your home) to mess things up.

Now my command prompt says me@paperweight:~$. Well, 'paperweight' was a nickname the new computer got when I wasn't sure I could fix it. But it's time it got a promotion, so I need to change the computer's name. For that, the command netconfig would do it. Except that I've signed out as root, which means it won't work. Much more secure, and not that hard to get around, if you have the root password.

So do I log out and log back in as root? Nah. I get the impression that I'll never have reason to log in as root again. No, I'm just going to give my username the powers of root for a period of time.

I type su and press enter, the system asks for a password. It wants root's password. Feed it what it wants.

My command prompt looks like root@paperweight:/home/me# so I now have the authority of root. Easy enough. Why not just use this mode to issue the netconfig command? Because after I run the command, I'll still have the power of root until I exit this mode. I don't feel like remembering to exit after using su to issue one command.

su -c is the command I'm looking for. the -c tells it that anything I type after it is the command to be run under root's powers. It will do so, then cancel my root authorization. Power, without having to remember to exit.

And I'm done pretending to be root.

exit

Back to changing my computer's name.

su -c netconfig (then follow the prompts like a good little monkey.)

su -c reboot restarts the system. After logging in, my command prompt says, me@penguin:~$.

I noticed during reboot that my system defaults to booting Windows. This must be remedied.

su -c "cp /etc/lilo.conf /etc/lilo.conf.back" (creates a back up copy of lilo.conf. The quotes tell su that the whole thing in the quotes is a command)

Next up is to use vi, which I find to be the most ridiculous text editor ever dreamt of when compared to the simplicity of Windows' notepad. But I do remember the keyboard template required for WordPerfect once upon a time, so I'm not going to complain too loudly. Nonetheless, counterintuitive is the nicest name for vi, from a newbie's point of view.

Imagine having to create a text editor that runs in text-only mode, without a mouse, without ALT or F1-F12, and oh, forget the home, pg up, pg down, end, insert, delete, and the arrow keys. Oh, and you don't get any screen space for a listing of common commands. Got that?

Now, how exactly are you going to get up and down one character/line/paragraph? To the beginning or end of a line or document? Toggle between insert and overwrite modes? Search? Cut? Paste? Save? Quit? Print? The adventurous can look here for the answer.

Truth is, vi will nearly do your laundry if you're willing to learn a hundred or so commands. Someone well-versed in vi would be able to make massive editing changes to a document much faster than a knowledgeable Word user could. And I'm pretty sure there are things that vi can do that Word won't, though probably Word would have little reason to. All that said, vi has the ability to be awesome, but to the uninformed newbie it's a nightmare.

Why then do people still rely upon a program designed to cope with such limitations when we no longer have those limitations? Yeah, don't know. I have figured out, though, that modern versions of vi (well, vim, really) can cope with the delete and arrow keys, so that's a plus.

One more question: Why would you be reading through a Slackware configuration walkthrough if you're not up for gaining a passing knowledge of vi? Those with weaker constitutions can usually use pico in place of vi. Just type pico file instead of vi file.

Back to changing LILO's settings...

su -c "vi /etc/lilo.conf" (lets me into the LILO configuration file)

On the line after boot = /dev/sda I added default = Linux (Sets Linux to start by default)

I changed timeout = 1200 to timeout = 50 (so it only waits five seconds for me to select something before loading the default)

[esc]:wq (saves the file and gets me back to the command prompt)

su -c /sbin/lilo (tells the computer to apply the new configuration file, I assume)

su -c /sbin/reboot (not necessary; just checking to see that it worked)

Brilliant.

Five seconds of splash screen, then Slackware starts up. Makes my whining about penguins on the splash screen moot, though, because I'll almost never see said splash screen (and when I do, it won't be for long). Maybe I can get some ASCII art to greet me when I login.

No comments: