Re: Creating freebsd usb boot

2013-07-25 Thread Giorgos Keramidas
On Thu, 25 Jul 2013 12:01:10 +0300, Erhan Gulsen erhangulse...@gmail.com 
wrote:
 Hi,
 I am Erhan,i have a problem,i read your all definition but i can not
 create usb boot FreeBSD,i have a ubuntu 12.04 operating system.I want to
 create it with FreeBSD-9.1-RELEASE-amd64-disc1.iso but when i try
 this,it shows ''boot error''.Can you help me?

This is a CD-ROM image.  Please try again using the 'memstick' image
instead, whicih should be available in the same place you for the ISO
image for the CD-based installation and have a name like this:

FreeBSD-9.1-RELEASE-amd64-memstick.img

This should be bootable if you copy it directly to a USB stick with at
least 733 MB of disk space.  You can use plain dd(1) from your Ubuntu
installation to do that:

sudo dd if=FreeBSD-9.1-RELEASE-amd64-memstick.img of=/dev/sdc

Just replace /dev/sdc with the name of your USB stick's device.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Bill Paul's network drivers

2013-07-19 Thread Giorgos Keramidas
On Wed, 17 Jul 2013 13:28:39 -0300, Michel Behr michelb...@gmail.com wrote:
 Hi

 I'm considering learning how to build drivers, so I can make my Lenovo S400
 wireless card get detected by FreeBSD.

 The Architecture Handbook cites these Bill Paul's network drivers.

 9.5 Network Drivers: Drivers for network devices do not use device nodes in
 order to be accessed. Their selection is based on other decisions made
 inside the kernel and instead of calling open(), use of a network device is
 generally introduced by using the system call socket(2).

 For more information see ifnet(9), the source of the loopback device, and
 Bill Paul's network drivers.

 Where can I find those Bill Paul's network drivers?

All network drivers are part of the kernel sources.  You should have
them in your /usr/src/sys directory.

Having said that, the networking stack is a large piece of software,
with many parts and interactions between them.  If you are planning to
get into that sort of development, you should probably consider reading
a _book_ about how things work.

Two excellent books about drivers and networking are:

FreeBSD Device Drivers
by Joseph Kong (Stark Press)

The Design and Implementation of the FreeBSD Operating System
by Marshall Kirk Mc Kusick  George V. Neville-Neil
(Addison-Wesley)


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: OT: rsync on Mac OSX

2013-07-02 Thread Giorgos Keramidas
On Tue, 2 Jul 2013 13:35:00 -0700, Chris Maness ch...@chrismaness.com wrote:
 I have been using rsync with Mac OSX with no issues until today.  I
 generally use it instead of the copy command because if the copy fails
 on large files, I can pick up where I left off.  I have backed up
 entire Final Cut Pro projects this way with no issues.  However, I
 recently synced a drive to a folder in another drive, and the OS does
 not recognize the final rendered files as quicktime files.  The files
 work fine in the parent drive.  I have no idea what might be going on.
 I used the flags: rsync -vaur like I always do.  Any suggestions?

This is a FreeBSD list, so any issues rsync may have with MacOS X are
not very relevant to what FreeBSD is doing or would do.  Having said
that though, can you try without the -u option?  Maybe modification
times are newer on the target drive and rsync skips everything.

You should probably also enable --stats and have a look at the final
report of rsync, to see if it actually sync'ed any files, or skipped all
of them because of mtime checks.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: OT: rsync on Mac OSX

2013-07-02 Thread Giorgos Keramidas
On Tue, 2 Jul 2013 14:48:03 -0700, Chris Maness ch...@chrismaness.com wrote:
On Tue, Jul 2, 2013 at 2:30 PM, Giorgos Keramidas 
keram...@ceid.upatras.grwrote:
On Tue, 2 Jul 2013 13:35:00 -0700, Chris Maness ch...@chrismaness.com wrote:
 I have been using rsync with Mac OSX with no issues until today.  I
 generally use it instead of the copy command because if the copy fails
 on large files, I can pick up where I left off.  I have backed up
 entire Final Cut Pro projects this way with no issues.  However, I
 recently synced a drive to a folder in another drive, and the OS does
 not recognize the final rendered files as quicktime files.  The files
 work fine in the parent drive.  I have no idea what might be going on.
 I used the flags: rsync -vaur like I always do.  Any suggestions?

 This is a FreeBSD list, so any issues rsync may have with MacOS X are
 not very relevant to what FreeBSD is doing or would do.  Having said
 that though, can you try without the -u option?  Maybe modification
 times are newer on the target drive and rsync skips everything.

 You should probably also enable --stats and have a look at the final
 report of rsync, to see if it actually sync'ed any files, or skipped all
 of them because of mtime checks.

 Yep, the files copied, and I used touch to force them to recopy.
  However, the files that were copied are not recognizable by their native
 aps.  Just big junk files.  I have no clue what happened.  I am just
 copying everything by a simple cut and paste this time.  However, this
 directory is HUGE and I won't know until about 18 hours from now.

Since you are going to wait anyway, why don't you try peeking at some of
the file checksums while this is running?

MacOS X comes with a shasum utility which implements SHA-256 checksums,
so you should be able to look at a few random samples of these files,
e.g. by running on the source disk:

shasum -a 256 source_directory/file/path/to/some/file.ext

shasum -a 256 copied_directory/file/path/to/some/file.ext

If these are the same, then the applications look elsewhere, e.g. in the
'hidden' .DS_Store stuff some MacOS directories contain.

But if the checksums are different, well, then there's your problem.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FFMpeg and FreeBSD

2013-06-28 Thread Giorgos Keramidas
On Thu, 27 Jun 2013 12:25:19 +0930, Shane Ambler free...@shaneware.biz wrote:
 On 27/06/2013 09:57, Simon wrote:
 Hello Everyone,

 Does anyone use the latest FFMpeg version 1.2 and FreeBSD?

 How did you compile it? did you run into any issues?

 The FFMpeg port is 6+ months behind and I feel like I'm the only one who uses
 this which would be very odd given everything uses video nowadays.

 You need to look a little closer. We have three versions available in
 ports -

 multimedia/ffmpeg which is at 0.7.15
 multimedia/ffmpeg1 which is at 1.2.1 - updated 2 days ago
 multimedia/ffmpeg-devel which is an svn snapshot at 2012.10.13

 You will find a lot of ports are still configured to use 0.7.15.

 The main catch is the ports are designed to co-exist so ffmpeg1 has the
 trailing 1 added to all the lib/cli names.

 I have had no problems using ffmpeg1 with my version of blender for
 several months now. It has a cmake option for lib names and then I
 added include/ffmpeg1 to C/CXXFLAGS and lib/ffmpeg1 to LDFLAGS.

Hi Shane,

This should probably be in the multimedi chapter of the Handbook or the
FAQ, or in the UPDATING file of the ports.  Would you mind if I copied
parts of the text and added them to e.g the FAQ?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ZFS on MBR does not boot at all

2013-05-09 Thread Giorgos Keramidas
On Sun, 05 May 2013 17:56:49 -0500, Joshua Isom jri...@gmail.com wrote:
 On 5/5/2013 3:20 PM, Giorgos Keramidas wrote:
 Hi David,

 Thanks for following up with what the real problem was.  I updated the
 Wiki to include this:

  Note that partition order is important. It seems that zfsboot
  requires the freebsd-zfs partition to be the first, so make sure you
  add if first, before your swap partition.

 Cheers,
 Giorgos

 What?  I've been using this set up for years.

 =   34  976773101  ada1  GPT  (465G)
  34128 1  freebsd-boot  (64k)
 1628388608 2  freebsd-swap  (4.0G)
 8388770  968384365 3  freebsd-zfs  (461G)

 =   34  976773101  ada2  GPT  (465G)
  34128 1  freebsd-boot  (64k)
 1628388608 2  freebsd-swap  (4.0G)
 8388770  968384365 3  freebsd-zfs  (461G)

That's ok for GPT partitions.  The original post was about an MBR
partition table.

Some modern laptops (mine is one) do not boot successfully from a disk
with a GPT partition scheme, unless the boot loader is EFI-capable
(which ours isn't).  So you have to use an MBR-style partition table.

In those cases the note is still useful to see.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ZFS on MBR does not boot at all

2013-05-05 Thread Giorgos Keramidas
On Mon, 29 Apr 2013 13:29:18 +0200, David Demelier demelier.da...@gmail.com 
wrote:
 2013/4/18 David Demelier demelier.da...@gmail.com:
 Hello,
 I would like to use ZFS over MBR for multiboot purposes. I've followed
 that guide https://wiki.freebsd.org/RootOnZFS/ZFSBootPartition but it
 does not boot at all. The loader does not show up after choosing
 FreeBSD in the boot0 loader.

 The _ prompt appears but nothing starts. I've found many people over
 the web having the same problem but unfortunately no one found a
 solution.

 I think the offensive commands are ones with dd and zfsboot.
 Regards,

 So someone told me on IRC that the main problem was that I've put my
 partition swap as first partition in the FreeBSD slice and zfsboot
 *requires* that the zfs partition is the first.

 Can someone with right access to the wiki page may add a notice about
 this issue on https://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
 please?

Hi David,

Thanks for following up with what the real problem was.  I updated the
Wiki to include this:

Note that partition order is important. It seems that zfsboot
requires the freebsd-zfs partition to be the first, so make sure you
add if first, before your swap partition.

Cheers,
Giorgos



pgpAGlS_lM5GA.pgp
Description: PGP signature


Re: svn new pkg system

2013-03-10 Thread Giorgos Keramidas
On 2013-03-09 22:04, Robert Huff roberth...@rcn.com wrote:
 Giorgos Keramidas writes:
Is svn going to become part of the base system in 9.2-RELEASE?
   
   No.
 
 [good reasons for not including subversion ellided]
 
 On the other hand ...

 The traditional - and I believe still canonical - way of updating the
 system is to recompile from source.

 I know I am not alone in feeling the system is substantially
 incomplete if it does not come with all the tools necessary to do
 that.

 (Not slighting freebsd-update (don't know enough about it to have an
 opinion); just pointing out it has limitations.)

This has been traditionally true with CVS, which was also a complex
piece of software, but still merged periodically into FreeBSD src.

I think it's always a small annoyance when things break away from
'tradition', but on the other hand tradition shouldn't be able to put
a stop to moving along or act as an impediment for doing our 'real'
work.  And the real work of the team is to develop FreeBSD, not to
develop a version control system.  There's a lot of know-how and
development happening in the main Subversion development process;
a lof of experience that we do not necessarily need to duplicate
in our own team to do what we like best: that is, develop FreeBSD.

It's understandable that having to install a package to check-out
the sources is a diversion from previous practice, and it may be
somewhat annoying -- like every change is annoying at first.  But
the package is not going to go away and it won't stop working, at
least as long as we are using it ourselves to develop the system.

So other than the difference that now the sources of the VCS used
for development are not part of src/, conceptually there isn't a
lot of difference from before.  The previous state of things was:

FreeBSD developers use CVS to check out the sources, and
develop the system itself.  CVS is available [as part of the
base system] to everyone else who wants to grab a copy of
the source tree.

WHat happens now is quite similar, except for the bracketed text:

FreeBSD developers use SVN to check out the sources, and
develop the system itself.  SVN is available [as part of the
official packages] to everyone else who wants to grab a copy of
the source tree.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: svn new pkg system

2013-03-10 Thread Giorgos Keramidas
On Sun, 10 Mar 2013 13:39:50 -0400, Fbsd8 fb...@a1poweruser.com wrote:
 Steve O'Hara-Smith wrote:
 On Sun, 10 Mar 2013 13:18:04 -0400
 Fbsd8 fb...@a1poweruser.com wrote:

 No body has made a case for NOT including svn in the base system. If
 it can be a port there is no reason why it can not be included in the
 base system.

 Giorgos did when he said Subversion is a large system, with a ton of
 dependencies which translates to a lot of work to keep it up to date
 in the base system, and all sorts of fun and games when other things
 using those dependencies need a newer version.

 And how is that any different from any other package or pkgng situation.

Imagine what happens when library libfoo is a dependency of subversion,
and they are both imported into the base system.  At the same time there
are 2-3 incompatible versions of libfoo in the ports.

When libfoo is part of the base system we have to:

  a) Make sure that it works for the base system version of subversion.

  b) Other programs from ports do not accidentally link with the wrong
  version of the library from base.

  c) All programs that subversion uses (possibly plugins and extensions
 that are now part of base, but part of the packages) use the right
 'mix' of libraries.

This gets fairly complicated and a brittle _very_ very fast.

On the other hand, the inconvenience of having to install subversion
from ports is offset by the fact that _everything_ it depends on and
everything that depends on _subversion_ itself, is now handled in an
homogeneous manner, with exactly the same amount of effort that we would
have to spend anyway to maintain it in the ports.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: backups using rsync

2013-03-09 Thread Giorgos Keramidas
On Tue, 05 Mar 2013 20:30:22 +0100, Matthias Petermann matth...@d2ux.org 
wrote:
 Hello,
 Zitat von Giorgos Keramidas keram...@ceid.upatras.gr:

 If this is a UFS2 filesystem, it may be a good idea to snapshot the
 filesystem, and then rsync-backup the snapshot instead.

 Last time I tried UFS2 snapshots I found out two serious limitations.
 The first is it doesn't work when UFS Journaling is used. The second is
 that taking a snapshop on a large filesystem can cause parts of the
 system to freeze for many minutes up to hours when accessing files
 part of the snapshot, depending on the size of the filesystem.
 That's why I could not use it on my server with  1TB UFS2.

 Did this improve in the last year? (I guess my experience is from the
 time around 9.0 release).

Hi Matthias,

Unfortunately I don't know if snapshots for such large filesystems are
faster now.  I've only used UFS2 snapshots in about 10x times smaller
filesystems here.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: svn new pkg system

2013-03-09 Thread Giorgos Keramidas
On Sat, 09 Mar 2013 18:25:22 -0500, Fbsd8 fb...@a1poweruser.com wrote:
 Is svn going to become part of the base system in 9.2-RELEASE?

No.

Subversion is a large system, with a ton of dependencies, and there's
basically _nothing_ to gain by having to spend extra effort trying to
keep an imported version up to date.

Having svn-X.0 in the source tree, imported at great expense of time and
effort, will provide exactly _zero_ benefits if the underlying format of
the repository changes (like subversion likes doing really often).

On the other hand, installing subversion from the ports or even from the
precompiled packages is always going to work, and we're always going to
have a port for it as long as it's a tool that's required to work with
the source tree of the system.

 Is the new pkg system going to totally replace the pkg_ system in the
 base 9.2-Release?

I think so.  But I have to check to be sure.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Zlib version in FreeBSD - 3 releases behind?

2013-03-06 Thread Giorgos Keramidas
On 2013-03-06 08:06, Arthur Chance free...@qeng-ho.org wrote:
 On 03/05/13 16:12, Giorgos Keramidas wrote:
 On 2013-03-04 07:28, KrisUniverse kris.unive...@gmail.com wrote:
 The Zlib baked into FreeBSD is Zlib 1.2.4 even on 9.1R.
 
 However, Zlib has gone to 1.2.7 sometime ago after stepping through
 1.2.5, 1.2.6 and 1.2.7 with bug fixes.
 
 Is there any reason for not using Zlib 1.2.7?
 
 I don't have a 9.1-RELEASE system nearby, but I think zlib 1.2.7 _should_
 already be there...  Are you sure it's still an old version?
 
 On my machine:
 
 # uname -r
 9.1-RELEASE
 
 [It's actually -p1 but I've not bothered replacing the kernel as the
 problems were in user space.]
 
 # grep 'define ZLIB_VERSION' /usr/src/lib/libz/zlib.h
 #define ZLIB_VERSION 1.2.7

That's what I'd expect.  Thanks :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: backups using rsync

2013-03-05 Thread Giorgos Keramidas
On 2013-03-04 03:35, Ronald F. Guilmette r...@tristatelogic.com wrote:
 As a result of this past Black Friday weekend, I now enjoy a true
 abundance of disk space, for the first time in my life.
 
 I wanna make a full backup, on a weekly basis, of my main system's
 shiny new 1TB drive onto another 1TB drive that I also picked up cheap
 back on Black Friday.
 
 I've been planning to set this up for some long time now, but I've
 only gotten 'round to working on it now.
 
 Now, unfortunately, I have just been bitten by the evil... and
 apparently widely known (except to me)... ``You can't use dump(8) to
 dump a journaled filesystem with soft updates'' bug-a-boo.

 Sigh.  The best laid plans of mice and men...
 
 I _had_ planned on using dump/restore and making backups from live mounted
 filesystems while the system was running.  But I really don't want to have
 to take the system down to single-user mode every week for a few hours while
 I'm making my disk-to-disk backup.  So now I'm looking at doing the backups
 using rsync.

Yes, this should be possible...

One thing that can bite you when using rsync to traverse  copy large
filesystems is that the filesystem may still be changing beneath rsync
*as it's doing* the copy.

If this is a UFS2 filesystem, it may be a good idea to snapshot the
filesystem, and then rsync-backup the snapshot instead.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: backspace shows ^? in serial communication

2013-02-28 Thread Giorgos Keramidas
On 2013-02-26 23:40, s m sperado_n...@yahoo.com wrote:
 hello all,

 i have problem with backspace in freebsd 8.2. when i run a serial
 program to communicate via a serial port to the other system,
 backspace shows ^? in opened terminal.  i use termios and fcntl to
 open, read, write and close serial port. i set erase and erase2 for
 ttyu2(my serial port) but backspace shows ^? yet.

 any body knows what i'm doing wrong? just erase and erase2 should be
 set to backspace works correctly or any other options should be set?

Just run:

stty erase '^?'

in your serial console terminal.  The backspace key sends ^? so you are
seeing it because it's not mapped to 'erase'.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Fun Scripting Problem

2013-02-15 Thread Giorgos Keramidas
On 2013-02-13 12:27, Tim Daneliuk tun...@tundraware.com wrote:
 I know how to do this in Python, but I really want to do it in
 straight Bourne shell.  I have some ideas, but I thought I'd
 give you folks a crack at this Big Fun:

 a)  You have a directory of files - say they're logs - generated
 at nondeterministic intervals.  You may get more than one a day,
 more than one a month, none, or hundreds.

 b) To conserve space, you want to keep the last file generated
in any given month (the archive goes back for an unspecified
number of years), and delete all the files generated prior to
that last file in that same month.

 c) Bonus points if the problem is solved generally for either files
or directories generated as described above.

 These are not actually logs, and no, I don't think logrotate can
 do this ... or can it?

You can try using stat/date to print the month in which each file was
modified, e.g:

freefall:/home/keramida$ stat -f '%m %N' prs.tar.bz2
1359910210 prs.tar.bz2

freefall:/home/keramida$ date -f '%s' -j '1359910210' '+%Y-%m'
2013-02

Having the mtime of the file in seconds since the epoch (1359910210)
should be easy to sort through, e.g. you can find the last modification
time with a 'sort -n | tail -1' pipe:

freefall:/home/keramida/w/doc-head/el_GR.ISO8859-7/share$ touch 
xml/glossary.ent

freefall:/home/keramida/w/doc-head/el_GR.ISO8859-7/share$ find xml -exec 
stat -f '%m %N' {} +
1360060289 xml
1360060288 xml/navibar.l10n.ent
1360060288 xml/trademarks.ent
1360060288 xml/libcommon.xsl
1360060288 xml/header.l10n.ent
 = 1360942284 xml/glossary.ent
1360060289 xml/freebsd.dsl
1360060289 xml/teams.ent
1360060289 xml/freebsd.ent
1360060289 xml/l10n.ent
1360060289 xml/mailing-lists.ent
1360060289 xml/newsgroups.ent
1360060289 xml/translators.ent
1360060289 xml/catalog.xml
1360060289 xml/entities.ent
1360060289 xml/catalog
1360060289 xml/urls.ent

freefall:/home/keramida/w/doc-head/el_GR.ISO8859-7/share$ find xml -exec 
stat -f '%m %N' {} + | sort -n | tail -1
1360942284 xml/glossary.ent

Then you can convert the epoch-based times to '%Y-%m' timestamps in a
loop, e.g.:

freefall:/home/keramida/w/doc-head/el_GR.ISO8859-7/share$ find xml \
 -exec stat -f '%m %N' {} + | while read mtime fname ; do
 echo ${mtime} $( date -f '%s' -j ${mtime} '+%Y-%m' ) ${fname}
 done
1360060289 2013-02 xml
1360060288 2013-02 xml/navibar.l10n.ent
1360060288 2013-02 xml/trademarks.ent
1360060288 2013-02 xml/libcommon.xsl
1360060288 2013-02 xml/header.l10n.ent
1360942284 2013-02 xml/glossary.ent
1360060289 2013-02 xml/freebsd.dsl
1360060289 2013-02 xml/teams.ent
1360060289 2013-02 xml/freebsd.ent
1360060289 2013-02 xml/l10n.ent
1360060289 2013-02 xml/mailing-lists.ent
1360060289 2013-02 xml/newsgroups.ent
1360060289 2013-02 xml/translators.ent
1360060289 2013-02 xml/catalog.xml
1360060289 2013-02 xml/entities.ent
1360060289 2013-02 xml/catalog
1360060289 2013-02 xml/urls.ent

Having the mtime in seconds as the first column is still conducive to
sorting / tail:

freefall:/home/keramida/w/doc-head/el_GR.ISO8859-7/share$ find xml \
 -exec stat -f '%m %N' {} + | while read mtime fname ; do
  echo ${mtime} $( date -f '%s' -j ${mtime} '+%Y-%m' ) ${fname};
 done | sort -n | tail -1
1360942284 2013-02 xml/glossary.ent

From that point it should be trivial to select all files whose timestamp
is smaller than or equal to 1360942284 - one month of seconds.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: shell scripting: grepping multiple patterns, logically ANDed

2012-06-30 Thread Giorgos Keramidas
On Wed, 27 Jun 2012 10:25:46 -0400, Aleksandr Miroslav alexmiros...@gmail.com 
wrote:
 hello,

 I'm not sure if this is the right forum for this question, but here
 goes.

 I have the following in a shell script:

 #!/bin/sh

 if [ $# -eq 0 ]; then
 find /foo
 fi
 if [ $# -eq 1 ]; then
 find /foo | grep -i $1
 fi
 if [ $# -eq 2 ]; then
 find /foo | grep -i $1 | grep -i $2
 fi
 if [ $# -eq 3 ]; then
 find /foo | grep -i $1 | grep -i $2 | grep -i $3
 fi

 Is there an easier/shorter way to do this? If there are 15 arguments
 supplied on the command line, I don't necessarily want to build 15 if
 statements.

The solutions proposed so far are ok, if you really *have* to stick to a
shell script.  For safer regexp pattern construction I'd probably
convert the script to some language that makes it less easy to shoot
yourself in the foot because you missed a quote or because you happened
to choose ' as the quoting character and one of the patterns includes
it too.

I'd write this sort of logic in python, constructing 'regexp' patterns
on the go from the command-line arguments:

#!/usr/bin/env python

import sys
import re

if __name__ == '__main__':
pattern = '^.*$'# Match everything by default
matcher = None
if len(sys.argv)  1:
pattern = (
r'^.*(' +
'|'.join(map(lambda part: r'' + part,
 sys.argv[1:])) +
').*$')
try:
# print 'pattern = %s' % pattern
matcher = re.compile(pattern)
except:
sys.stderr.write('invalid pattern: %s' % pattern)
sys.exit(1)
for line in sys.stdin.readlines():
# print '# line = %s, match = %s' % (
# line.rstrip(), matcher.match(line))
if matcher.match(line):
line = line.rstrip()
print '%s' % line

This should be able to match even patterns with quotes embedded, e.g.:

  0630 22:21 kobe:~$ ./foo.py it's dark
  When it's dark,  
  the world is normally
  a quieter place
  When it's dark
  ^D
  When it's dark,
  When it's dark
  0630 22:22 kobe:~$ 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: opening a shared object / failing with Undefined Symbol.

2011-03-26 Thread Giorgos Keramidas
On Tue, Mar 22, 2011 at 2:28 PM, Jim stapleton...@gmail.com wrote:
 I have an application that opens two .so files with dlopen(3):
  /usr/local/lib/libag_core.so
  /usr/local/lib/libag_gui.so

 Both files exist
 Running nm(1) against each produces a lot of output, showing all the
 symbols I know to exist in each library.

 My application gets a null return from dlopen on the libag_gui.so.

 dlerror produces the following string:
  /usr/local/lib/libag_gui.so Undefined symbol agTimingLock

 $ nm /usr/local/lib/libag_gui.so | grep agTiming
                 U agTimingLock

 I'm guessing that means that agTimingLock is used in that library but
 not defined?

 $ nm /usr/local/lib/libag_core.so | grep agTiming
 00141c00 B agTimingLock

 And this would mean that it is defined in libag_core.so?

Yes, but it's in the uninitialized data section:

% man nm
...
   B
   b The symbol is in the uninitialized data section (known as BSS).

What is the ag library? Which version are you using? What sort of
dlopen() call did you try to run?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: license of the code in freebsd documantation

2011-03-09 Thread Giorgos Keramidas
2011/3/3 Kouichiro Iwao m...@club.kyutech.ac.jp:
 I'm writing a script based on the code in freebsd docs, and caring
 about the license of it. The original scripts are example 6 and 7 of
 the following page. How do I have to treat my code if I distribute it?

 http://www.freebsd.org/doc/en/articles/ldap-auth/client.html

 I know freebsd docs is licensed under The FreeBSD Documantation
 License but don't know about codes in them.

Everything included in the FreeBSD documentation set is covered by the
license.  We don't have a special clause in the license for code that is
inline to the documentation.  Therefore, you can safely use this code
under the same terms as the documentation itself.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: switching from gnu make to bsd make

2011-02-12 Thread Giorgos Keramidas
On Thu, 10 Feb 2011 17:59:14 -0600 (CST), Robert Bonomi 
bon...@mail.r-bonomi.com wrote:
 From: Vikash Badal vikash.ba...@is.co.za
 Date: Thu, 10 Feb 2011 11:30:02 +0200
 Subject: RE: switching from gnu make to bsd make

  -Original Message-
  From: Polytropon [mailto:free...@edvax.de] Sent: 10 February 2011 10:11
  AM To: Vikash Badal Cc: freebsd-questions@freebsd.org Subject: Re:
  switching from gnu make to bsd make
 
  Of course, in my testing case OBJDIR and SRCDIR are empty, and I
  didn't define any of CC, CFLAGS, INCDIR or LIBDIR, so the defaults
  have been chosen.
 
  Do you encounter a specific problem?

 This is my problem:

 vix:$ make make: don't know how to make src/%.c. Stop

 Just telling people what happened is *NOT* enough for intelligent
 diagnosis of the  problem.  You also have to tell people  WHAT YOU DID
 that provoked the error you encountered.

 That said, dusting off my crystal ball -- which appears to be *working*
 today -- you simply typed make at the shell prompt.

 Try typing make all and see what happens then.

Right.  this should fix the immediate problem.  The 'bug' seems to be
that the Makefile lists the '$(OBJDIR)/%.o' target *first*.

 this is my make file:

 --

 CC= cc
 * LIBS  = -lpthread -lmysqlclient_r
 CFLAGS= -Wall -g
 INCDIR= -Iinclude -I/usr/local/include -I/usr/local/include/mysql
 LIBDIR= -L/usr/local/lib -L/usr/local/lib/mysql
 OBJDIR= obj
 SRCDIR= src
 BINDIR= bin
 PREFIX= /usr/local/nntpd
 BINDIRFILES   = ${BINDIR}/nntpd
 OBJS  = ${OBJDIR}/log.o ${OBJDIR}/cleanup.o ${OBJDIR}/config.o \
 ${OBJDIR}/leecherpool.o ${OBJDIR}/mytime.o
 ${OBJDIR}/upstream.o ${OBJDIR}/mysleep.o
 ${OBJDIR}/sql.o ${OBJDIR}/signalhandler.o
 ${OBJDIR}/list.o ${OBJDIR}/tcpserver.o
 ${OBJDIR}/listenpool.o ${OBJDIR}/workers.o \
 ${OBJDIR}/nntpd.o

 $(OBJDIR)/%.o:${SRCDIR}/%.c
 ${CC} -c ${CFLAGS} ${INCDIR} ${LIBDIR} $ -o $@

 all:${OBJS}
 ${CC} -o ${BINDIR}/nntpd ${LIBS} ${CFLAGS} ${INCDIR} ${LIBDIR} \
  ${OBJDIR}/log.o ${OBJDIR}/cleanup.o ${OBJDIR}/config.o \
 ${OBJDIR}/leecherpool.o ${OBJDIR}/mytime.o ${OBJDIR}/nntp.o \
 ${OBJDIR}/upstream.o ${OBJDIR}/mysleep.o ${OBJDIR}/sqlpool.o \
 ${OBJDIR}/sql.o ${OBJDIR}/signalhandler.o ${OBJDIR}/daemon.o \
 ${OBJDIR}/list.o ${OBJDIR}/tcpserver.o ${OBJDIR}/tmpfiles.o \
 ${OBJDIR}/listenpool.o ${OBJDIR}/workers.o \
 ${OBJDIR}/nntpd.o

Try swapping the order of the two targets above.  BSD make(1) considers
the first target the 'default', so when you just type 'make' it tries to
build a target named '$(OBJDIR)/%.o', which fails.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: switching from gnu make to bsd make

2011-02-12 Thread Giorgos Keramidas
On Fri, 11 Feb 2011 10:26:13 +0200, Vikash Badal vikash.ba...@is.co.za wrote:
 Make all produces the follow output:

 make all
 cc -o bin/nntpd -lpthread -lmysqlclient_r -Wall -g -Iinclude
 -I/usr/local/include -I/usr/local/include/mysql -L/usr/local/lib
 -L/usr/local/lib/mysql obj/log.o obj/cleanup.o obj/config.o
 obj/leecherpool.o obj/mytime.o obj/nntp.o obj/upstream.o obj/mysleep.o
 obj/sqlpool.o obj/sql.o obj/signalhandler.o obj/daemon.o obj/list.o
 obj/tcpserver.o obj/tmpfiles.o obj/listenpool.o obj/workers.o
 obj/nntpd.o
 cc: obj/log.o: No such file or directory
 cc: obj/cleanup.o: No such file or directory
 cc: obj/config.o: No such file or directory
 cc: obj/leecherpool.o: No such file or directory
 cc: obj/mytime.o: No such file or directory
 cc: obj/nntp.o: No such file or directory
 cc: obj/upstream.o: No such file or directory
 cc: obj/mysleep.o: No such file or directory
 cc: obj/sqlpool.o: No such file or directory
 cc: obj/sql.o: No such file or directory
 cc: obj/signalhandler.o: No such file or directory
 cc: obj/daemon.o: No such file or directory
 cc: obj/list.o: No such file or directory
 cc: obj/tcpserver.o: No such file or directory
 cc: obj/tmpfiles.o: No such file or directory
 cc: obj/listenpool.o: No such file or directory
 cc: obj/workers.o: No such file or directory
 cc: obj/nntpd.o: No such file or directory
 *** Error code 1

 With gmake :
 $(OBJDIR)/%.o:${SRCDIR}/%.c
 ${CC} -c ${CFLAGS} ${INCDIR} ${LIBDIR} $ -o $@

 This creates all the .o files I need

Does gmake also create the `obj/' directory automagically?  I kind of
doubt that, unless the gmake folks have started doing all sorts of magic
behind-your-back stuff.

You have no makefile rule to create `obj/' and no dependency of all the
object files to the object directory.

 How do I do this with bsd make ?

The canonical way of writing a program that depends on object files that
_may_ live in another object directory is to use the existing makefile
macros from `/usr/share/mk/bsd.*.mk'.  This means you will have to
re-organize your Makefile a bit though.

Instead of all the hand-crafted rules you are now trying to debug, which
are nice but will take ages to 'get the job done', you should probably
use a Makefile like this:

PROG=   nntpd

SRCS=   cleanup.c \
config.c \
leecherpool.c \
list.c \
listenpool.c \
log.c \
mysleep.c \
mytime.c \
nntpd.c \
signalhandler.c \
sql.c \
tcpserver.c \
upstream.c \
workers.c

MYSQLPREFIX?= /usr/local
MYSQLINCDIR?= ${MYSQLPREFIX}/include
MYSQLLIBDIR?= ${MYSQLPREFIX}/lib

CFLAGS+=-I${.CURDIR}/include \
-I/usr/local/include \
-I${MYSQLINCDIR}

LDFLAGS+=   -L/usr/local/lib \
-L${MYSQLLIBDIR}

LDADD+= -lmysqlclient_r -lpthread

.include bsd.prog.mk

By using the `bsd.prog.mk' rules, you can now type stuff like this:

1.  # Build everything, putting object files in the current directory.
make all

2.  # Build and install everything, but use debugging CFLAGS and inhibit
# the final 'strip' step of 'make install' by setting DEBUG_FLAGS.
make CFLAGS='' DEBUG_FLAGS='-O0 -ggdb' all install

3.  # Clean everything.
make clean

4.  # Build everything, but instead of installing in /usr/{bin,sbin}
# install in a chroot under `/tmp/chroot', with the binaries
# auto-mapped to `/tmp/chroot/usr/{bin,sbin}'.
env DESTDIR='/tmp/chroot' make install

5.  # Set up a special 'object tree' under /tmp/obj, to keep the sources
# clean from generated files.
mkdir /tmp/obj

# Point the bsd.*.mk glue to the new object tree.
export MAKEOBJDIRPREFIX=/tmp/obj

# Create a 'mirror' of the source tree under `/tmp/obj', so that
# e.g. the object code for `/home/keramida/src/foo' will be saved at
# `/tmp/obj/home/keramida/tmp/foo'.
make obj

# Try to build `.depend' files with source/header - object file
# dependencies.
make depend

# Biuld everything, saving object code in /tmp/obj
make all

# Clean up /tmp/obj. Then clean up current directory too.
make cleandir
make cleandir

The bsd.prog.mk rules will take care of creating the object directory
paths; they will take care of generating the appropriate rules to build
with the sources in one place and the object files in another directory;
the macros will let you built multiple snapshots of the same source tree
in different places, e.g. one for 'release' builds and one for 'debug'
builds with different CFLAGS, etc.

Another important point is that if you _do_ the legwork of converting
the makefile rules from gmake to BSD make, you will have tons of
examples of how to do things by looking at the makefiles of FreeBSD
itself.  All our makefiles use bsd.prog.mk, bsd.lib.mk, and 

Re: nedit problem

2011-02-05 Thread Giorgos Keramidas
On Sat, 05 Feb 2011 14:33:50 -0700, Fred Boatwright f...@blakemfg.com wrote:
 Hello,

 After updating all ports on 8.1-RELEASE, nedit has a problem.  The right
 mouse button works ok in the toolbar but if it is pressed in the text
 area, for example to copy a block of text, the cursor changes shape and
 the X session becomes completely locked up.  I have to stop X and
 restart it.  I have tried to deinstall nedit and rebuild it but this
 didn't help.  It is nedit-5.5 with Motif 2.2.3.

 Also, when nedit is started the following warnings are given:

 Cannot convert string
 -*-helvetica-medium-r-normal-*-*-120-*-*-*-iso8859-1 to type FontStruct
 Cannot convert string -*-helvetica-bold-r-normal-*-*-120-*-*-*-iso8859-1 to 
 type FontStruct
 Cannot convert string -*-helvetica-medium-o-normal-*-*-120-*-*-*-iso8859-1 
 to type FontStruct
 Cannot convert string -*-courier-medium-r-normal-*-*-120-*-*-*-iso8859-1 to 
 type FontStruct
 Cannot convert string -*-courier-bold-r-normal-*-*-120-*-*-*-iso8859-1 to 
 type FontStruct
 Cannot convert string -*-courier-medium-o-normal-*-*-120-*-*-*-iso8859-1 to 
 type FontStruct

 These warnings have been happening for some time but nedit otherwise has
 been working ok until the port update.  xpdf gives similar warnings but
 seems to work ok.

 What can I do to resolve at least the lockup problem?

Can you run nedit under truss or ktrace?  It may be stuck in a loop
because of a bug.  You should be able to run it under truss, for
example, by opening a new terminal window and typing:

truss -o nedit.log nedit

Then when nedit gets stuck, wait a bit to let truss collect some tracing
information, and kill nedit.  Attach the output of truss in a message to
the list.  Someone may find useful information about nedit's blocking in
the final bits of the trace file.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: gmake format

2011-01-26 Thread Giorgos Keramidas
On Wed, 26 Jan 2011 11:37:58 +1000, Da Rock 
freebsd-questi...@herveybayaustralia.com.au wrote:
 You'll have to excuse my ignorance (and my curious mind...), but I
 can't seem to find a straight answer to this. I know linux uses gmake,
 and gmake is installed via ports on FreeBSD, but does that mean gmake
 will only create linux binaries using the abi compatibility?

gmake itself does not produce anything in the form of binary files.  It
merely 'drives' other tools to create them.  So if a makefile calls
'gcc' to compile something and there is a native 'gcc' version in your
local system, a properly written makefile should still work.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Running two daemon instances -- rc.d or not?

2011-01-24 Thread Giorgos Keramidas
On Mon, 24 Jan 2011 13:16:29 -0500, Tom Worster f...@thefsb.org wrote:
 I need to set up a server with two instances of SphinxSearch searchd
 (listening on different ports, of course).

 What's a good way to do it?

 Copying /usr/local/etc/rc.d/sphinxsearch to
 /usr/local/etc/rc.d/sphinxsearch2 and editing that doesn't feel very
 attractive.

It should work, though.  If it's the simplest thing that could possible
work[1], why not go for it?

[1] http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread Giorgos Keramidas
On Wed, 19 Jan 2011 22:51:45 -0600, David J. Weller-Fahy 
dave-lists-freebsd-questi...@weller-fahy.com wrote:
 * Giorgos Keramidas keram...@ceid.upatras.gr [2011-01-19 02:57 -0500]:
 On Tue, 18 Jan 2011 12:29:18 -0600, David Kelly dke...@hiwaay.net wrote:
  On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
  Set the 'columns' attribute of your tty:
  stty columns 60
  man xxx
 
  *Should*? You posted without trying it? (I tried, did not work).

 'Should' as in I tried it here and it worked.  I'm running a recent
 CURRENT snapshot, but I don't think this affects the results.  What
 does 'stty -a' show in your terminal?  What is your shell's
 environment (e.g. the value of COLUMNS)?  What is your PAGER? etc.

 Well... that was an interesting night of experimentation.  Thanks for
 the idea about stty (which I didn't know about), because otherwise I
 might have gone mad (apparently COLUMNS isn't set in the environment of
 a shell script... which makes sense when one thinks about it).

 Regardless, I ended up finding two solutions.

Nice!  I'll check with our groff maintainer(s) to see if they have plans
to MFC the latest man/groff stuff.



pgpxKqg0Mxboi.pgp
Description: PGP signature


Re: How to adjust man page line length [SOLVED]

2011-01-20 Thread Giorgos Keramidas
On Thu, 20 Jan 2011 10:02:56 -0800, Charlie Kester corky1...@comcast.net 
wrote:
 In ancient times man was originally a shell script. What is old is new
 again.

 Is this a consequence of the move to mdocml instead of groff?

No, we are still using groff's groff_mdoc(7) package for authoring
manpage content.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length

2011-01-19 Thread Giorgos Keramidas
On Tue, 18 Jan 2011 12:29:18 -0600, David Kelly dke...@hiwaay.net wrote:
 On Tue, Jan 18, 2011 at 06:11:13PM +0100, Giorgos Keramidas wrote:
 On Mon, 17 Jan 2011 21:40:38 -0600, David J. Weller-Fahy
 dave-lists-freebsd-questi...@weller-fahy.com wrote:
 To expand on the question in the subject: How does one tell `man`
 not to automatically format man pages to 80 columns?  I'm looking
 for a fairly easy way to do this, or confirmation it would involve
 internal gymnastics I may not be willing to perform.

 Set the 'columns' attribute of your tty:

 stty columns 60
 man xxx

 This should do it.

 *Should*? You posted without trying it? (I tried, did not work).

'Should' as in I tried it here and it worked.  I'm running a recent
CURRENT snapshot, but I don't think this affects the results.  What does
'stty -a' show in your terminal?  What is your shell's environment
(e.g. the value of COLUMNS)?  What is your PAGER? etc.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to adjust man page line length

2011-01-18 Thread Giorgos Keramidas
On Mon, 17 Jan 2011 21:40:38 -0600, David J. Weller-Fahy 
dave-lists-freebsd-questi...@weller-fahy.com wrote:
 To expand on the question in the subject: How does one tell `man` not to
 automatically format man pages to 80 columns?  I'm looking for a fairly
 easy way to do this, or confirmation it would involve internal
 gymnastics I may not be willing to perform.

Set the 'columns' attribute of your tty:

stty columns 60
man xxx

This should do it.



pgpweCUC8F7Dj.pgp
Description: PGP signature


Re: Just wanted to install vim - had to spend entire day building X11

2011-01-10 Thread Giorgos Keramidas
On Sun, 9 Jan 2011 22:19:02 +0100, Tony Maserati ableton...@gmail.com wrote:
 Hi,

 I'm just curious - what's the point of including X11 as a dependency
 to vim?  And then making a vim-lite port (which you usually discover
 after installing X11). How about making it vim and vim-x11 instead?

Maybe because gvim is really *much* nicer than plain console-based vim
sessions.

The vim-lite port exists for those cases when you really want to install
just plain good ol' vim without all the bells and whistles.  You can also
install editors/vim with WITHOUT_X11='true' to avoid the pulling of all
this X11 stuff.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Just wanted to install vim - had to spend entire day building X11

2011-01-10 Thread Giorgos Keramidas
On Mon, 10 Jan 2011 12:43:13 +0100, Tony Maserati ableton...@gmail.com wrote:
On Mon, Jan 10, 2011 at 10:06 AM, Giorgos Keramidas keram...@ceid.upatras.gr 
wrote:
On Sun, 9 Jan 2011 22:19:02 +0100, Tony Maserati ableton...@gmail.com wrote:
 I'm just curious - what's the point of including X11 as a dependency
 to vim?  And then making a vim-lite port (which you usually discover
 after installing X11). How about making it vim and vim-x11 instead?

 Maybe because gvim is really *much* nicer than plain console-based vim
 sessions.

 The vim-lite port exists for those cases when you really want to install
 just plain good ol' vim without all the bells and whistles.  You can also
 install editors/vim with WITHOUT_X11='true' to avoid the pulling of all
 this X11 stuff.

 I hear that - but if I want gvim I'll install gvim. What it's doing
 here is installing something I didn't ask for, well actually, it's
 fooling me into giving me something I don't need.

The tricky bit is that there's no gvim port.  There are two choices one
can make when porting software like this:

  * Add a default port that installs the 'full experience', and a second
meta-port that has options suitable for minimalists.

  * Add a default port that is minimal, and a meta-port that can pull in
all the necessary bits for the full-blown user experience.

I agree that it's confusing to remember which port has chosen which
option, but there isn't much a porter (e.g. obrien in this case) can do
to satisfy *both* groups of users.

I'm sorry that you had to install software that you don't really need
and I can help you clean up by saving your installed ports as 'binary
packages' and re-installing just the bits that you _really_ want to have
around.  Other than that, I don't know if there's any way to change the
status quo of the vim ports to be able to satisfy automatically both
types of user needs.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Just wanted to install vim - had to spend entire day building X11

2011-01-10 Thread Giorgos Keramidas
On Mon, 10 Jan 2011 08:02:35 -0500, Ed Smith abandon.every.h...@gmail.com 
wrote:
 This seems bizarre.  Logically, it would seem better to do a split like
 vim (bare vim - what you would expect) and xvim (vim with X11) similar
 to how emacs does emacs/xemacs.

XEmacs[1] is not 'Emacs with X11 support', but a very different editor.
The main GNU Emacs port (editors/emacs) does include support for X11,
and it's actually a lot more pleasant to use under X window.

[1] http://xemacs.org/

Its name is certainly slightly confusing now that people have gotten
accustomed to all the 'foo' vs. 'xfoo' ports, but the XEmacs editor has
been around for a *long* time, so let's not confuse it for something
very different from what it is :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to clean system

2011-01-08 Thread Giorgos Keramidas
On Sat, 8 Jan 2011 23:18:07 +0200, Коньков Евгений kes-...@yandex.ru wrote:
 Hi
 System have many programs.
 Wanna to upgrade to new version of FBSD

 Is it possible to clean system from garbage (all programs, files,
 header files, except configuration files)
 like installing FBSD from CD?

 is there cmd?
 make clean-system

No, there's no such command.  If you are looking for a way to 'deinstall
all ports  packages' though, it may be as easy as:

1. Remove all the currently installed ports:

# rm -fr /usr/local
# mkdir /usr/local  cd /usr/local
# mtree -deU  /etc/mtree/BSD.local.dist

2. Remove all the information about 'installed packages', because you
   don't have any of these anymore:

# rm -fr /var/db/pkg/*

3. Optionally, if you are going to reconfigure all your ports from
   scratch, remove the saved port configuration options:

# rm -fr /var/db/ports/*

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to clean system

2011-01-08 Thread Giorgos Keramidas
On Sat, 8 Jan 2011 23:41:24 +0200, Коньков Евгений kes-...@yandex.ru wrote:
 GK On Sat, 8 Jan 2011 23:18:07 +0200, Коньков Евгений kes-...@yandex.ru 
 wrote:
 Hi
 System have many programs.
 Wanna to upgrade to new version of FBSD

 Is it possible to clean system from garbage (all programs, files,
 header files, except configuration files)
 like installing FBSD from CD?

 is there cmd?
 make clean-system

 GK No, there's no such command.  If you are looking for a way to 'deinstall
 GK all ports  packages' though, it may be as easy as:

 GK 1. Remove all the currently installed ports:

 GK # rm -fr /usr/local
 GK # mkdir /usr/local  cd /usr/local
 GK # mtree -deU  /etc/mtree/BSD.local.dist

 GK 2. Remove all the information about 'installed packages', because you
 GKdon't have any of these anymore:

 GK # rm -fr /var/db/pkg/*

 GK 3. Optionally, if you are going to reconfigure all your ports from
 GKscratch, remove the saved port configuration options:

 GK # rm -fr /var/db/ports/*

 I have tried: pkg_delete -a
 but many files are left in /usr/bin  /usr/sbin   ... (((
 also there are files from old 7.2 system, now I have 9.0

Packages should never install stuff in /usr/bin and /usr/sbin.  Ports
should *only* install files in /usr/local/... There are a few ports that
includes options to override base-system files in /usr but these are the
exception.

If you have been upgrading from source from 7.2 then you should also
have a look at the `/usr/src/UPDATING' file; especially at the help
about the 'make delete-old' targets of the source makefiles.

Most of the cruft left behind from old, obsolete stuff can be deleted by
running

# cd /usr/src
# make delete-old

and following the prompts.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: is there a best online python tutorial?

2011-01-02 Thread Giorgos Keramidas
On Sun, 2 Jan 2011 13:29:44 -0800, Gary Kline kl...@thought.org wrote:
 Guys,

 I actaully have studied python...but only for about twenty
 minutes); maybe a few days, actually.  What is the best online
 tutorial to learn python?  With ink+paper book, altho in lots of
 ways I prefer real books, they almost demand two hands.  Or
 paper weights, in my case.

 thanks in advance for the gbest, or top two or three sites,
 gary

Start at the online docs section of www.python.org:

http://www.python.org/doc/

The 'Additional documentation' section has a few very good guides.

Then there's always a number of books that you can read online,
download, print and use offline too:

• How to Think Like a Computer Scientist — 
http://openbookproject.net/thinkcs/python/english2e/

  An introductory book that teaches basic concepts of
  programming, algorithms and Python.  Highly recommended,
  because of its excellent writing style and the large number
  of topics it covers (recursion, exceptions, object oriented
  programming, data structures [lists, stacks, queues, etc.]).

• A Byte of Python — http://www.swaroopch.com/notes/Python

  An introductory book about Python, updated even to version
  3.0 of the language.  Written by Swaroop C.H., a developer
  in India who maintains the book for several versions of
  Python.

• Dive Into Python — http://diveintopython.org/

  A Python book for experienced programmers.  If you already
  know how to program in other languages and you are looking
  for a nice guide that will teach you 'pythonic' ways of
  writing code, this is an excellent book.

Even more guides for Python are listed at:

http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Where to post FreeBSD tutorials?

2010-12-31 Thread Giorgos Keramidas
On Thu, 30 Dec 2010 20:17:31 -0500, Xn Nooby xno...@gmail.com wrote:
 If I write a document about how to do something with FreeBSD, is there
 a good place to post it, or a link to it?

 Something like how to edit a video in FreeBSD, not official documentation.

 I usually have to google things to find them, and often find the
 answer on stackoverflow or howtoforge.  Sometimes it hard to find
 things in google, and sometimes I'm not sure what I'm looking for.

A weblog post would be nice.  If you feel really adventurous you can
even set up a 'FreeBSD Wiki' with your tutorials.

Another good thing you can do is to prepare SGML articles for your
mini-guides and post them to freebsd-doc for inclusion to the official
doc/ tree.  This is a bit more difficult than a personal wiki though,
because: (1) you would have to learn SGML to write the source of the
article itself and (2) you have to convince the doc team that the
article is sufficiently good and necessary before it's committed and,
more importantly, (3) it would be nice if you are prepared to 'maintain'
the text in the future.



pgpmDD9JwVKn1.pgp
Description: PGP signature


Re: How to build a BROKEN port?

2010-12-30 Thread Giorgos Keramidas
On Wed, 29 Dec 2010 17:31:37 -0800, mer...@stonehenge.com (Randal L. Schwartz) 
wrote:
 Giorgos == Giorgos Keramidas keram...@ceid.upatras.gr writes:

 Giorgos Edit it's 'Makefile'.  Look for an assignment of the form:

 Minor nit... that's its not it's.  If you can't say it is or it
 has in place, then it's its, not it's. :)

True. I should be more careful about spelling when I post aftre 02:00am
in the night!  Thanks :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to build a BROKEN port?

2010-12-29 Thread Giorgos Keramidas
On Thu, 30 Dec 2010 10:49:25 +1000, Da Rock 
freebsd-questi...@herveybayaustralia.com.au wrote:
 Pardon me for being the queer one to ask this- but how does one
 force/override building a port marked as broken?

 I'm not about to run a make install clean on it, but I would like to at
 least have a crack at trying to fix whats wrong. In this particular case
 its involving a particular arch, and seeing as I have this arch I'd
 reckon I'm an ideal candidate to try and help fix it :)

 I poked around for a bit for an answer, but pretty much all the info is
 on how to mark it as broken- not overriding it.

Edit it's 'Makefile'.  Look for an assignment of the form:

.if ${MACHINE_ARCH} = amd64
BROKEN= This port fails to frobnicate foo on amd64.
.endif

Remove this assignment, build the port and try to debug its problems.
When you have a fix, run make clean in the port directory, save a copy
of the entire port subdirectory somewhere and email the person or team
listed in MAINTAINER with your fix.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FreeBSD IPSec stack contains backdoors?

2010-12-17 Thread Giorgos Keramidas
The FreeBSD security officer team has already written an official
response about this.  Please have a look at:


http://lists.freebsd.org/pipermail/freebsd-security/2010-December/005746.html

Regards,
Giorgos

On Fri, 17 Dec 2010 14:28:37 +0600, Victor Lyapunov fullblastst...@gmail.com 
wrote:
 -- Forwarded message --
 From: Victor Lyapunov fullblastst...@gmail.com
 Date: 2010/12/15
 Subject: FreeBSD IPSec stack contains backdoors?
 To: FreeBSD Mailing List freebsd-questions@freebsd.org

 Hi folks,
 Recently OpenBSD developer Gregory Perry disclosed information about
 possible backdoors in OpenBSD IPSec stack (see
 http://permalink.gmane.org/gmane.os.openbsd.tech/22557) In particular,
 Gregory Perry, who has been working on a OpenBSD -ish implementation
 of IPSec says a number of backdoors have been introduced into the
 code.

 As far as I am aware, FreeBSD contains considerable amount of code
 ported from OpenBSD. The question is: was the FreeBSD's ipsec code
 ported from OpenBSD's implementation? If so, what might be the impact
 of this?

 Thanks,
 Victor Lyapunov.


pgpj38p4qhlWi.pgp
Description: PGP signature


Re: FreeBSD IPSec stack contains backdoors?

2010-12-17 Thread Giorgos Keramidas
On Fri, 17 Dec 2010 10:36:39 -0500, Mike L jackoro...@gmail.com wrote:
 On Fri, Dec 17, 2010 at 4:31 AM, Giorgos Keramidas 
 keram...@freebsd.orgwrote:
 The FreeBSD security officer team has already written an official
 response about this.  Please have a look at:

 http://lists.freebsd.org/pipermail/freebsd-security/2010-December/005746.html

 Reads like an unacceptable response to an issue that seems quite critical.

On Fri, 17 Dec 2010 11:11:17 -0500, Mike Tancsa m...@sentex.net wrote:
 Strange, reads like a totally reasoned response to me to an issue that
 is somewhere between a practical joke and something critical. I will
 go with the SECTeam's assessment. They have a proven track record for
 assessing and dealing with security issues.

Mike L, unacceptable or not this is the response of people who have been
involved with FreeBSD security for a long time.  I think their response
is reasonable, given the out-of-scale proportions that the entire issue
seems to have been blown into when magazine-style web sites picked it up
and started 'decorating' the original email of Theo with their own view
of what the message between the lines MIGHT have been.

The role of the security officer team is not to take an issue that has
been blown entirely out of proportion and add to the FUD.  It's their
responsibility to handle security incidents on a fact-based basis, and
there are very little real facts out there about this particular
theory right now.

I don't know why you consider the security officer reply `unacceptable',
but I'm relatively sure you will agree that they are quite sensible when
they say:

As always, anyone who believes that they have found a vulnerability
affecting FreeBSD is requested to contact secteam at freebsd.org.

I think that's a quite reasonable, sensible and down to earth thing to
say.  The rest of what the interwebs seems to be writing about these
particular allegations are, to the best of my current knowledge, just
a conspiracy theory trying to become as public as possible.

I too will agree with Mike Tansa.  I'll go 100% with the SECTeam’s
assessment.  They have a proven track record for assessing and dealing
with security issues.


Note: Let's keep the email traffic of security-officer down a bit.  They
don't really have to get Cc: copies of *all* the email messages of all
the people subscribed to freebsd-questions.  It's probably annoying and
it may even turn out to be a waste of their time, or even obstruct them
From seeing other, really *important* stuff about security issues.




pgp7ilBx2zu2r.pgp
Description: PGP signature


Re: Creating clone of a HDD including boot partition

2010-12-16 Thread Giorgos Keramidas
On Wed, 15 Dec 2010 18:57:33 +0100, bsd b...@todoo.biz wrote:
 Le 15 déc. 2010 à 16:45, Giorgos Keramidas a écrit :
 On Wed, 15 Dec 2010 16:11:45 +0100, bsd b...@todoo.biz wrote:
 Is there a way to dd to a file to create an iso image and then restore
 (still using dd from this image).  I only have one IDE -- USB cable
 so this is the reason why It'd more simple for me to create an iso
 image of the disk and then restore.

 Using dump won't be very useful because I won't be able to get the
 first 63 segments where boot info are written, I need something of
 lower level (obviously dd will be my friend).

 Thanks everyone. I'll try to post the line code once I got It up and
 running.

 No dd(1) cannot do that.

 What you _can_ do is boot into single-user mode, and then use mkisofs
 with burncd or growisofs from dvd+rw-tools to burn an image while still
 in single-user mode.  The only user mode process is your root shell at
 that point, so you can be relatively sure there are no major changes
 happening somewhere at the filesystem while you are still dumping it to
 a CD-ROM or DVD-ROM disk.

 Just to be precise, I am not trying to do an ISO image of a running
 root FS, but of a USB attached disk.

Then it's much easier.  Just mount the disk as read-only and use
growisofs to dump its contents to a CD-ROM or DVD disk :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Creating clone of a HDD including boot partition

2010-12-15 Thread Giorgos Keramidas
On Wed, 15 Dec 2010 16:11:45 +0100, bsd b...@todoo.biz wrote:
 Is there a way to dd to a file to create an iso image and then restore
 (still using dd from this image).  I only have one IDE -- USB cable
 so this is the reason why It'd more simple for me to create an iso
 image of the disk and then restore.

 Using dump won't be very useful because I won't be able to get the
 first 63 segments where boot info are written, I need something of
 lower level (obviously dd will be my friend).

 Thanks everyone. I'll try to post the line code once I got It up and
 running.

No dd(1) cannot do that.

What you _can_ do is boot into single-user mode, and then use mkisofs
with burncd or growisofs from dvd+rw-tools to burn an image while still
in single-user mode.  The only user mode process is your root shell at
that point, so you can be relatively sure there are no major changes
happening somewhere at the filesystem while you are still dumping it to
a CD-ROM or DVD-ROM disk.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Kind of off topic.

2010-12-14 Thread Giorgos Keramidas
On Mon, 13 Dec 2010 17:21:06 -0600, Jorge Biquez jbiq...@intranet.com.mx 
wrote:
 Hello all.

 A friend is asking me to help him to solve some problem he has in his
 servers. To some I would be able to connect using ssh, with other just
 it i snot possible. I remember that on the windows world there was a
 commercial software PCANywhere. He can have it but I am not sure if I
 would be able to connect to that from my Freebsd machine (of course
 not by ssh).

 What are you using for connecting to graphical interfaces of different
 OS's from FreeBSD?

 I tested some years ago a VNC software but did not work fine with MAC
 OSX (recently released by then).

 I know big security factors are involved for sure.
 Any suggestion on what to use, not to expensive or free?

If the remote hosts are running FreeBSD, you can do almost *everything*
through SSH.  For example most of my FreeBSD-related testing work
happens through SSH connections to virtual machines these days.

If you really need to run a GUI application though there are a few
options:

  - The most basic is to connect to the remote machine in *some* way,
set the DISPLAY environment variable to point to a local X server
that may accept incoming connections and fire up your GUI program.

  - You can SSH into the remote machine and use the -X or -Y options to
set up 'X forwarding' back to the machine where the SSH connection
has originated from.

  - You can use programs like the NX tools http://www.nomachine.com/
to set up a 'remotely accessible X desktop' on the target machine
and then use nxclient to connect to it from anywhere.

The fastest and simplest method is still a plain good old SSH connection
though.  It requires minimal setup (an sshd daemon on the remote side),
it is accessible from anywhere in the world, it's secure against random
eavesdroppers, it's fast to connect to, it's pretty light-weight on both
the client and server systems, and you can do _everything_ on the remote
host [even full system upgrades from source].

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Want sendmail applying aliases to 'cc:' field too

2010-12-10 Thread Giorgos Keramidas
On Fri, 10 Dec 2010 17:12:17 +0300, c0re nr1c...@gmail.com wrote:
 I do use aliases file and I know what is it.
 But it looks like not this case.
 I want Cc: be rewritten like in aliases file defined in Cc: header,
 not only those one that comes in RCPT TO:.
 And sendmail does not do it with Cc: field.
 Yes, recipient that in Cc: field do receive this mail, all ok in this
 way, but I want in MY mail Cc: field been rewritten as it is in
 aliases.

 I want to see in my mail this email headers
 to: u...@domain.com
 cc: us...@site2.domain.com

 Not this one:
 to: u...@site1.domain.com
 cc: us...@domain.com

 Looked at postfix - same thing, no such feature saw there in documentation.

That's because aliases do not actually 'rewrite' anything.  They merely
redirect the message.  Have a look at:

FEATURE('masquerade_envelope')
FEATURE(`allmasquerade')

But pay careful attention to the warning about `allmasquerade' in the
docs at `/usr/share/sendmail/cf/README'.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Archiving directories / zip format

2010-12-06 Thread Giorgos Keramidas
On Mon, 6 Dec 2010 08:17:17 +0100, Zbigniew Szalbot zszal...@gmail.com wrote:
 Dear all,

 From time to time I want to archive a quite a few directories to download
 them conveniently. I have been using tar to do it, endingin up with a
 tar.gz file. But the problem with it is that I do not have a unix machine
 at home so if I want to extract something or unpack the content, there is
 no easy way to do that. My question basically is if there is a way to end
 up with a zip file? Or are there any windows tools to unzip and/or
 extract content from tar.gz files?

You can use the archivers/zip port, which installs a zip(1) utility with a
command-line syntax vaguely similar to the pkzip/pkunzip tools from old DOS
days.

Then again you can keep using tar.gz or tar.bz2 archivers, like you do now.
WinZip and WinRar tools can deal quite fine with these two compression
formats, Linux machines also have tar/gzip/bzip2 and the rest of the
platforms out there (e.g. MacOS) may have tools similar to WinZip / WinRar.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Thanks.

2010-11-18 Thread Giorgos Keramidas
On Thu, 18 Nov 2010 16:25:31 +0330, Mohsen Mostafa Jokar 
mohsenjo...@gmail.com wrote:
 Hello.
 Thank you very much.

You are welcome :)

 I want make a new community of FreeBSD for my country, i think
 i must serve a domain like you tell me.

 if i serve a domain, second step what is it?

 i want have a email account with freebsd.org like users in this
 page http://www.freebsd.org/community/mailinglists.html

 what should i do?
 I thankful if you guide me.

The mailing lists hosted at lists.FreeBSD.org are managed by our
postmaster team.  So you have to go through the normal process
before you create a mailing list there.  This means that:

  a) You have to talk to postmaster and convince them that there
 is a very real need for another mailing list.

  b) You have to come up with a 'charter' for the mailing list: a
 short blurb that describes what the list topic will be, who
 is allowed to post there, etc.

  c) Once you get approval from postmaster, your list will be
 created and you can go on using it.

I am not sure what you mean by serve a domain.  Do you already
have a web site or other community-related place where people can
join and talk about FreeBSD-related material?  If yes, what is
the name of the web site?  Can you briefly describe the community
itself?

Cheers,
Giorgos

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Sendmail Question: Smart Host Round-Robin In Mailertable?

2010-10-27 Thread Giorgos Keramidas
On Wed, 27 Oct 2010 09:51:59 -0500, Tim Daneliuk tun...@tundraware.com wrote:
 A bit OT, but I'm hoping one of you resident geniuses can point me to
 an answer

 I have a situation where I need to set up round-robin across several
 smart hosts in the sendmail mailertable for all traffic. (For a
 variety of reasons, the client does not want this done in either the
 .mc file or directly in the .cf file.)

 Can some kind soul point me to a resource that explains the syntax for
 doing this?

Maybe a DNS-based round robin solution would suffice?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: gzip tries to unpack/pack 1st the filename of $GZIP

2010-10-15 Thread Giorgos Keramidas
On Thu, 14 Oct 2010 10:36:59 +0200, Matthias Apitz g...@unixarea.de wrote:
 Hello,

 I was facing a problem in some Makefile/shell-scripting and finally I
 could nail it down:

 when you set the environment variable GZIP to something, for example to
 let it point to gzip itself, it tries 1st to unpack this file:

 $ GZIP=/usr/bin/gzip export GZIP
 $ $GZIP -dc source.tar.gz | wc -l
 gzip: /usr/bin/gzip: not in gzip format
   645770

 o

 $ GZIP=bla export GZIP
 $ gzip -dc source.tar.gz | wc -l
 gzip: can't stat: bla: No such file or directory
   645770

 Why is this? It's not mentioned in the man page.

Look at the info documentation of gzip:

.---[ info gzip 'Environment' ]-
| 5 Environment
| *
|
| The environment variable `GZIP' can hold a set of default options for
| `gzip'.  These options are interpreted first and can be overwritten by
| explicit command line parameters.  For example:
|
|  for sh:GZIP=-8v --name; export GZIP
|  for csh:   setenv GZIP -8v --name
|  for MSDOS: set GZIP=-8v --name
|
|On VMS, the name of the environment variable is `GZIP_OPT', to avoid
| a conflict with the symbol set for invocation of the program.
|
`---

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to recursively symlink every file in a dir

2010-09-09 Thread Giorgos Keramidas
On Thu, 9 Sep 2010 13:24:50 -0400, Aryeh Friedman aryeh.fried...@gmail.com 
wrote:
 I want to make it so every file is a seperate symlink in dir2 if and
 only if it is a regular file (not a dir) in dir1... the reason is if
 the file is unchanged then use symlink but I can rm the symlink and
 replace it with a non-symlink:

 To show the problem I am attempting to solve:

 foo: (owned by fred)
 arf:
ack

 in barney's account:

 ln -s ~foo/ foo
 rm foo/arf/ack# Permissioin denied ... it should nuke the symlink
 and let me then do something like touch foo/arf/ack

If you don't mind creating the local directories in one run, and then
symlinking everything else, you can use something like:

cd bar
( cd ~foo ; find . -type d ) | xargs mkdir -p
( cd ~foo ; find . \! -type d ) | while read fname ; do
ln -s ~foo/$fname $fname
done

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Writes to Hard Disk Going Beyond Capacity

2010-07-10 Thread Giorgos Keramidas
On Sat, 10 Jul 2010 03:10:31 -0400, Patrick Donnelly batr...@batbytes.com 
wrote:
 Hi List,

 I have a strange problem in a C program I wrote. I open a hard
 disk character file (/dev/ad1) and attempt to write over the
 entire disk. I expect the last write that would go beyond the
 hard disk length (capacity) to return with an error but instead
 the write succeeds.  This happens for hundreds of gigabytes
 beyond the file (hard drive) length. What could be wrong? (This
 program works fine on Linux. The last write that would go
 beyond the end of the hard drive returns with -1.)

 Thanks for any help,

Can we see the exact source code of the program?  What you
describe might work if the file has holes inside it.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: fetchmail certificate verification messages

2010-07-05 Thread Giorgos Keramidas
On Sat, 3 Jul 2010 23:36:58 +0200 (CEST), Marco Beishuizen mb...@xs4all.nl 
wrote:
 Hi,

 I'm seeing in my logfiles a lot of messages like these from fetchmail:

 Jul  3 22:02:54 yokozuna fetchmail[1437]: Server certificate
   verification error: self signed certificate in certificate chain
 Jul  3 22:02:54 yokozuna fetchmail[1437]: This means that the root
   signing certificate (issued for /C=SE/O=AddTrust AB/OU=AddTrust External
   TTP Network/CN=AddTrust External CA Root) is not in the trusted CA
   certificate locations, or that c_rehash needs to be run on the
   certificate directory. For details, please see the documentation of
   sslcertpath and sslcertfile in the manual page.

 Does anyone know what these messages mean and if they are harmless or
 not?

This means that the certificate of CN=AddTrust External CA Root is
signed by itself.  It's a common thing when the administrator of the
respective SSL-enabled host has not bought a certificate from one of the
global CA authorities, but has signed the certificate with itself to
avoid the costs  process associated with maintaining a normal
certificate.

If you know that the respective domain is indeed set up this way, the
warning is harmless.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: rc.conf: gnome_enable=YES - which instructions executed?

2010-07-01 Thread Giorgos Keramidas
On Wed, 30 Jun 2010 21:10:41 -0700 (PDT), Chris Stankevitz 
chrisstankev...@yahoo.com wrote:
 My rc.conf file has this entry: gnome_enable=YES

 Q: Where on my hard drive can I find the instructions executed to enable 
 GNOME?

 A: /usr/local/etc/rc.d/gnome [bad answer: file does not exist]

gnome_enable is a 'default' option that enables some services that make
GNOME desktop experience a bit more useful  pleasurable.  You can see
which services default to YES by running:

keram...@kobe:/home/keramida$ cd /usr/local/etc/rc.d
keram...@kobe:/usr/local/etc/rc.d$ fgrep -l gnome_enable *
avahi-daemon
avahi-dnsconfd
dbus
gdm
hald
keram...@kobe:/usr/local/etc/rc.d$

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: .sh check for numeric content

2010-06-23 Thread Giorgos Keramidas
On Thu, 24 Jun 2010 05:19:53 +0200, Thomas Keusch 
f...@bsd-solutions-duesseldorf.de wrote:
 t...@eternity:~$ b=5
 t...@eternity:~$ case $b in
 [0-9] )
 echo numeric
 ;;
 * )
 echo alpha
 ;;
 esac
 numeric
 t...@eternity:~$

 Works for me.

Depending on what numeric means, this may be ok.  For other numeric
values (e.g. floating point numbers) There are simple, fast and correct
ways to check but you have to escape from the shell, e.g.:

$ var=3.1415926535897931
$ python -c $var + 0.0 /dev/null 21 ; echo $?
0

$ var=3a.1415926535897931
$ python -c $var + 0.0 /dev/null 21 ; echo $?
1

The overhead of spawning a full-blown language interpreter like Perl or
Python may be acceptable if you have to check a few values.  Then it
may be overkill if you want to check a million values.  It's really up
to you, as a programmer, to pick the right method.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Perl Dumping Core

2010-06-18 Thread Giorgos Keramidas
On Wed, 16 Jun 2010 15:18:19 +0100, Matthew Seaman 
m.sea...@infracaninophile.co.uk wrote:
 On 16/06/2010 15:11:15, Tim Daneliuk wrote:
 I am running 8.1-PRERELEASE and seeing a half dozen of these a day:

(perl5.10.1), uid 0: exited on signal 11

 Anyone have theories on this?

 You have a perl process or processes owned by root that are dying due to
 segmentation violations.

I've seen perl core dumps a few times too.  They seem to be triggered by
Gnome bug-buddy, but I haven't had much time to investigate why/when
they are triggered.  A typical Perl traceback here looks like this:

: (gdb) bt
: #0  0x28334d77 in kill () at kill.S:3
: #1  0x28239017 in _raise (sig=6) at /usr/src/lib/libthr/thread/thr_sig.c:185
: #2  0x2833386a in abort () at /usr/src/lib/libc/stdlib/abort.c:65
: #3  0x282b7113 in arena_dalloc_bin (arena=0x8049c60, chunk=0x2880, 
ptr=0x28900e60, mapelm=0x28800c14) at /usr/src/lib/libc/stdlib/malloc.c:2570
: #4  0x282b8bfa in idalloc (ptr=0x28900e60) at 
/usr/src/lib/libc/stdlib/malloc.c:4302
: #5  0x282b9b7a in free (ptr=0x28900e60) at 
/usr/src/lib/libc/stdlib/malloc.c:6132
: #6  0x2832e53b in __clean_env (freeVars=true) at 
/usr/src/lib/libc/stdlib/getenv.c:236
: #7  0x282631d0 in ?? () from /lib/libc.so.7
: #8  0x28347000 in ?? () from /lib/libc.so.7
: #9  0x2807b738 in ?? () from /libexec/ld-elf.so.1
: #10 0x7fbfece8 in ?? ()
: #11 0x283385bc in _fini () from /lib/libc.so.7
: #12 0x28092300 in ?? ()
: #13 0x2807b738 in ?? () from /libexec/ld-elf.so.1
: #14 0x7fbfece8 in ?? ()
: #15 0x2804ee95 in objlist_call_fini (list=0x28089190, force=40 '(', 
lockstate=0x132e46b) at /usr/src/libexec/rtld-elf/rtld.c:1640
: Previous frame inner to this frame (corrupt stack?)
: (gdb)

This isn't very helpful for *all* Perl core dumps, but it may lead
someone towards obtaining a better traceback...



pgpOMXkQ6Ur2c.pgp
Description: PGP signature


Re: Too many defunct processes; kill -9 not working

2010-06-09 Thread Giorgos Keramidas
On Wed, 9 Jun 2010 14:08:58 +0300, Eitan Adler li...@eitanadler.com wrote:
 Lately I've been getting a considerable number of defunct processes. I
 do not know of any major event that changed my computer (ie it is not
 related to an ports update or a freeBSD upgrade).

 This is often caused by me killing the process using kill -15 or kill
 -3 or kill -9.

 What can I do to determine why processes are not getting killed by kill -9?

 % ps -o ppid -o comm|grep defunct|cut -d ' ' -f 1 |xargs kill -9
 typically gets rid of them (by killing their parent)

That's the only way to kill zombies...

You can't signal the zombie/defunct process itself, because it's gone
already.  But you can kill the process who spawned it.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: which is the basic differences between the shells?

2010-06-07 Thread Giorgos Keramidas
On Sun, 6 Jun 2010 07:57:51 -0400, Jerry freebsd.u...@seibercom.net wrote:
 On Sun, 06 Jun 2010 14:19:08 +0300
 Giorgos Keramidas keram...@ceid.upatras.gr articulated:
 You can always install bash with pkg_add.  The default package is
 not built as a static binary, but you can compile a static bash
 binary from its port:

 # cd /usr/ports/shells/bash
 # make WITH_STATIC_BASH=1 install clean

 I thought that was what this port was for:

 Port:   bash-static-4.1.5_2
 Path:   /usr/ports/shells/bash-static
 Info:   The GNU Project's Bourne Again SHell

Yes, that's what bash-static enables.

I only mentioned WITH_STATIC_BASH because it's what I usually prefer to
avoid gettext/libintl.so troubles when portupgrade is still half-done
and I want to open a new screen window or xterm.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: which is the basic differences between the shells?

2010-06-06 Thread Giorgos Keramidas
On Sat, 5 Jun 2010 22:35:09 +, Giorgos Tsiapaliokas terie...@gmail.com 
wrote:
 hello,
 i am coming from the linux world where i was using the bash shell but
 i found out that there are also much more.

 can u tell me the basic differences between them?(pros and cons)

It isn't humanly possible to write *all* the differences of *all* the
shells in a single email reply.  But you can find a good table that
compares various shells in Wikipedia:

  http://en.wikipedia.org/wiki/Comparison_of_command_shells

In a FreeBSD context there are also a few more things to consider when
comparing shells:

  * Is the shell part of the base system or a port/package?

  * Is the shell well maintained?

  * Does the shell depend on many other ports or none at all?

  * Does the shell support building static-only copies?  This is useful
if you want to upgrade the base system without breaking the login
shell you are using every day.

Having said that, here are a few personal notes from my own experience
with shells on FreeBSD...

The /bin/sh and /bin/csh shells are part of the base system, so they are
rebuilt as part of the normal buildworld process.  The big advantage of
using a shell that is part of the base system is that it's always
there.  Any shell scripts or code you write that uses these shells will
have a great chance of running on ANY FreeBSD system out there.  That's
where traditionalism stops and personal preference jumps in though...

I don't like using csh(1) for a lot of things.  It syntax makes me
cringe, even though it's a mostly ok interactive shell.  So I always
install at least bash and mksh on my systems.

There is no bash shell in the *base* system of FreeBSD.  But there are
many ports for command shells, and bash is part of these:

# cd /usr/ports/shells
44bsd-csh   dashjailkit pdksh   tcshrc
Makefilees  ksh93   pear-PHP_Shell  v7sh
bashesh lshell  psh viewglob
bash-completion fd  mkshrc  vshnu
bash-static fishnologinmsg  rsshwapsh
bash3   flash   osh sashzoidberg
bash3-staticgscommander p5-Shell-Perl   scponly zsh
bashc   heirloom-sh p5-Term-ShellUI shell-include
ch  ibshpashtcsh_nls
#

You can always install bash with pkg_add.  The default package is not
built as a static binary, but you can compile a static bash binary from
its port:

# cd /usr/ports/shells/bash
# make WITH_STATIC_BASH=1 install clean

The bash shell depends on two other ports: gettext and libiconv.  These
are not large ports, but it is often a good idea to have a shell around
that only depends on libc.

This is why I also install 'shells/mksh' on my systems.  It's the ksh
compatible shell of the MirOS BSD folks.  It has a small foot-print, a
ksh-compatible syntax, and it depends only on libc.so:

keram...@kobe:/home/keramida$ ldd `which mksh`
/usr/local/bin/mksh:
libc.so.7 = /lib/libc.so.7 (0x280c9000)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: two questions....

2010-06-03 Thread Giorgos Keramidas
On Wed, 2 Jun 2010 16:04:20 -0700, Gary Kline kl...@thought.org wrote:
 guys, i just found a truckload of Just Outstanding fonts.  at the CTAN
 .org site there must be hundreds of these superb serif typefaces.  in
 my /home/kline/ directory, i have a ~/.fonts directory.  but it's been
 awhile since i've added to it.  what's the magic to getting these
 tex-gyre fonts can use them?  i would like these to be available for
 abiword, OOo, as well as my tex packages. clues, please.

Installing fonts in ~/.fonts makes them available for all the programs
that use fontconfig after you run:

fc-cache -v

TeX and a few other applications (e.g. groff) have their own way of
handling fonts.  You may have to install them using a TeX-specific set
of commands.  Newer TeX-live installations support XeTeX too.  To use a
Truetype font in XeTeX you will need to copy the fonts to a path that is
visible during xetex/xelatex runs and add something like this in your
document's preamble:

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}

\setmainfont[Scale=0.9,
  BoldFont={*-Bold},
  ItalicFont={*-Italic},
  BoldItalicFont={*-BoldItalic}]
  {DejaVuSerifCondensed}
\setsansfont[Scale=0.9,
  BoldFont={*-Bold},
  ItalicFont={*-Italic},
  BoldItalicFont={*-BoldItalic}]
  {DejaVuSansCondensed}
% Monospace DejaVu fonts have to be scaled down a bit more than
% their serif or sans-serif equivalents to look nice in print
% output.
\setmonofont[Scale=0.85,
  BoldFont={*-Bold},
  ItalicFont={*-Oblique},
  BoldItalicFont={*-BoldOblique}]
  {DejaVuSansMono}

\usepackage{xunicode}
\usepackage{xltxtra}

This is the preamble text I use to write XeTeX documents using the
DejaVu family of fonts.  The results are fantastic.  A sample of what
these fonts yield can be seen at:

http://students.ceid.upatras.gr/~keramida/free.pdf

This is one of the books I converted from their HTML source to XeLaTeX
when I was learning to use TrueType and OpenType fonts in TeX.  Copying
the DejaVu fonts in the same directory as the TeX source makes them
immediately available to XeLaTeX.  This is nice because you can package
both the TeX source *and* the necessary fonts in the same archive :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: text editor

2010-05-31 Thread Giorgos Keramidas
On Mon, 31 May 2010 09:59:00 -0600, Chad Perrin per...@apotheon.com wrote:
 Vim is much smaller than Emacs but it still a few MB's here:

   keram...@kobe:/usr/ports/packages/All$ ls -ld vim*
   -rw-r--r--  1 root  wheel  - 5757731  1 Απρ 17:11 vim-lite-7.2.344.tbz

 Does Vim install more than the binary?  I've got this:

  ls -l /usr/local/bin/vim
 -rwxr-xr-x  1 root  wheel  1650340 Apr 18 12:20 /usr/local/bin/vim

Yes, it does: help files; syntax highlighting rules; manpages; around 14
binaries in /usr/local/bin; including more than a thousand files in
/usr/local/share.

 I don't think the size of the installation tarball is necessarily
 representative of the final size.

For modern editors like Vim and Emacs the binary is pretty much a basic
'scripting engine' that loads plugins, scripts and other data files to
present an editing user interface to the user.  The last Emacs binary I
compiled is 13 MB:

  keram...@kobe:/opt/emacs/bin$ ls -ld emacs-*
  -rwxr-xr-t  2 root  wheel  - 13395130 31 Μαϊ 20:13 emacs-24.0.50

The full Emacs installation in /opt/emacs is more than 110 MB:

  keram...@kobe:/opt/emacs$ du -sk .
  113298  .

The binary itself is a small part of the installation; almost 1/10 of
the full size of GNU Emacs.



pgpQO2501u1dl.pgp
Description: PGP signature


Re: text editor

2010-05-31 Thread Giorgos Keramidas
On Mon, 31 May 2010 11:36:53 -0500 (CDT), Robert Bonomi 
bon...@mail.r-bonomi.com wrote:
Giorgos Keramidas keram...@ceid.upatras.gr wrote:
 Vim is much smaller than Emacs but it still a few MB's here:

   keram...@kobe:/usr/ports/packages/All$ ls -ld vim*
   -rw-r--r--  1 root  wheel  - 5757731  1 =CE=91=CF=80=CF=81 17:11 
 vim-lite-7.2.344.tbz

 Yeah, but EMACS is (currently) reputed to stand for Eighty
 Megabytes And Constantly Swapping!  *GRIN*

That's an old joke, but it's not particularly good anymore.

The smallest laptop-size 2.5 SATA disk I have at home can hold
more than 80 GB of data.  The size of a program is now a limiting
factor only if you are working with embedded applications.

Normal, every-day computers have enough disk space to hold tens
of thousands of full Emacs installations even without any sort of
compression :-)


pgpDAH7yDZmZs.pgp
Description: PGP signature


Re: text editor

2010-05-30 Thread Giorgos Keramidas
On Sun, 30 May 2010 11:36:31 +0800, Fbsd1 fb...@a1poweruser.com wrote:
 Been using ee and been happy.

 Now I have need for an editor with block commands.

 Put dd on the first line of sequence number you want to start deleting
 and dd on the last line of the block and hit enter and the block of
 lines are deleted.

 OR

 Put cc on first line and cc on last line of black to copy and enter
 I on line where you want the copied block to be inserted after.

 Also same for mm meaning move block.

 Is there any editors with a function like this?

If you don't mind the size of the respective packages, both VIM and
GNU Emacs have support for many features that ee(1) lacks.

editors/vim-lite has visual block-editing and rectangle-editing modes.
It includes support for multiple open buffers, split windows, and many
more nice features.

editors/emacs has support for many selection modes, including support
for block-editing, rectangle-editing, a virtually unlimited number of
'cut buffers' (they are called 'registers' in Emacs terminology), and
a literally mind-bending number of extra features.

I use both editors on a regular basis.  Most of the ASCII art I've
posted in this mailing list and other open source mailing lists has
been created using Vim or Emacs.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sh script writing help

2010-05-30 Thread Giorgos Keramidas
On Sun, 30 May 2010 13:14:01 +0800, Aiza aiz...@comclark.com wrote:
 In a .sh type script I have  exerr  very long message gt 250 char
 all on the same line. This is a real pain to edit.

 Is there some code a can use to continue this on the next line so I
 can see it on the screen and still have the command function? I tried
 \ with no luck.

If the message does not have to be a *single* command-line argument of
the exerr function, you can split the message in multiple arguments
and use '\' for continuation lines, e.g.:

echo This is a very long message \
that does not fit in a single \
line of text.

This might not work if you _have_ to pass the string as a single
argument, but even in that case you can use shell substitution to wrap
the exerr() function, e.g.:

exwrap()
{
return exerr $*
}

exwrap This is a very long message \
that does not fit in a single \
line of text.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: text editor

2010-05-30 Thread Giorgos Keramidas
On Sun, 30 May 2010 17:28:27 -0600, Chad Perrin per...@apotheon.com wrote:
On Sun, May 30, 2010 at 09:31:59PM +0300, Giorgos Keramidas wrote:
 If you don't mind the size of the respective packages, both VIM and
 GNU Emacs have support for many features that ee(1) lacks.

 I'm not sure why you mentioned the size of Vim here as if it's a
 remarkably large piece of software.  It *barely* doesn't fit on a 3.5
 floppy when you use a full install of the console-based Vim editor.
 I'm pretty sure it's under 2 MB.

Vim is much smaller than Emacs but it still a few MB's here:

  keram...@kobe:/usr/ports/packages/All$ ls -ld vim*
  -rw-r--r--  1 root  wheel  - 5757731  1 Απρ 17:11 vim-lite-7.2.344.tbz

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cloning question

2010-05-27 Thread Giorgos Keramidas
On Wed, 26 May 2010 22:33:16 -0400, Steve Bertrand st...@ipv6canada.com wrote:
 I've written a few howto's on backup/restore/cloning in the past, but
 now I have a question that I hope to have quickly answered.

 I'm not looking for criticism on my approach, only on whether it will
 work. With that said, I'll lay out my scenario and my questions.

 Scenario:

 - live web server (300 domains), shut the box down and booted up a copy
 of the system on new hardware

 - changed the normal system items (nic, fstab etc)

 - new box is running fine under old system, but I need to transfer the
 old system data (all of it...*all* data) to the new disk sub-structure

 - new box has RAID card, but not compatible w/FBSD

 - new box has had RAID card disabled, so new disks show up as standard
 adX drives

 Questions:

 - while running the 'new' box under the 'old' system, can I:
 --- atacontrol create RAID1 ad4 ad6
 --- fdisk
 --- label: to items under /mnt, as to prepare for copy

 - stop all services (or go into single-user), and dump each slice from
 orig to new

 ...if so, please advise of the dump command that I'd be using.

 Normally I'd use rsync, but this situation can sustain some downtime to
 ensure a complete and utter mirror.

If you want to use dump/restore to copy the root partition from ad0s1a
to ad4s1a you can use:

# newfs -L NEWROOT /dev/ad4s1a
# mount -t ufs /dev/ufs/NEWROOT /mnt
# cd /mnt
# dump -0auL -C 32 -f - / | restore -rf -

When this is run in single-user mode, the partiion mounted at /mnt
should have a copy of the root filesystem.  Repeat the dump-restore pipe
for other filesystems, e.g.:

# newfs -L NEWDATA /dev/ad4s2a
# mount -t ufs /dev/ufs/NEWDATA /mnt/data
# cd /mnt/data
# dump -0auL -C 32 -f - /data | restore -rf -

# newfs -L NEWHOME /dev/ad4s3a
# mount -t ufs /dev/ufs/NEWHOME /mnt/home
# cd /mnt/home
# dump -0auL -C 32 -f - /home | restore -rf -

...

When you have dumped all your filesystems to properly mounted graft
points under /mnt, update /mnt/etc/fstab and boot the new disk.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Bash lockups

2010-05-21 Thread Giorgos Keramidas
On Fri, 21 May 2010 09:30:05 -0700, Carl Johnson ca...@peak.org wrote:
 Giorgos Keramidas keram...@ceid.upatras.gr writes:
 Does this lock-up happen if you leave the shell 'idle' for too long
 over an ssh session?  There may be problems with stateful connection
 tracking between your terminal and the remote shell :-/

 No, I don't think that could be the problem.  I am just using ssh
 between local machines and there is no firewall between them.  It also
 often seems to happen to a shell as I switch away from it to another
 one.  One suspicion is that something is sending a signal to the shell
 as it switches, and bash sometimes doesn't handle that signal
 properly.

 I also should have mentioned that I have been running bash as my
 default shell for years under Linux and have never seen this problem
 there.

 Thanks for the suggestion.

That's ok.  If you can attach to the bash process with ktrace please try
to grab a ktrace file from a deadlocked shell.  We may be able to see
why it gets deadlocked by running kdump(8) on the shell trace file.

You can run a second shell under ktrace (and hope that the parent
doesn't deadlock before the traced child shell), by running:

bash$ ktrace -f bash.trace bash --login

When you exit from the child shell you can dump ktrace(8) events from
the bash.trace file with:

bash$ kdump -f bash.trace  logfile 21

Looking near the last records dumped in 'logfile' should be quite
informative if the process is dead-locked or spinning around the same
code over and over again.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Bash lockups

2010-05-20 Thread Giorgos Keramidas
On Wed, 19 May 2010 16:14:52 -0700, Carl Johnson ca...@peak.org wrote:
 I have been experimenting with FreeBSD for a while, and I consistently
 get bash lockups at irregular intervals when it is otherwise idle.  By
 lockup, I mean that it stops responding to the keyboard and uses 100%
 CPU.  It will sometimes go for days with no problems, but I had two
 yesterday, and other today.  They have occurred on test systems
 running in VirtualBox and on a real computer, both i386 and amd64
 images, and a mixture of 7.1, 7.3 and 8.0.  They usually seem to
 happen when I am switching tabs in konsole or switching shells in
 screen, but other times I think they happen when I am not even using
 the system.  The only thing I have found I can do is to do a kill -9
 and start a new shell.

Does this lock-up happen if you leave the shell 'idle' for too long over
an ssh session?  There may be problems with stateful connection tracking
between your terminal and the remote shell :-/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Suspect results from iostat--FBSD bug?

2010-05-05 Thread Giorgos Keramidas
On Wed, 5 May 2010 07:34:55 -0500, Peter Steele pste...@maxiscale.com wrote:
 We use iostat to collect statistics of hard drive activity. We've been
 seeing some values for the transaction wait column that look
 suspicious. This is easy to reproduce by just running iostat
 repeatedly over a short period of time, as I show below. Notice the
 third from last column. From what I understand, when run in this
 fashion the values displayed are averaged over the system uptime. I'd
 expect then for the transaction wait value to not take these sudden
 dips. Is there an explanation for this?

 # for ((i=1; i =100; i++)); do iostat -dxI ad8|tail +3; sleep 5; done
 ad8  10291.0 569044.0 151986.0 10164944.0 4294967295  47.7  93
 ad8  10304.0 570070.0 152012.0 10185395.0 4294967295  47.6  93
 ad8  10312.0 571047.0 152028.0 10204575.0   85  47.5  93

This looks like a bug in iostat.  4294967295 == 2 * 32 - -1

It seems that some call returns (unsigned long)-1, e.g. to indicate a
failing system/library call but iostat still prints the result:

: keram...@kobe:/home/keramida$ cat -n demo.c
:  1  #include limits.h
:  2  #include stdio.h
:  3
:  4  int
:  5  main(void)
:  6  {
:  7  (void)printf(-1 = %lu\n, (unsigned long)-1);
:  8  return 0;
:  9  }
: keram...@kobe:/home/keramida$ cc demo.c
: keram...@kobe:/home/keramida$ ./a.out
: -1 = 4294967295
: keram...@kobe:/home/keramida$

Which _precise_ version of FreeBSD are you using?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: newsyslog not reading /ect/rc.conf arguments?

2010-05-05 Thread Giorgos Keramidas
On Wed, 5 May 2010 08:01:26 -0700, Paul Hoffman phoff...@proper.com wrote:
 Greetings again. Running FreeBSD 8.0, I have added the following to 
 /etc/rc.conf:

   newsyslog_flags=-a /usr/old-log/

 I have stopped and started newsyslog. However, the rotated logs are
 still being written into /var/log. No errors appear in
 /var/log/messages or in dmesg.

How did you start newsyslog?  There's an rc.d script that should *read*
the flags from rc.conf:

/etc/rc.d/newsyslog start

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: reoeating, which port offers blog-style feedbak?

2010-04-27 Thread Giorgos Keramidas
On Mon, 26 Apr 2010 14:48:49 -0700, Gary Kline kl...@thought.org wrote:
 Guys,

 I'm creating another virt website and intend to publish things that
 users could respond to.  It is also time to rethink my JOTTINGS
 thoughts and put each of the 15 sections|chapters into a format where
 readers could give feedback.  Whether we have all the ports is one
 question; whether these would be portable to the Linux or MAC OS-10,
 are other issues.

One of the ways to foster a community around a set of writings is to set
up a small special-purpose Wiki.  There are dozens of Wiki engines and
different implementations out there.  Some of them include support for
exotic and complex authentication setups.  Others thrive precisely on
the *lack* of user accounts and permissions.

For a set of jottings that are mostly personal thoughts written with the
express purpose of inviting commentary, or even editing, enriching and
powerful contributions by others, I'd definitely go the way of a Wiki.
It is one of the ways that works admirably well when inviting others to
write in a collaborative, co-operative, and community-driven spirit.

I personally like the OddMuse wiki engine.  It's what I run as the main
page of my laptop's http://localhost/ interface.  There are many other
Wiki engines out there though.  Have a look at the Wikipedia page that
lists Wiki implementations and pick one that you like.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: version/revision control software for things mostly not source

2010-04-18 Thread Giorgos Keramidas
On Sun, 18 Apr 2010 23:34:19 +0300, Dan Naumov dan.nau...@gmail.com wrote:
 I've looked at SVN and it looks reasonably easy to grok, but reading
 the Version Control with Subversion book... it seems there is no
 actual way to truly erase/delete/destoy/purge a part of an existing
 repository? This sounds rather weird and annoying. What if I decide
 that project XYZ is beyond redemption and abandon it, I delete the
 working copy of it, but all history is still in there, gigabytes upon
 gigabytes of data. With no way to remove it, it sounds like a really
 big limitation.

svndumpfilter may help.  It also helps if you give each project it's own
repository, but then the administration costs of setting up all the
separate repositories are going to be non-negligible.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: setting sendmail.mc options?

2010-04-12 Thread Giorgos Keramidas
On Mon, 5 Apr 2010 03:53:18 -0700, Jeff Hamann 
jeff.ham...@forestinformatics.com wrote:
 I'm sure this isn't the correct place for this question, but I'm not
 sure where to go as I only use my FreeBSD Unleashed to admin my
 sendmail.

 I'm a newbie at this and could use a little help.

 I'm trying to configure sendmail, using the freebsd port, to only
 relay mail once a day (I hate emails every few minutes), and if
 possible to hold outbound mail in the que (I think there's some que)
 until some fixed time (like 7am) so that all my mail is transferred
 then.

 I've tried adding:

 #sendmail_flags=-bp -q480m and
 #sendmail_flags=-q120m

 after my

 sendmail_enable=YES

 and that didn't seem to work.

There are different options for each instance of Sendmail:

  $ grep 'sendmail.*flags' /etc/defaults/rc.conf
  sendmail_flags=-L sm-mta -bd -q30m # Flags to sendmail (as a server)
  sendmail_submit_flags=-L sm-mta -bd -q30m -ODaemonPortOptions=Addr=localhost
  sendmail_outbound_flags=-L sm-queue -q30m # Flags to sendmail (outbound 
only)
  sendmail_msp_queue_flags=-L sm-msp-queue -Ac -q30m
  $

So you have to set the sendmail_xxx_flags of the daemon you are using,
instead of the global sendmail_flags.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to make man pages

2010-04-12 Thread Giorgos Keramidas
On Mon, 12 Apr 2010 16:49:04 +0800, Fbsd1 fb...@a1poweruser.com wrote:
 For the questions list archives:
 I wrote an How To  Creating a manpage from scratch.

 You can read it here.

 http://www.daemonforums.org/showthread.php?t=4602

 Thanks to all the people who replied to my post.

Nice post.  This is exactly the sort of post that raises the signal to
noise ratio in web-based forums.  Good job writing it :-)

You should probably try to grok some of the semantic markup requests
like .Op too though.  For example this part:

: SYNOPSIS
:  jail [-dhi] [-J jid_file] [-l -u username | -U username] [-c | -m]
:  jail [-hi] [-n jailname] [-J jid_file] [-s securelevel]
:   [-l -u username | -U username] [path hostname [ip[,..]]

Is commonly written in several lines.  If you try to read each line
separately they do make sense, e.g.:

.Nm
.Op Fl dhi

Will render as:

jail [-dhl]

with the flag letters displayed in bold text.

The .Op macro wraps everything in [...] brackets.

The .Fl macro marks up 'command flags'.

It takes a bit of practice to write manpages using this sort of markup,
but the displayed output looks great in ascii, PostScript or HTML output
modes.  So it's worth trying to learn more about it.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: perl qstn...

2010-04-06 Thread Giorgos Keramidas
On Sun, 04 Apr 2010 02:01:53 -0700, Gary Kline kl...@thought.org wrote:
 thanks for your url as well and the others to posted.  but it seems
 like overkill since i dont need any explicit option or argument.  i
 just need the script to tell me whether i have an arg or not.
 following is something i've kept in one of my junk drawers from when i
 was learning to write bourne sscripts.  it uses the $[token] syntax
 that determines whether there are Any args on the cmdline.  if not,
 the script prints a message and exits.

 #!/bin/sh
 if [ $# -eq 0 ]
 then
 echo No args; need filename.
 else
 echo $1
 fi

 After a couple hours experimentation, the following does the same for my
 perl scripts:


 #!/usr/bin/perl
 $argc = @ARGV;
 if (! $argc ) {
 printf(No args; need filename.\n);
 }
 else {
 printf(%s\n, @ARGV);
 }

Yes, that's very close to the sh(1) version.  Perl's behavior in this
case is described in the 'perlvar' manpage:

   @ARGV   The array @ARGV contains the command-line arguments intended
   for the script.  $#ARGV is generally the number of
   arguments minus one, because $ARGV[0] is the first
   argument, not the program's command name itself.  See $0
   for the command name.

In other words, when @ARGV appears in scalar context it yields the
'size' of the @ARGV array, e.g.:

% cat foo.pl
printf(%d .. args = [%s]\n, int(@ARGV), join(', ', (@ARGV)));

% perl foo.pl
0 .. args = []

% perl foo.pl 1
1 .. args = [1]

% perl foo.pl 1 2 3
3 .. args = [1, 2, 3]

So when int(@ARGV) is zero you know that there are no arguments at all.

This means you can write your sh version like this in Perl:

#!/usr/bin/perl

if (int(@ARGV) == 0) {
die No args; at least one filename expected;
}
printf(%s\n, join(' ', (@ARGV)));

This is good enough as a command-line handling trick for really simple
scripts, but you should probably have a look at the Getopt::Std and the
Getopt::Long modules for longer scripts.  Using them will make your
option parsing code much cleaner and easier to change in the future.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to make man pages

2010-03-31 Thread Giorgos Keramidas
On Wed, 31 Mar 2010 15:54:25 +0800, Fbsd1 fb...@a1poweruser.com wrote:
 OK i want to write a man page from scratch. So lets say i want to use
 /usr/share/man/man2/jail.2.gz as my starting sample. How do I convert
 this .gz file to a plain text file so I can edit it with ee? And how do
 I turn the edited text file back in to a man page .gz file?

The manpage sources are plain text files with text that uses formatting
macros from the groff_mdoc(7) macro collection.  You can find sample
files for the style commonly used by the FreeBSD manpages in your
'/usr/share/examples/mdoc' directory.

keram...@kobe:/usr/share/examples/mdoc$ ls -ld *[0-9]
-r--r--r--  1 root  wheel  - 3550 18 Μαρ 01:55 example.1
-r--r--r--  1 root  wheel  - 7582 18 Μαρ 01:55 example.3
-r--r--r--  1 root  wheel  - 3302 18 Μαρ 01:55 example.4
-r--r--r--  1 root  wheel  - 7700 18 Μαρ 01:55 example.9
keram...@kobe:/usr/share/examples/mdoc$

Installed manpages can be found under '/usr/share/man/man?'.  They are
usually compressed with gzip(1) to save some space, but you can extract
any manpage to a plain text file with gzip or zcat:

zcat /usr/share/man2/jail.2.gz | more

The source of a manpage commonly uses _many_ formatting macros from the
groff_mdoc(7) collection.  You should probably print a copy of the
'groff_mdoc' manpage and keep it around for reference.  Reading through
this printed copy of the manpage at least once will be useful too, as it
will help you understand how macro options work and you will have a good
idea of what features are available.  Then you will be able to quickly
look in the printed reference copy for the features you need, because
you will know they are there.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: emacs-23.1_3,1 - 23.1._4,1 upgrade

2010-03-30 Thread Giorgos Keramidas
On Mon, 29 Mar 2010 11:22:12 +0200, n dhert ndhert...@gmail.com wrote:
 There was an emacs upgrade in the ports today, but it fails:
 ...
 image.o(.text+0x6674): In function `png_load':
 : undefined reference to `png_check_sig'
 image.o(.text+0x6db4): In function `png_load':
 : undefined reference to `png_check_sig'

On Mon, 29 Mar 2010 09:31:56 +, George Liaskos geo.lias...@gmail.com 
wrote:
 I had the same problem with x11-fm/thunar, png_check_sig got replaced
 by png_sig_cmp in libpng 1.4.0.

Right.  The new libpng version has png_check_sig - png_sig_cmp.

I am testing a patch submitted by a few Emacs users and I will try to
commit it during the next few days.  In the meantime you can also test
the same patch for Emacs by fetching the patch from PR ports/145171.

It appears to work for editors/emacs on i386.  I will be testing
editors/emacs-devel and editors/emacs22 too in the next few hours.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to send a patch in a proper way?

2010-03-30 Thread Giorgos Keramidas
On Fri, 19 Mar 2010 23:20:49 +0100, Adam PAPAI w...@wooh.hu wrote:
 Hi,

 As of today I'll try to help and create bugfix patches for usr/src and
 usr/ports.

 I've already done 2 patches and posted it to the -current list but
 don't really know what is the best way to post the patches. Who will
 check them? who will make the decision to use them? How should I
 send the patches? diff -u full path or relative path?

 Is there any FAQ about this issue?

The appropriate path is often a judgement call for you.  I usually send
patches that include at least *part* of the pathname, e.g. when patches
for ports are created I diff at the toplevel /usr/ports tree, so that
both the port-categogy and the port-name are visible in the patch file.

When generating patches for the /usr/src tree it is also useful to see
the relative path under /usr/src, e.g. I try to use:

cd /usr/src
diff -ruN bin/ls.orig bin/ls

When the pathname of the source subdirectory is trivial to infer from
the name of the utility itself you can also just diff files inside the
source of the utility itself:

cd /usr/src/bin/ls
diff -u ls.c.orig ls.c

You shouldn't worry too much about pathname context though.  The FreeBSD
developers will ask for more details if they cannot understand what you
are patching.  A couple of email iterations later you'll both know what
is being patched where it was patched, and so on.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Custom Kernel to Memory Stick

2010-03-30 Thread Giorgos Keramidas
On Mon, 29 Mar 2010 10:49:08 -0500, Jay Hall jh...@socket.net wrote:
 Ladies and Gentlemen,

 I have been asked to explore the possibility of booting FreeBSD from a
 memory stick.  This was not a problem; worked great when installed  from
 the distribution CD.

 What would be the best way to get our custom configuration onto the
 memory stick?

The fastest way I know is to create an image to an 'image' file stored
on disk or ramdisk and then dd the image to the USB disk.  You can
create a suitably large image with truncate(1), e.g.:

truncate -s 1g /var/tmp/image.bin

Then attach the image to an mdconfig device:

mdconfig -a -t vnode -u 20 -f /var/tmp/image.bin

Create a filesystem on it, and install everything from your buildworld
and buildkernel run:

fdisk -BI /dev/md20
bsdlabel -w -B /dev/md20s1
newfs -U /dev/md20s1a

Mount the new image partition before installkernel+installworld:

mount -t ufs /dev/md20s1a /mnt

Then you sould be able to install with DESTDIR pointing to the image
partition:

cd /usr/src
env DESTDIR=/mnt make installkernel installworld

Don't forgte to use mergemaster with -D /mnt to install the /mnt/etc
files from /usr/src/etc.  Then tweak the /mnt/etc/fstab file to point at
the USB disk as the root filesystem.

Finally detach the image and write it on a USB disk:

umount /mnt
mdconfig -du 20
dd if=/var/tmp/image.bin of=/dev/da0 bs=4m

One of the nice tricks you can use for the root filesystem of the USB
disk is to add a UFS label to the USB root filesystem.  This way you
don't have to assume that the USB root filesystem is called da0s1a but
you can use /dev/ufs/LABELNAME in the fstab file of the image partition.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: sendmail UTF-8

2010-03-24 Thread Giorgos Keramidas
On Tue, 23 Mar 2010 13:29:27 +0100, Matthias Apitz g...@unixarea.de wrote:
 Hello,

 I want to sendout mail the following way:

   sendmail -t  filename

 where the file 'filename' contains some header lines, especially To:
  Subject: and From:  and as well the body of the mail; all is in UTF-8
 and I know I have to encode the header lines and says something about
 the body. With Perl it goes like this:

  #!/usr/bin/perl

  use utf8;
  use Encode;

Since you are using perl, it may be more useful to start from something
like mail/p5-MIME-Lite instead of rolling your own.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: make buildworld runs out of space

2010-03-17 Thread Giorgos Keramidas
On Wed, 17 Mar 2010 17:38:06 -0700 (PDT), Bill Tillman btillma...@yahoo.com 
wrote:
 I have built two machines with 8.0-STABLE-201002-amd64. When I updated
 the sources and ran make buildworld process it would fail claiming
 that / was full.

 It seems to be running into the problem when the make installkernel
 portion of my script was running. Both machines were built using the
 default of 512M for /. I rebuilt the machines with 1G / and all was
 well. But one shouldn't have to do this as 512M for / should be
 adequate.

Yes it's adequate for *one* kernel.  But it's often too limited for a
couple of kernels (e.g. /boot/kernel.old and /boot/kernel).

My /boot has two kernels now, and they are build with debugging symbols
so they take a bit more space, but the following is a sample du run:

$ du -hsx /boot/kernel* /boot
136M/boot/kernel
136M/boot/kernel.old
273M/boot
$

With 273 MB for kernels, there has to be adequate space for the *rest*
of the root filesystem files too.  With 512 MB you are very close to
having just enough space, but it's not certain if e.g. your /tmp
already contains a few dozen MB of temporary files.

As you found out, 1 GB of root filesystem space is ok for now :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: mailing list archive as mbox

2010-03-07 Thread Giorgos Keramidas
On Sun, 07 Mar 2010 12:08:32 +0100 (CET), Alexander Best alexbes...@wwu.de 
wrote:
 Dan Nelson schrieb am 2010-03-07:
 In the last episode (Mar 07), Alexander Best said:
  hi there,

  what are the steps i need to perform to get a copy of the entire
  mailingslist
  archive of lets say freebsd-current@ in mbox format?

 Go to ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/
 where you
 can download weekly gzipped archives of all the mailing lists since
 their
 creation.

 thanks for the hint, but it would take hours to download all those gzipped
 files, extract them and merge them.

 i really need ALL the messages of a mailinglist. of course i could use the
 gzipped files you mentioned if i had some script for downloading extracting
 and merging all those files for me.

It's relatively easy to hack one.

You can get a list of year names from the /archive/ directory itself
with curl(1) and a small amount of Python plumbing around curl:

 from subprocess import Popen as popen, PIPE
 import re
 yre = re.compile('^d.*\s(\d+)$')
 devnull = file(/dev/null)
 def years():
... curl = curl -o /dev/stdout 
ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/;
... ylist = []
... for line in popen(curl, shell=True, stdout=PIPE, 
stderr=devnull).stdout.readlines():
... m = yre.match(line)
... if m:
... ylist.append(int(m.group(1)))
... return ylist
...
 years()
[1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 2006, 2007, 2008, 2009, 2010]

Then you can grab a list of the freebsd-current archives by looping
through the list of years and looking for the list of files that match
the pattern:


ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/{year}/freebsd-current/(\d+.freebsd-current.gz)

Using a pipe to parse the output of curl you can collect a list of all
the files that match this pattern, e.g.:

 def yearfiles(year):
... base = 
ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/%4d/freebsd-current;
 % year
... curl = curl -o /dev/stdout %s/ % base
... flist = []
... fre = re.compile(r'^.*\D(\d+.freebsd-current.gz).*$')
... for line in popen(curl, shell=True, stdout=PIPE, 
stderr=devnull).stdout.readlines():
... m = fre.match(line)
... if m:
... flist.append(%s/%s % (base, m.group(1)))
... return flist
...
 yearfiles(1994)
[]
 yearfiles(1995)

['ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/1.freebsd-current.gz',
 ...]

Concatenating the file lists of all years and fetching each one of them
with curl is then trivial:

 ylist = years()
 ylist
[1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 
2006, 2007, 2008, 2009, 2010]
 flist = []
 for y in ylist:
... f = yearfiles(y)
... flist = flist + f
...
 len(flist)
785

Once you have the list of all the remote gzipped files, you can loop
through the list of files once more and fetch them locally.  I'm only
going to fetch the first two files here, but feel free to fetch all of
them in your version of the script:

 flist = flist[:2]
 flist

['ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950101.freebsd-current.gz',
 
'ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950226.freebsd-current.gz']


 from subprocess import call
 def getfile(url):
... out = os.path.basename(url)
... retcode = call([curl, -o, out, url], stderr=devnull)
... if retcode == 0:
... print fetched %s % url
... return tuple([url, out, retcode])
...
 map(getfile, flist)
fetched 
ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950101.freebsd-current.gz
fetched 
ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950226.freebsd-current.gz
...

[('ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950101.freebsd-current.gz',
 '19950101.freebsd-current.gz', 0),
 
('ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/1995/freebsd-current/19950226.freebsd-current.gz',
 '19950226.freebsd-current.gz', 0)]


A slightly hackish script that collects all this to a more usable whole
but lacks LOTS of error checking is the following:

#!/usr/bin/env python

from subprocess import call, Popen as popen, PIPE
import os
import re
import sys

devnull = file(/dev/null)
yre = re.compile('^d.*\s(\d+)$')
fre = re.compile(r'^.*\D(\d+.freebsd-current.gz).*$')

def years():
curl = curl -o /dev/stdout 
ftp://ftp.freebsd.org/pub/FreeBSD/doc/mailing-lists/archive/;
ylist = []
for line in popen(curl, shell=True, 

Re: Compiler Flags problem with core2 CPU

2010-03-03 Thread Giorgos Keramidas
On Tue, 2 Mar 2010 23:26:20 +0200, Dan Naumov dan.nau...@gmail.com wrote:
See the section 3.17.14 Intel 386 and AMD x86-64 Options in the gcc
Info manual.  It contains a full list of the supported CPU-TYPE values
for the -mtune=CPU-TYPE option.  The -march=CPU-TYPE option accepts the
same CPU types:

`-march=CPU-TYPE'
 Generate instructions for the machine type CPU-TYPE.  The
 choices for CPU-TYPE are the same as for `-mtune'.  Moreover,
 specifying `-march=CPU-TYPE' implies `-mtune=CPU-TYPE'.

 Hello
 Out of curiosity, what is the optimal -march= value to use for the
 new Atom D510 CPU: http://ark.intel.com/Product.aspx?id=43098 ?

I'm not sure.  'nocona' seems a pretty close match:

_nocona_
  Improved version of Intel Pentium4 CPU with 64-bit
  extensions, MMX, SSE, SSE2 and SSE3 instruction set
  support.

Without actually trying -march=nocona on one of these I can't
tell for sure if it is 'optimal' or not though.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Compiler Flags problem with core2 CPU

2010-03-02 Thread Giorgos Keramidas
On Sun, 28 Feb 2010 20:38:45 +0800, Aaron Lewis aaron.lewis1...@gmail.com 
wrote:
 Hi,
I gonna recompile kernel for my core2 CPU , so i'd like to pass some
 flags to gcc.
Kinds of -march=core2 , i tried to modify /etc/make.conf
e.gCFLAGS += -march=core2 -O20 -ffast-math -mfpmath=sse
But it fails .. bad arch switch , core2 cpu is not supported ?

And is that useful to let gcc select cpu specified asm code ?

See the section 3.17.14 Intel 386 and AMD x86-64 Options in the gcc
Info manual.  It contains a full list of the supported CPU-TYPE values
for the -mtune=CPU-TYPE option.  The -march=CPU-TYPE option accepts the
same CPU types:

`-march=CPU-TYPE'
 Generate instructions for the machine type CPU-TYPE.  The
 choices for CPU-TYPE are the same as for `-mtune'.  Moreover,
 specifying `-march=CPU-TYPE' implies `-mtune=CPU-TYPE'.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Compiler Flags problem with core2 CPU

2010-03-02 Thread Giorgos Keramidas
On Sun, 28 Feb 2010 22:37:27 +0800, Aaron Lewis aaron.lewis1...@gmail.com 
wrote:
Paul B Mahol wrote:
On 2/28/10, Aaron Lewis aaron.lewis1...@gmail.com wrote:
 Hi,
 I gonna recompile kernel for my core2 CPU , so i'd like to pass some
 flags to gcc.  Kinds of -march=core2 , i tried to modify
 /etc/make.conf

 e.gCFLAGS += -march=core2 -O20 -ffast-math -mfpmath=sse
 But it fails .. bad arch switch , core2 cpu is not supported ?

 It is bad idea to compile kernel with custom flags. And gcc in FreeBSD
 doesn't know about core2,
 use 'native' if you must.


 And is that useful to let gcc select cpu specified asm code ?

 Only for some userland stuff like openssl.

 Really ? It's bad to use custom flags to compile kernel , why do you
 think so ?  I'd like to know more about this : )

 So setting optimize compiler flags is only useful for userland stuff ?

Please do not post your reply on *top* of the original text to this
list.  The preferred form of replying is bottom-posting here (other
lists may have their own rules, but that's ok).  I've fixed this message
manually, but it would be nice if you posted your reply to the bottom of
the quoted text.

You can definitely *try* using optimizations for the kernel too.  The
FreeBSD developers and other users cannot _force_ you to use only a very
limited set of options.  You are more than free to try new things.  This
is precisely the reason why we make the source tree available to
everyone, including detailed instructions for rebuilding the entire
system from source.

Note that the kernel is a very special program that may or may not work
with some of the optimizations performed by higher GCC levels, though.
There may be problems, so if you start building optimized kernels please
make sure you keep a 'safe' backup copy of /boot/kernel before you
install a new one.  This way you will at least be able to boot into the
old kernel if anything breaks.

One way to keep a backup copy of the kernel is to make sure your /boot
partition has enough free space and type as root:

# cp -a /boot/kernel /boot/kernel.safe

Then if anything goes wrong, you can always break into the loader prompt
and type:

boot unload

boot set module_path=/boot/kernel.safe;/boot/modules

boot load kernel

boot boot -s

Note that any optimization levels higher than the defaults are not
'supported' by the FreeBSD team though.  As the warning in make.conf
says [/usr/share/examples/etc/make.conf]:

  # CFLAGS controls the compiler settings used when compiling C code.
  # Note that optimization settings other than -O and -O2 are not recommended
  # or supported for compiling the world or the kernel - please revert any
  # nonstandard optimization settings to -O or -O2 -fno-strict-aliasing
  # before submitting bug reports without patches to the developers.

So if you start building highly-optimized kernels and userland binaries,
you are on your own.  Bumping in any problem will require that you
revert to the standard optimization flags, rebuild everything, try to
reproduce the problem again and *then* report it.

- Giorgos

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Mailing lists link in handbook redirects to......

2010-02-26 Thread Giorgos Keramidas
On Fri, 26 Feb 2010 14:22:32 +0100, Leslie Jensen les...@eskk.nu wrote:
 If I do

 host lists.freebsd.org
 lists.freebsd.org is an alias for wwwdyn.freebsd.org.
 wwwdyn.freebsd.org has address 69.147.83.38
 wwwdyn.freebsd.org has IPv6 address 2001:4f8:fff6::26
 wwwdyn.freebsd.org mail is handled by 0

 And then use the url

 http://69.147.83.38/mailman/listinfo/freebsd-emulation

This is quite wrong.  You are being redirected through DNS to a bogus
FreeBSD.org host name alias.

Can you run tcpdump as root and collect all UDP and TCP traffic for port
32 (DNS) on your main network interface?  For example, if your main NIC
is em0 you can run:

# tcpdump -i em0 -nvv -s 2000 -w dns.pcap '(udp or tcp)  port 53'

Then run the same host/dig commands, stop tcpdump and either make the
pcap file available online somewhere or email us with the output of:

# tcpdump -n -l -e - -vv -s 2000 -r dns.pcap

The output of the final command should be a text dump of he captured
traffic, including any Ethernet headers from your host to the local
gateway.

It will also help if you can tell us what your IP address is (although
that's probably relatively easy to guess from the DNS requests of the
dumped traffic).

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: NetBSD 5.0 looks cool

2010-02-20 Thread Giorgos Keramidas
On Thu, 18 Feb 2010 07:32:20 -0800 (PST), Abdullah Ibn Hamad Al-Marri 
wearab...@yahoo.ca wrote:
 Giorgos Keramidas keram...@ceid.upatras.gr wrote:
 NetBSD needs a *very* minimal set of POSIX tools to build, e.g. you can
 get away with an sh(1) utility and a pretty basic make(1) tool.  They
 have really done a magnificent job at constructing a build system that
 can bootstrap itself from a tiny set of build tools.

 FreeBSD also has _some_ of the necessary build glue to do similar sort
 of stuff, but AFAIK we only support cross-building from one FreeBSD
 architecture to another FreeBSD architecture.  So you need to have at
 least *some* version of FreeBSD to build another.

 How about these bench vs FreeBSD?!

 http://www.netbsd.org/~ad/50/img11.html
 http://www.netbsd.org/~ad/50/img13.html
 http://www.netbsd.org/~ad/50/img15.html

NetBSD 5.0 is indeed a major step forward for NetBSD.  This presentation
was what convinced me to give NetBSD a try back when 5.0 came out.  I
have been running it at home for a while now.

The only systems I have at home right now are FreeBSD and NetBSD.  There
are both nice systems; I like both of them and it's very nice to see how
BSD is definitely *not* dying by using the various BSDs and seeing how
they keep moving forward :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: NetBSD 5.0 looks cool

2010-02-18 Thread Giorgos Keramidas
On Thu, 18 Feb 2010 14:09:54 +0530, Masoom Shaikh masoom.sha...@gmail.com 
wrote:
 here is excellant intoduction to NetBSD-5.0

 http://www.netbsd.org/~ad/50/img0.html

 certain statements are very impressive in those slides like Build any
 NetBSD platform from any POSIX environment
 $ uname -s -m
 Linux i686
 $ cd netbsd-src
 $ ./build.sh -m sparc64 release

 develop and test 32 bits apps on 64 bit env
 cc -m 32

 does FreeBSD has those two features ?

NetBSD needs a *very* minimal set of POSIX tools to build, e.g. you can
get away with an sh(1) utility and a pretty basic make(1) tool.  They
have really done a magnificent job at constructing a build system that
can bootstrap itself from a tiny set of build tools.

FreeBSD also has _some_ of the necessary build glue to do similar sort
of stuff, but AFAIK we only support cross-building from one FreeBSD
architecture to another FreeBSD architecture.  So you need to have at
least *some* version of FreeBSD to build another.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: HELP! Is that possible creating a user named root but acturally not the administrator root

2010-02-11 Thread Giorgos Keramidas
On Thu, 11 Feb 2010 08:04:00 +, Matthew Seaman m.sea...@black-earth.co.uk 
wrote:
On 11/02/2010 05:23, Giorgos Keramidas wrote:
On Thu, 11 Feb 2010 00:18:30 -0500, Robert Huff roberth...@rcn.com wrote:
Lin Taosheng writes:
  Is that possible to implementated?

 For most purposes, what's important is not the account name,
 but the User II.  Root is special because it has UID 0.  You can,
 create other accounts with UIS 0 ... but it's usually a Very Bad
 Idea.

 As far as I know, there's no reason you can't rename the root
 account and have a non UID 0 account with that name.  On the other
 hand, if you're asking this question there may be a better way to
 accomplish your objective: would you care to share?

 The kernel doesn't really care what your user *name* is.  See for
 example the 'toor user in '/etc/master.passwd'.

 On the other hand, lots of software expects the superuser account to
 be called 'root' because that what it always has been ever since
 Thompson and Ritchie et al. first created Unix.  Changing the name of
 the superuser account, and making root into an unprivileged user will
 cause you much wailing and gnashing of teeth.  It doesn't really buy
 you much in terms of improved security in any case.  Far better to
 concentrate on making it impossible for the existing root account to
 be compromised.

This is a good point.  One can argue that the specific applications are
those that are broken if they do not use a tunable option to switch the
name of the 'privileged user'.  But that doesn't negate the fact that
precisely *this* type of applications exists out there and will break.



pgpeEzPfM6FxC.pgp
Description: PGP signature


Re: python script to backup installed packages

2010-02-11 Thread Giorgos Keramidas
On Thu, 11 Feb 2010 10:15:12 -0600, Adam Vande More amvandem...@gmail.com 
wrote:
 Sometimes you have need to backup installed packages.  I realize most
 port management tools do this automatically, but if you're on a system
 with a lot of packages installed and one port management tool fails
 and you use another to fix it, /usr/ports/packages can become jumbled.

 Anyways, I've written a simple python script which will create a fresh
 snapshot of all installed packages.  These are convenient for backups
 or installing on a new system.

 For anyone interested:

 from subprocess import Popen, PIPE
 import os
 s = Popen('pkg_info -a | grep : | grep
 Information',shell=True,stdout=PIPE).communicate()[0]

 pkg_location = '/data/packages'

 packages = []
 for line in s.split('\n'):
 info = line.replace('Information for ', '').replace(':','')
 packages.append(info)

 os.chdir(pkg_location)

 for package in packages:
 s = Popen('pkg_create -b ' +
 package,shell=True,stdout=PIPE).communicate()[0]

Nice script!

My own version was initially written in sh(1) to avoid having a Python
dependency.  Then I rewrote it in Python too.  FWIW, you can probably
save a few replace() calls and avoid the need for a full array of all
the packages by yielding the package names:

from subprocess import PIPE, Popen as popen

def listpackages():
for l in iter(popen(pkg_info, shell=True, 
stdout=PIPE).stdout.readline, ):
yield l.split()[0]

for p in listpackages():
dostuff(p)

My own version groks an os.environ['EXTRA_PKG_CREATE_ARGS'] option too
and inserts the extra options before the [-b, package] arguments of
pkg_create, so that I can run the script for example with:

env EXTRA_PKG_CREATE_ARGS='-Rvn' ./savepkg.py

This way package dependencies are saved too (-R option), the output of
the `pkg_create -b' command is slightly more verbose, and saving the
same package multiple times doesn't overwrite existing packages of the
same version (-n option).

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: python script to backup installed packages

2010-02-11 Thread Giorgos Keramidas
On Thu, 11 Feb 2010 20:35:16 -0600, Adam Vande More amvandem...@gmail.com 
wrote:
 Thanks for the tips, I may add some of your functionality to my own.
 I think I might add a couple more features like accepting a backup
 path from the command line and an auto create for the dir if it
 doesn't exist.  One other thing that might be useful is for it to
 automatically create an install script for the backed up packages
 which takes into account dependencies.  Almost have a package
 management system like some other unnamed OS's then. ;)

This is bordering on creeping featuritis, so I would probably avoid
going there.  If you *have* a backup of the packages, you can start by
installing portupgrade.  Then you can point portupgrade at the package
archive and use the -PP option to install all the dependencies.

Then you can avoid all that and just use something like:

cd /mnt/backup/packages/All
pkg_add vim-lite\*tbz

This will automatically install any packages vim-lite needs, as long as
they are available in the current working directory.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: How to create a FreeBSD 8.0 boot CD without boot.flp?

2010-02-10 Thread Giorgos Keramidas
On Wed, 10 Feb 2010 23:35:17 +0200, Manolis Kiagias son...@otenet.gr wrote:
On 10/02/2010 11:10 μ.μ., Pierre-Luc Drouin wrote:
 I would like to create a boot CD using FreeBSD 8.0 but I just noticed
 that there is no existing boot.flp file for 8.0. What is the
 alternative to get a boot image to create my CD image?

 You just use the boot/cdboot file from the official CD/DVD, like this
 (to write to a DVD)

FWIW, cdboot is also available at /boot of an already installed system
and it's built as part of the buildworld process, so you don't really
need to download a CD or DVD image to get it:

  % ls -l /boot/cd*
  -r--r--r--  1 root  wheel  1201 Feb  6 01:33 /boot/cdboot

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: HELP! Is that possible creating a user named root but acturally not the administrator root

2010-02-10 Thread Giorgos Keramidas
On Thu, 11 Feb 2010 00:18:30 -0500, Robert Huff roberth...@rcn.com wrote:
Lin Taosheng writes:
  Is that possible to implementated?

 For most purposes, what's important is not the account name,
 but the User II.  Root is special because it has UID 0.  You can,
 create other accounts with UIS 0 ... but it's usually a Very Bad
 Idea.

 As far as I know, there's no reason you can't rename the root
 account and have a non UID 0 account with that name.  On the other
 hand, if you're asking this question there may be a better way to
 accomplish your objective: would you care to share?

The kernel doesn't really care what your user *name* is.  See for
example the 'toor user in '/etc/master.passwd'.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FreeBSD's UFS vs Ext4

2010-02-09 Thread Giorgos Keramidas
On Mon, 8 Feb 2010 12:58:07 -0700, Chad Perrin per...@apotheon.com wrote:
On Mon, Feb 08, 2010 at 03:00:00PM +, Frank Shute wrote:

 AFAIK, the system compiler is going to be clang in the future and for
 ports you'll install a compiler from ports.

 Can you provide a URL for some discussion of this?  I hadn't heard
 that FreeBSD was moving to Clang.

There are no concrete plans to ditch gcc from the base system.

The GPLv3 license of GCC and binutils does pose a few interesting
problems.  On the other hand, Clang is a nice project, whose license
*is* compatible with a BSD-style license.  Several FreeBSD developers
have tried building the base system with it and are active at the
development forums of Clang.

So it's probably a safe assumption to make that Clang is not ready
*yet*, but may be an interesting alternative to GCC in the near future.



pgp1WqULYU9TE.pgp
Description: PGP signature


Re: A question on syntax in /etc/login.conf

2010-02-01 Thread Giorgos Keramidas
#secure method=pgpmime mode=sign
On Mon, 01 Feb 2010 12:00:59 +0100, Leslie Jensen les...@eskk.nu wrote:
 On the page

 http://www.se.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html

 Syntax is shown as:

 language_name:accounts_title:\
 :charset=MIME_charset:\
 :lang=locale_name:\
 :tc=default:

 If I look in the file on a newly installed 8.0-RELEASE it shows:

 russian|Russian Users Accounts:\
 :charset=KOI8-R:\
 :lang=ru_RU.KOI8-R:\
 :tc=default:

 Is it the colon or pipe sign that is correct?
On Mon, 01 Feb 2010 12:16:06 +, Matthew Seaman 
m.sea...@infracaninophile.co.uk wrote:
 Probably the latter.  The '|' symbol is used when there are several
 alternative names for the same object -- this is not used much in
 /etc/login.conf, unlike /etc/termcap.  By convention, the last name in
 a list of alternates like this is a comment rather than a tag for
 actual use.  See getcap(3) for details.

 The first entry is syntactically correct -- 'accounts_title' would be
 a boolean value (set to true if present, false if absent) -- but the
 login.conf man page knows nothing of 'accounts_title' and it's a funny
 name for a boolean. So I guess that's likely to be a typo in the
 handbook.

Yes, this is a typo in the Handbook.  I just committed a fix for the
typo in revision 1.132 of doc/en_US.ISO8859-1/books/handbook/l10n/chapter.sgml

  
  revision 1.132
  date: 2010/02/01 12:52:51;  author: keramida;  state: Exp;  lines: +2 -2
  Fix typo in login.conf example.  The aliases for login.conf entries are
  separated by the main name with a pipe '|', and there is no support for
  an accounts_type key in the database.  Use a whitespace-separated name
  in the example, to indicate that it's ok to have spaces in login.conf
  entry aliases.

  Noticed by: Leslie Jensen, leslie at eskk.nu,
  Matthew Seaman, m.seaman at infracaninophile.co.uk
  

Thanks for bringing this to our attention :)



pgpKvTRasllSK.pgp
Description: PGP signature


Re: make doesn't see changes in /etc/mail/freebsd.mc

2010-01-28 Thread Giorgos Keramidas
On Thu, 28 Jan 2010 16:59:16 +, Anton Shterenlikht me...@bristol.ac.uk 
wrote:
 I've seen this behaviour for years, but never bothered
 to ask why.

 Imagine I already have in /etc/mail local .mc and .cf files. Imagine I
 then update freebsd.mc. When I run make nothing happens. What I think
 should happen is that local .mc should be updated and then .cf
 generated.

 Because of this behaviour I have to manually delete local .mc files
 and all .cf files before running make.

Or merge your local changes *into* the local.mc file.  For example, I
have several dozen lines of local customizations in HOSTNAME.mc here:

r...@kobe:/etc/mail# diff -u freebsd.mc kobe.mc | diffstat -p1
 kobe.mc |  167
 
 1 file changed, 126 insertions(+), 41 deletions(-)

I would be very annoyed if updating freebsd.mc clobbered these :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FreeBSD sources from svn repos

2010-01-25 Thread Giorgos Keramidas
On Mon, 25 Jan 2010 15:51:26 +, Masoom Shaikh masoom.sha...@gmail.com 
wrote:
 Hi List,

 I am confused about FreeBSD versions maintained in svn repos

 1. http://svn.freebsd.org/base/releng/8.0/
 2. http://svn.freebsd.org/base/release/8.0.0/
 3. http://svn.freebsd.org/base/stable/8/

 (2) is easy, most probably it means stable

 how about (1) and (2)

You got confused a bit.  Here's a slightl better description of all
three paths:

http://svn.freebsd.org/base/stable/8/

This is the same as the tag RELENG_8 in CVS.  It is the 'stable
branch' and is receiving commits that are in all the branches of the
8.X series.

http://svn.freebsd.org/base/releng/8.0/

This is the 'security branch' for release 8.0.  The security-officer
takes over this branch when our release engineer are done with the
preparation of the 8.0-RELEASE.  This is essentially the same as the
RELENG_8_0 branch in CVS.

http://svn.freebsd.org/base/release/8.0.0/

This is essentially a 'tag'.  It is a copy of the stable/8 branch at
the point where the 8.0-RELEASE was cut.  This is the same as the
RELENG_8_0_0_RELEASE tag in CVS.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Setting zfs_arc_max value in FreeBSD 8.

2010-01-19 Thread Giorgos Keramidas
On Tue, 19 Jan 2010 14:49:15 +0530, Sherin George l...@sheringeorge.co.cc 
wrote:
 Hello,

 I am trying to tune ZFS file system by setting zfs_arc_max value in
 FreeBSD 8.

 In solaris, it is achieved like this

 ==
 ===
 For example, if an application needs 5 GBytes of memory on a system with
 36-GBytes of memory, you could set the arc maximum to 30 GBytes,
 (0x78000 or 32212254720 bytes). Set the zfs:zfs_arc_max parameter in the
 /etc/system file:

 set zfs:zfs_arc_max = 0x78000

 or

 set zfs:zfs_arc_max = 32212254720
 =

 But, I couldn't find /etc/system file in FreeBSD.

 Could some one please guide me to correctly configure zfs_arc_max in
 FreeBSD 8.

You have to use /boot/loader.conf in FreeBSD.  Here's a snippet from
mine, for example:

  # Mount the root filesystem from ZFS.
  vfs.root.mountfrom=zfs:kobe/bootfs

  # ZFS tuning.
  vm.kmem_size=800M
  vm.kmem_size_max=800M
  vfs.zfs.arc_max=150M
  vfs.zfs.vdev.cache.size=15M
  vfs.zfs.prefetch_disable=1

  # Autoloaded modules.
  zfs_load=YES

You can read more about the ZFS support of FreeBSD (including options
like these) at our wiki:

  http://wiki.freebsd.org/ZFS
  http://wiki.freebsd.org/ZFSQuickStartGuide

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: vi editing

2010-01-15 Thread Giorgos Keramidas
On Fri, 15 Jan 2010 07:37:49 -0800 (PST), gahn ipfr...@yahoo.com wrote:
 Hi gurus:

 I am trying to add a word on every line (right in front of every line) via 
 vi. Right now I have:

 x
 x
 x

 after that, I want to have:

 new word x
 new word x
 new word x

 How could I do that with vi?

:%s/^/new word /

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: What happened to /home?

2009-12-27 Thread Giorgos Keramidas
On Wed, 23 Dec 2009 23:11:12 -0800, Charlie Kester corky1...@comcast.net 
wrote:
 On Wed 23 Dec 2009 at 22:33:20 PST Giorgos Keramidas wrote:
 I can still login as regular user, and when I run 'pwd -P' the output is
 / and then it goes back to the prompt.  Output of 'ls -ld /home is:

 lrwxr-xr-x  1 root wheel 8 Dec 18 12:08 /home - usr/home

 That's your problem right there.  /home does not point to the absolute
 path of '/usr/home' but to a *relative* path starting at whatever
 happens to be your current directory when you access '/home'.

 Are you sure about that?

On Thu, 24 Dec 2009 08:57:11 +0100, Erik Trulsson ertr1...@student.uu.se 
wrote:
 Wrong. Relative paths in symlinks start at the symlink is in, not the
 current directory. I.e. that the symlink is relative should not be a
 problem.  (Under AmigaOS relative symlinks worked as you describe, which
 made them a PITA and fairly useless, but under Unix relative symlinks have a
 more sane behaviour.)

On Thu, 24 Dec 2009 10:12:21 +0100, Polytropon free...@edvax.de wrote:
 That's quite strange... I have /home@ - export/home and /export lives
 on another partition. But I have no problems accessing files as
 /home/poly/some/dir/some/file from wherever I am.  As far as I
 understood, relative symlinks prefix their respective targets always
 with their own location, so /home + export/home gives /export/home.

You are all right, of course.  I shouldn't post moments before jumping
on a bus without testing.  Something else is the real problem.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: What happened to /home?

2009-12-23 Thread Giorgos Keramidas
On Wed, 23 Dec 2009 15:40:13 -0800, Rem P Roberti remeg...@comcast.net wrote:
On 2009.12.24 00:21:47 +, Pieter de Goeje wrote:
On Thursday 24 December 2009 00:01:11 Rem P Roberti wrote:
 Today I booted my laptop and discovered that /home was gone.
 Well...not exactly..but for all intents and purposes.  The system
 isn't seeing it although I can see it when I cd to /.  But if I try
 and cd to /home from there the system tells me home:Not a
 directory.  What happened, and what can I do about it?

 Usually /home is a symlink to /usr/home. Perhaps the symlink is
 busted? What it the output of `ls -ld /home' ? If you can still login
 as a regular user, what does `pwd -P' say just after you are logged
 in?

 I can still login as regular user, and when I run 'pwd -P' the output is
 / and then it goes back to the prompt.  Output of 'ls -ld /home is:

 lrwxr-xr-x  1 root wheel 8 Dec 18 12:08 /home - usr/home

That's your problem right there.  /home does not point to the absolute
path of '/usr/home' but to a *relative* path starting at whatever
happens to be your current directory when you access '/home'.

Try replacing your current /home symlink with a link to /usr/home
instead:

# cd /
# rm -f home
# ln -s /usr/home home

Then the symlink should start working in a more useful manner.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: editing a binary file

2009-12-18 Thread Giorgos Keramidas
On Fri, 18 Dec 2009 01:29:18 +, Anton Shterenlikht me...@bristol.ac.uk 
wrote:
 My bet would be /usr/ports/editors/hexedit. Been a while since I've
 used it, but AFAIR, it has a curses or a curses like interface, and
 it's fairly simple to use, yet sufficiently powerful for most normal
 binary editing. If you want a GUI, I believe gnome (and probably KDE
 as well) has its own hex editor.

 thank you. hexedit does the job on small files, but is quite
 clunky. If I've a xGB file and I need to delete the first and the last
 record, this becomes quite hard, if at all possible.

 I didn't appreciate it's not that simple.

 Perhaps I can read a file with C and write back? I can't remember if C
 supports binary files, and whether it also writes some record
 delimiters.

Yes, C supports binary files and does not insert spurious 'record
delimiters' unless you instruct it to do so.  It may even be possible to
use one of the scripting languages (Perl or Python) to do the same work.
It's often easier to hack together a solution if you don't have to worry
about some of the details C will require.

I don't know how your record delimiters look like, but here's a small
sample of how Python can read a binary file of 32 bytes and strip the
last 2 bytes of each 16-byte record:

A binary file of two 16-byte records may look like this:

  keram...@kobe:/tmp$ hd binfile 
    b6 b0 fc 58 96 48 56 d5  e9 10 f0 55 55 67 87 5d  |...X.HVUUg.]|
  0010  b0 c9 8b 49 db 53 26 28  57 d6 62 0d d5 1b c4 dc  |...I.S(W.b.|
  0020

Reading the file in chunks of 16 bytes and stripping the last 2 bytes of
each record from Python is only a few lines of code:

  keram...@kobe:/tmp$ python
  Python 2.6.4 (r264:75706, Dec  3 2009, 23:31:07)
  [GCC 4.2.1 20070719  [FreeBSD]] on freebsd9
  Type help, copyright, credits or license for more information.
   ifp = file('binfile')   # open input file for reading
   ofp = file('outfile', 'w')  # open output file for writing
   for rec in range(2):# we'll transfer 2 records
  ... bytes = ifp.read(16)# of 16 bytes each
  ... obytes = bytes[0:14]# strip the last two bytes of each 
record
  ... ofp.write(obytes)   # push to the output file
  ...
   ifp.close() # close input
   ofp.close() # close output
  

The output file now looks like this:

  keram...@kobe:/tmp$ hd outfile
    b6 b0 fc 58 96 48 56 d5  e9 10 f0 55 55 67 b0 c9  |...X.HVUUg..|
  0010  8b 49 db 53 26 28 57 d6  62 0d d5 1b  |.I.S(W.b...|
  001c

This is 4 bytes smaller than the original file, and the last two bytes
of each 16-byte record are gone.  Bingo!

Now this example is really a very small and contrived sample of what you
can do.  This script lacks serious error-checking too, and it may be
slightly more involved if you have variable record sizes.  But the
general idea is that it *is* possible to hack together something that
loads and processes binary data.  As long as you know the on-disk format
of the records you are reading, anything goes.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Have not received emails for a few days now....

2009-12-17 Thread Giorgos Keramidas
On Thu, 17 Dec 2009 13:28:41 -0500, jw011235 jw011...@gmail.com wrote:
 Interesting. I assumed it was a gmail issue because my openvpn mailing
 list on the same gmail account disappeared at the same time.  Clearly
 bad to assume...

There was indeed a problem with mailman's handling of posts directed at
freebsd-questions.  I notified postmaster@ after checking the list's web
interface.  My mailbox had no messages, which could have been a local
issue or an intermediate delivery problem.  When we realized that the
web interface had no new messages either, the postmaster team took care
of the problem.

Things should be back to normal, AFAICT, but it won't hurt to drop me or
postmaster a note if you notice anything out of the ordinary.

Cheers,
Giorgos



pgpfL0yIr8y32.pgp
Description: PGP signature


Re: is this getting out?

2009-12-17 Thread Giorgos Keramidas
On Thu, 17 Dec 2009 12:49:10 -0800, Gary Kline kl...@thought.org wrote:
 But aristotle is halted and I am back into learn mode.

This sentence probably belongs in a fortune cookie collection
somewhere.  Hah! :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


  1   2   3   4   5   6   7   8   9   10   >