A few simple questions(...if you don't mind)

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Jul 5 13:58:33 PDT 2004


On 2004-07-05 09:23, Mark Jayson Alvarez <jay2xra at yahoo.com> wrote:
>
> 1. What is the command for ejecting the cdrom?

	# cdcontrol -f /dev/acd0 eject

The `cdcontrol' command works fine with my ATAPI CD-ROMs.  I haven't
used it with SCSI CD-ROM devices, but AFAIK it works for those too.

> 2. Do you know if viruses exist in freebsd, like in Windows?

None, at all.

This does not imply that there are no problems regarding the security of
a BSD system, ever, at all...  At times, there are bugs and security
problems with programs that can be run on a BSD system too.  None of
that crap with virii taking over unsuspecting users' home machines and
launching attacks on random IP blocks on the Internet causing all sorts
of havoc and disturbance to the world though.

> 3. When I issued a netstat command, and i see something like
> 192.135.15... connected to 192.262.33..., what is the command for
> terminating such connections?

Netstat is fine, but I usually prefer sockstat when I'm sitting in front
of a BSD shell.  The output is more informative when one cares to know
exactly this sort of thing (which process has opened which connection):

: giorgos at gothmog:~$ sockstat -4
: USER   COMMAND   PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
: ncvs   cvsup     4664  4  tcp4   212.205.215.15:63581  195.130.121.201:5999
: root   sendmail  3721  4  tcp4   127.0.0.1:25          *:*
: root   named     1738  4  udp4   *:61077               *:*
: root   named     1738  20 udp4   127.0.0.1:53          *:*
: root   named     1738  21 tcp4   127.0.0.1:53          *:*
: giorgos at gothmog:~$

Kill the PID that has opened the connection and off it goes.

> 4. When I issued a "alias ls ls -FGh" how can I make this alias for
> 'ls' permanent? And where are the individual manpages for those
> built-in commands located?

Aliases are a shell-dependant feature.  The default shells that are part
of teh FreeBSD base system have the following ways to define aliases:

  1. Interactively:

     As you type commands in your /bin/sh prompt, try this:

          $ alias ls='/bin/ls -FGh'

     In tcsh, the '=' sign is not necessary but pay very careful
     attention to the quoting of special characters, because tcsh(1) is
     picky:

          % alias ls /bin/ls -FGh

  2. In startup files

     Whatever you type in the command line can be stored in a shell
     startup script, making it effectively persistent across login
     sessions.  Each shell has its own startup files; sh(1) uses
     `.profile' and `.shrc', while tcsh(1) reads `.tcshrc', `.login',
     and `.logout'.

> 5. Does any version of freebsd supports mounting, reading, and writing
> of ext3fs partitions of linux?

Journaling metadata isn't supported AFAIK by any version of FreeBSD.
If the filesystem hasn't been mkfs'ed to use some of the special,
unportable to other systems, Linux-specific features of ext3, you
might get away with mounting it as ext2.

> 6. Can freebsd turn off my monitor or any other peripherals of my pc
> in a given idle time, like the "stand by" in Windows? How?(just the
> link)

Read about xset(1) in XFree86.  Especially the sections about `dpms'.
This should work while you're using a GUI.

For the console, you'd have to enable the screen saver support and set
> your screen saver to `green_saver'.  This will turn the monitor off
> instead of drawing pretty ascii-art pictures on it :-)

> 7. What is the correct way of rebuilding my ports? In freebsd sources,
> I do a make buildworld and then make installworld. How do I do it in
> my ports collection?  (e.g; make buildports, make installports??? :-)

I use "metaports", i.e. ports that I have written which depend on all
the ports I regularly use.  This is a sort of hackish way to update your
ports, but I usually update my installed ports only when there is a
security problem with one of them.  Which is a lot less often than the
updates I do to the base system with CVSup, buildworld, etc.

A lot of people like `portupgrade' for keeping their ports up to date.
It's available in the ports and there are dozens of tutorials online
that explain how it works.  A quick google search yields:

	http://www.oreillynet.com/pub/ct/15
	http://www.silbsd.org/cvsup_instructions2.html
	http://librenix.com/?inode=3380

HTH,
Giorgos



More information about the freebsd-questions mailing list