vi, kedit, su

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
Post Reply
tundog
Linux User
Posts: 14
Joined: Wed Aug 13, 2003 12:16 am
Contact:

vi, kedit, su

Post by tundog »

kk, here's the problem (I'm new to KDE, but like it much better than GNOME)

I want to edit /etc/hosts

I tried using vi but that doesn't appear to come with the gentoox distro. So I tried using kedit, but the problem is that since my X envornment is running as user gentoox I can't save changes to the file. I could chmod, edit, then chmod back, but that's too much of a hassle. What I would like to do is :

su
kedit &

but when kedit loads it has all kinds of error messages about some sort of dcop server, blah, blah.

So I guess the big question is: What's the best way to edit 'root files' in the KDE environment?

Cheers,

tundog
Security - the 'new' freedom
Scocou
Novice
Posts: 44
Joined: Tue Aug 12, 2003 12:22 am
Location: British Columbia, Canada

Post by Scocou »

but when kedit loads it has all kinds of error messages about some sort of dcop server,
So long as it loads, you can ignore those DCOP error messages. Obviously if it fails to load, you can't ignore them heehe.
I tried using vi but that doesn't appear to come with the gentoox distro.
Everything (well, practically) comes with Gentoo, you might have to emerge it with Portage first, but I guarantee Gentoo has an ebuild for it, should vi be your preference. http://www.gentoo.org/doc/en/portage-user.xml for info on Portage.
What's the best way to edit 'root files' in the KDE environment
I typically su to root from an xterm (or konsole in KDE'ese), then use Gnu nano to edit the files. If not using X, console nano is even more the best! ;) It's the default text editor for Gentoo, but also my favorite so I'm biased. Nano is a Pico clone IIRC, the (Unix) Pine mailer's stand-alone editor. It's very easy to use, but feature rich as well, including spell-check, search, etc.. Make sure to start it with nano -w filename if you don't want word-wrap to bork (by justifying) your configs ;)
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

You could just type "sudo kedit" to launch kedit with root permissions.
tundog
Linux User
Posts: 14
Joined: Wed Aug 13, 2003 12:16 am
Contact:

Post by tundog »

Everything (well, practically) comes with Gentoo, you might have to emerge it with Portage first
Holy auto-updates batman! I just started palying around with portage and its some pretty powerful stuff. Funny really, considering its a core element of Gentoo and I didn't know about it. But that's the reason I wanted to try out gentoo, to find new stuff.

I'll check out nano for quick edits and use sudo to lauch kedit for others. Thanks for the 411.
Make sure to start it with nano -w filename if you don't want word-wrap to bork (by justifying) your configs
Speaking of 'borking' word-wrap, how do i fix the 'borked' word-wrap on the man pages?
Security - the 'new' freedom
Scocou
Novice
Posts: 44
Joined: Tue Aug 12, 2003 12:22 am
Location: British Columbia, Canada

Post by Scocou »

Speaking of 'borking' word-wrap, how do i fix the 'borked' word-wrap on the man pages?
It's not quite clear (to me) what you're asking... are you reading man-pages with nano? Please explain :)
tundog
Linux User
Posts: 14
Joined: Wed Aug 13, 2003 12:16 am
Contact:

Post by tundog »

Whenever i invoke any man page (e.g. man ls), the line lengths are off somehow. The last two characters of every line wrap onto the next line which only prints those last two characters before starting a new line.

It looks like this:

<tab>blah, blah, blah, blah, blah, blah, blah, blah, blah, bla
h,
<tab>blah, blah, blah, blah, blah, blah, blah, blah, blah, bla
h,
<tab>blah, blah, blah, blah, blah, blah, blah, blah, blah, bla
h,


Any ideas?
Security - the 'new' freedom
padawan
Novice
Posts: 22
Joined: Sun Jan 25, 2004 10:36 pm

Post by padawan »

Boohoo, So i'm a total newb when it comes to this :oops:

i got gentoox home up and running, i can telnet to it from my pc, i can go with the xbox on the internet (defined the proxy in firebird's preferences), i can vnc to it, samba works too.

but i wanted to install apache on it. i did emerge apache as su, but then the message about the profile came up. i did a search on the forum and found out that i had to sync first. but here comes my problem. i want the xbox to connect through my pc to get the files, so i wanted to add
to /etc/make.conf. So I opened it with kedit (under kde) but after the changes i couldn't save :cry:

so i thought it had to be sth with the rights. now i tried it with nano, but couldn't figure it out how to use. and sudo kedit also didnt work (when i ran it with sudo kedit there were a thousand errors and then i couldnt switch dirs).

so please help me and post a small tutorial for me how i can edit that file :|

Thanx a lot :D
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

Code: Select all

su -
<enter your root password>
nano -w /etc/make.conf
make you changes to the file then hit ctrl+x then y then enter
you could also use echo to add the lines to the end of the file

Code: Select all

su -
<enter your root password>
echo HTTP_PROXY=\"http://192.168.1.1:6588\" >> /etc/make.conf
echo FTP_PROXY=\"http://192.168.1.1:21\" >> /etc/make.conf
I'm not sure if this will let you emerge sync as it uses rsync not http or ftp you may need to download a portage snapshot and untar it
If you keep an open mind, will your brain fall out?
padawan
Novice
Posts: 22
Joined: Sun Jan 25, 2004 10:36 pm

Post by padawan »

Thanx a lot for your answer, will try it out as soon as i am back from work :P

In the readme of the "normal" gentoo distribution i read that it is also somehow possible to run sync with sth like "emerge webrsync". To my understanding it will then go over http?! Is this also possible with Gentoox ? Well, if that method fails i'm gonna try it like that, and otherwise i'll untar the file... (i fear the next newb questions coming up :lol: )

Thank you again.
nobspangle
Gentoox Guru!
Posts: 1681
Joined: Sun Sep 28, 2003 11:59 am
Location: Manchester, UK

Post by nobspangle »

you can make rsync use your http proxy by adding a line to /etc/make.conf that says
RSYNC_PROXY="address and port of my http proxy"
then just use the normal emerge sync
if that doesn't work you can use the emerge-webrsync command which uses wget to fetch the files over http
If you keep an open mind, will your brain fall out?
padawan
Novice
Posts: 22
Joined: Sun Jan 25, 2004 10:36 pm

Post by padawan »

Unfortunately the install over the web or per rsync still didn't work :cry:
Gonna try to extract the snapshop then... after i figured out how to configure samba properly :lol:
padawan
Novice
Posts: 22
Joined: Sun Jan 25, 2004 10:36 pm

Post by padawan »

okay i just d/l-ed the snapshot file directly on the xbox with konqueror and extracted it to /usr. unfortunately after running emerge apache emerge wants to d/l httpd-2.0.48.tar.gz, which it can't bcz i don't know to to configure properly :(

I added the HTTP_PROXY and FTP_PROXY (RSYNC too) settings to the make.conf file and also wrote them proxie into the Configure Panel... but it still says aborting bcz it couldn't d/l the file when trying to.

I'm almost sure it is sth simple but with my little (to none) linux knowledge i can't figure out how to do it .
Post Reply