LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Debian Configuration Post-Install (https://www.linuxquestions.org/questions/debian-26/debian-configuration-post-install-224547/)

Dead Parrot 10-13-2004 10:47 PM

It would be very nice indeed if all people knew how to use the "vi" text editor. http://www.cis.ksu.edu/~bhoward/vi/ But in Debian you don't actually need "vi" because the basic installation of Debian comes also with another text editor, "nano", that is even nicer than "vi" because it has in-built instructions how to use it. What would you do if you hadn't used computer for some time and had forgot the basic commands of "vi"? OK, you can always type "man vi" and spend some time re-learning "vi". But, if you're in a hurry, you just need to remember the name of that other text editor in Debian, "nano", and that is enough. "nano" itself tells you how to use it. :)

But if you get a fancy to install some flavour of *BSD, for instance, it's good to know how to edit files with "vi" because, unlike "nano", "vi" is available in ALL Unix-like systems. So, macondo's basic tutorial on how to edit files with "vi" is very useful indeed -- even if you prefer to use "nano" after all. ;)

darthtux 10-13-2004 11:03 PM

I use vi (or vim) every single day. It's so easy, especially when you do quick editing. It doesn't take very long to get used to and I don't have to open a gui window ;)

All you really have to know.
i - to insert text
o - to open a new line below the current one to insert text.
ESC - to get back to command mode
u - to undo
yy - to copy current line
yw - to copy current word
p - to paste after cursor
P - to paste before cursor
:w to save
:wq to save and exit
0 - to go to begnning of currenet line
$ - to go to end of current line
w - to go to next word
G - to go to end of file
1G - to go to first line in file.
ctrl+b - to bo back one screen
ctrl-f - to go forward one screen

It seems like it would be hard to learn but once you try, it is easy. And then later you learn that replacing text is much easier with a sed script :)

I work on a lot of servers where there is no gui and no nano, etc. So you HAVE to know vi. And it does pay to know ;)

macondo 10-14-2004 08:29 AM

Thank you Darthtux and Dead Parrot. That was pretty good, and yet nobody has explained Nano, which is used by many people, i just wanted to cover that so newbies could start somewhere

Let's say i want to edit a file:

#nano /etc/modules

once there, do i need to change modes? if so, what's the key combo?

once the file is edited, how do i get out of there, save and exit? That's all.

debian_dummy 10-14-2004 09:42 PM

2 or 3 things I would like tom see added to the Config post Install doco

"apt-get install nano" for an easy to use text editor

One thing that's missing (for me anyway) is automatic updating via cron of your Debian system a la Windows Update and then email the results of the process to another account. When installed to the hard disk Knoppix automatically does this but Debian Sarge doesn't.

"apt-get update" to refresh your packages list
"apt-get upgrade' to fetch and install new packages and security fixes

I don't know how to automate this process via a CRON job and I don't know how to send the results via email. There is thread here http://www.linuxquestions.org/questi...light=cron+apt that sort of shows how to apt-get via cron but no email notifications.

Anybody ?

darthtux 10-14-2004 10:10 PM

Quote:

Originally posted by macondo

Let's say i want to edit a file:

#nano /etc/modules

once there, do i need to change modes? if so, what's the key combo?

once the file is edited, how do i get out of there, save and exit? That's all.

Nano can be started with several options. A few are
-i autoindent
-c display cursor position at bottom of screen
-m enable mouse to select text

Nano doesn't have "modes" like vi.

Nano has its key combinations at the bottom of the screen. The ^ character stands for the control key. The most important is ^G which gives all the shorcuts and their meaning.

There are several Meta(Alt) key combinations which switch certain features on and off. To see them ^G.

To save ^O and save the file name and ^X to exit.

TLV 10-15-2004 01:48 AM

Quote:

Originally posted by debian_dummy
I don't know how to automate this process via a CRON job and I don't know how to send the results via email. There is thread here http://www.linuxquestions.org/questi...light=cron+apt that sort of shows how to apt-get via cron but no email notifications.

Anybody ?

I have a very simple backup script (basically I make a bzip2/tar-ball of some important directories that I specify) that I run weekly with cron. The script also notifies my user with an e-mail.

To get the script to run weekly (exactly what time and day doesn't matter for me) I simply place the script in /etc/cron.weekly/

The e-mail notification is in the script itself with the follwing command:

Code:

echo "blah blah blah" | mail -s "some subject" user_to_be_emailed
It shouldn't be too hard to make the updates work. Though I prefer the interactivity to select what I want to update (or not).

Hope this helps,
/TLV

macondo 10-15-2004 08:54 AM

"To save ^O and save the file name and ^X to exit."

OK, i edited a file, did:

Ctrl+O
Ctrl+X

the last command did not work, i finally closed it, and checked back and the changes were not implemented, what did i do wrong?

darthtux 10-15-2004 09:01 AM

When you do ^O look at the bottom of the screen. It says "File Name to Write:" . You have to name it and press ENTER. Or if you opened a file, it will put its name there and you just press ENTER. Then you press ^X. If you just pressed ^X, It said "Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES)". You have to press "Y" to get back to the File Name to Write:" to enter a file name.

macondo 10-15-2004 09:24 AM

Thanks a lot Darthtux, it worked like a charm! Learned one more thing today. :)

peeples 10-16-2004 04:31 PM

Automatic updates are accomplished via the cron-apt tool.

apt-get install cron-apt

Then read the man page. Default configuration is to download only, but you CAN change this to download and install.

HTH

axemanW 10-23-2004 10:24 AM

Wow! you guys have saved me hours of :study: and made this :newbie: install much easier. Answered a lot of :Pengy: I didn't even know I should ask!

macondo 10-23-2004 02:26 PM

Automatic Shutdown
 
This is a problem that has been bugging me for a couple of years. Every time i install a distro, i can't shut it down completely, it usually works half of the time, except with Libranet, it's the only distro that shuts it down completely ALL the time.

I've spent hours (literally) searching Google and forums all over the net, the debian-user-mailing lists in english, portuguese, spanish and italian, plus, the IRC debian channels, #linuxhelp, and every geek i casually meet. The problem is my motherboard, it's an Intel 440something and the BIOS is circa 1998, it has never been flashed, i bought this box (PII 266) second hand. I have tried everything under the sun and nothing. I have used different commands to shut it down:

shutdown -h now
poweroff
halt -p

different lines on the kernel stanza in the grub/menu.lst and /etc/modules:

apm=on apm=off
apm=power-off
apm power_off=1
noapic
acpi=off

At best it would shut down 70 percent of the time.

It would just give this message at the end:

Flushing IDE devices: hda hdb hdc hdd
Power down

until now...

I suspect there is a ton of people with the same problem out there, there is no guarantee this will work for you, it worked for me, i'm a happy camper. :D

It was accidental, really. Last weekend i was bored. I decided to wipe the my hard drive clean and install Sarge with pre-rc2 debian-installer, i was using sid at the time.

I inserted the cd and went thru every option they had, by pressing the Fn keys, looking at everything, something i had neglected before. I knew i did not want the 2.6 kernel on my decrepit box, i wanted to make a newbie installation just to see how the other half lives; so at the boot prompt, i ended up with:

linux noapic nolapic noframebuffer (i can't remember the full string for it)

and away i went, after installing

the basics,
apmd (new trick)
icewm

i tried to shut it down, with:

#shutdown -h now

and it shut down completely the first time, no less. I tried 6 times, and it never failed. Then i installed Blackbox, it shutdown too, perfect (5 times), it's been a week now, and it hasn't let me down.

I just wanted to share this, in case there is some people in the same boat.

Edit: a week later i reinstalled (surprise) and this time installed Sarge with the kernel 2.6, no problem, so now i use kernel 2.6.8 for the first time.




TLV 10-23-2004 04:50 PM

Re: Automatic Shutdown
 
Quote:

Originally posted by macondo
... nolapic ...
And I'm pretty sure this is the one that did it for you. "nolapic" stands for No Local Advanced Programmable Interrupt Controller. I used to have to add that parameter to my kernel to get my laptop to power down completely. These days I just do not compile "Local APIC support" into the kernel.

Not sure why it messed up the complete halt of a system.

/TLV

macondo 10-23-2004 07:18 PM

TLV said:

"And I'm pretty sure this is the one that did it for you."

Boy, i'm glad this is over.

BTW, today WindowMaker came out with its latest version 0.90.0

http://www.windowmaker.org/

Dead Parrot must be jumping up and down. :)

Dead Parrot 10-24-2004 12:19 AM

Quote:

Dead Parrot must be jumping up and down. :)
You can count on that. :D

Window Maker 0.91.0 is now in unstable. :)

To make fonts look good you need to turn on antialiasing in WPrefs.app (select "Smooth font edges").


All times are GMT -5. The time now is 07:56 PM.