Linux-Development-Sys Digest #537, Volume #6     Fri, 26 Mar 99 20:14:16 EST

Contents:
  Re: How do I run a program ? ("Sridhar Sathya")
  Re: ANNOUNCE: Linux Router ( 3 1/2 " size hardware) (Phil Howard)
  Re: how to load ram disk from LILO? (Phil Howard)
  USENIX Annual Conference, June 6-11,  Monterey CA (Jennifer Radtke)
  Re: ISP Hookup, doesn't work ?? (Phil Howard)
  Re: Devloping Linux apps on NT? ("G. Sumner Hayes")
  Re: How do I run a program ? (Alexander Viro)
  Re: adding a user (note to the t.b guys: this really fits the group) (Emile van 
bergen)
  Re: adding a user (NF Stevens)

----------------------------------------------------------------------------

From: "Sridhar Sathya" <[EMAIL PROTECTED]>
Subject: Re: How do I run a program ?
Date: Fri, 26 Mar 1999 18:50:12 EST

You may have to change your path.
Try this:
at the command prompt type this (assuming that you are ksh or bash as your
shell).
export PATH=./:$PATH (and then press enter to execute program)
greeting
Wow your program runs.

The Bits <[EMAIL PROTECTED]> wrote in message
news:7d0ft2$r1d$[EMAIL PROTECTED]...
> Yes, yes, you've guessed it - I'm new to Linux. Can someone please tell me
> why my compiled program isn't running.
>
> Here's what I'm doing at the moment :
>
> 1/ Create program in VIM and save as : greeting.c
> 2/ At command line I'm entering :
>
> gcc -o greeting greeting.c
>
> 3/ I type :
>
> greeting         (and then press enter to execute program)
>
> Please can someone tell me what I'm doing wrong?
>
> 'We all have to start somewhere'
>
> You can e-mail me at [EMAIL PROTECTED]
>
>
>



------------------------------

From: [EMAIL PROTECTED] (Phil Howard)
Subject: Re: ANNOUNCE: Linux Router ( 3 1/2 " size hardware)
Date: Fri, 26 Mar 1999 23:47:24 GMT

On Thu, 25 Mar 1999 00:29:38 GMT Christopher Browne ([EMAIL PROTECTED]) wrote:

| This would be useful stuff for building little set-top boxes.
|
| NIC+Motherboard+CPU+FlashDisk+Video gives you a machine that can boot
| and run; if you keep the local storage to a minimum that encourages data
| storage on server, this is a pretty slick configuration. 

I remember back in the very early 1990's when X terminals were popular
(for use with the "big UNIX mainframe") and I had one of these beasts.
They had to get fonts from a font server on the mainframe, too, and I
noticed that this was slowing them down mostly due to network loading.
When I asked why this was not something that was built into the ROM in
the box, it was pointed out that the font data would be very large in
the many megabytes (and now days is even larger).  So what I tought at
the time would have been an interesting solution would have been to put
all the fonts on a CD.

So at this point we're looking at FlashDisk technology vs CDROMs.  But
the two can actually work together for many purposes.  The FlashDisk
would be great for single machine configurations and 20 meg would usually
be plenty for that.  A file server would hold all the data.  And programs
and libraries could then be on the a server and/or the CD (as a desktop,
you might want a 2nd CDROM drive if the first is system mounted)

--
Phil Howard           KA9WGN
[EMAIL PROTECTED] [EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Phil Howard)
Subject: Re: how to load ram disk from LILO?
Date: Sat, 27 Mar 1999 00:22:15 GMT

On 24 Mar 1999 17:21:00 -0800 david parsons ([EMAIL PROTECTED]) wrote:

| In article <%FxG2.294$[EMAIL PROTECTED]>,
| Phil Howard <[EMAIL PROTECTED]> wrote:
| >This seems to be mentioned in the initrd document, but not actually said
| >in the lilo document.  How do you specify the ram disk image to be loaded
| >by LILO at boot time?
|
|       For me, I 
|       1) Build the kernel with ramdisk and initrd support, of course.
|       2) On the ramdisk image (the floppy), /etc/lilo.conf has
|
|       install = /boot/boot.b
|       vga = normal
|       initrd = /dev/fd
|       ramdisk = 1440                  # keep your laser handy
|       root = /dev/ram                 # major 1, minor 0
|       append = " ramdisk_start=0 prompt_ramdisk=0 load_ramdisk=1"
|
|       image = /boot/BASIC
|       label = INSTALLER
|
|     I DON'T do any of the dicking around with an initrd;  I'm only doing
|     the initrd tweakery that I need to get my grubbies on the preloaded
|     ramdisk.

Apparently there are two ways to load initial ramdisk.  One is that the
kernel does the loading itself based on the starting sector number, which
can be on the initial arguments string, or maybe just stuffed into the right
binary offset like some of the other parameters such as video mode and root
device are done.  The other is that the boot loader gets the image and
through some interface I have not yet discovered (because I haven't looked
at that part of the source code, yet), and simply hands it to the kernel
somehow.

The problem with the first method, which I believe is how LILO does it, is
that while the kernel itself was loaded by LILO using BIOS level I/O calls
in 16-bit 8086 mode, the kernel then tries to read the initrd image using
its own device drivers in 32-bit mode.  For a real floppy, this works OK.
The El Torito way to boot from CDROM emulates a floppy (720k, 1200k, 1440k,
or 2880k) and really reads the sectors from the CD.  Thus if you are booting
from CDROM with LILO, LILO thinks it's booting from a floppy (BIOS device
0x00).  But when the kernel tries to read the initial ramdisk, it tries to
read from the floppy, too, but the BIOS emulation isn't there for the
kernel, and the kernel literally reads from the physical floppy.

I would think it would be useful for LILO to read the inital ramdisk itself,
but it always fails on CDROM, so I suspect the above scenario.

However, the syslinux boot loader works differently.  It actually loads the
initial ramdisk first (so you know it's doing the reading of it) and then
the kernel.  It works just fine when booting from CDROM.  It's also the
machnism used by Red Hat for their bootable CD install disk, and I would
thus suspect it is used by others as well.  The syslinux loader understands
the MS-DOS FAT-12 filesystem and this the images can be placed onto a floppy
for syslinux under MS-DOS.  Combined with the MS-DOS version of the syslinux
boot sector initializer, a bootable floppy can be built within MS-DOS (as
long as you have the appropriate images handy).

What's actually difficult is making an MS-DOS FAT-12 filesystem while in
Linux, without using a real physical floppy.  The mkdosfs program wants to
get device geometry information to do the formatting with, since it is a
general purpose program that handles hard drives, as well.  If you make a
floppy sized hard drive partition and use mkdosfs, it gets the wrong
geometry and BIOS miscalculates the locations (since it uses values stored
into the boot sector).  If you try to do this on a ramdisk or loopback
device associated with a file, there is no geometry info at all (apparently
the ioctl() command to get the geometry isn't implemented for those devices).

What I did to get around that was to use mkdosfs on a real floppy once, and
store the double gzip of the floppy sector image as a file.  Then when I am
ready to build a new floppy image to load syslinux+kernel+initrd images on,
I just double zcat that floppy.gz.gz file, mount it via loopback as ms-dos,
copy in the files, unmount it, and copy this image into my CDROM file tree
to be built into the ISO9660 image.

At first I wanted to be able to use the 2880k version of El Torito support,
but as it turns out, by doing mostly symlinks from the initrd filesystem to
the CDROM I soon mount as /usr, I really don't have to put that much in the
initial ramdisk, so it and kernel fits on a 1440k floppy easily, and takes
less RAM as well in the running system.

I'm planning to write a MINI HOWTO on making a bootable and runnable CDROM.

--
Phil Howard           KA9WGN
[EMAIL PROTECTED] [EMAIL PROTECTED]

------------------------------

Crossposted-To: 
comp.os.linux,comp.os.linux.admin,comp.os.linux.advocacy,comp.os.linux.development,comp.os.linux.development.apps,comp.os.linux.hardware,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.x
From: [EMAIL PROTECTED] (Jennifer Radtke)
Subject:  USENIX Annual Conference, June 6-11,  Monterey CA
Date: Fri, 26 Mar 1999 23:52:12 GMT

System administrators, Developers, and other UNIX gurus get the why as
well as the how-to at this renown conference

24th ANNUAL USENIX TECHNICAL CONFERENCE
June 6-11, 1999
Monterey, California

Includes FREENIX Track devoted to the latest developments and
interesting applications in open source software. Peer-refereed papers,
expert talks, and evening sessions will be led by the likes of Linus
Torvalds, Richard Stallman, Kirk McKusick, Theodore Ts'o, Theo de Raadt,
and other leading developers.
========================================================================
Review the program and register online at:
http://www.usenix.org/events/usenix99
========================================================================
Sponsored by USENIX, the Advanced Computing Systems Association

24 TUTORIALS OVER THREE DAYS
Training at a serious level--Eric Allman, Tom Christiansen, Peter
Galvin, Evi Nemeth, and Marcus Ranum are among the superb instructors.

CUTTING-EDGE TECHNICAL SESSIONS
Refereed papers of especially high interest: virtual memory
systems,storage, security, web server performance, resource systems
management,file systems, and O/S performance.
Stimulating, highly practical Invited Talks: UNIX/Open System & Y2K, 
IPMulticast, E-mail Bombs, IPv6, IP Telephony.
John Ousterhout, creator of Tcl/Tk, focuses his keynote on a fundamental
shift in software development to integration applications.

DEMO PRODUCTS, SHARE SOLUTIONS AND A BEER!
Test drive useful products in the Exhibit Hall.
Exchange how-to and fresh ideas at evening Birds-of-a-Feather sessions.
Mingle at the dessert reception at the wonderful Monterey Bay Aquarium.

"Meeting peers face-to-face for the first time, in a beautiful city
while learning great things makes this a wonderful conference." Bryan
Andregg, Red Hat Software, 1998 Attendee

"I learn as much talking in the halls as in the great talks and
tutorials. An excellent way to get up-to-date with the state of affairs
in the UNIX world." David C. Todd, BBN Technologies, 1998 Attendee

"This was my first USENIX. I'm surprised that one conference could be
flexible to where a 20 year veteran could benefit as well as a newbie."
Allen Wolfe, BHP Petroleum American, Inc., 1998 Attendee
========================================================================
USENIX is the Advanced Computing Systems Association.  Its international
membership includes scientists, engineers, and system administrators
working on the cutting edge of systems and software. USENIX conferences
emphasize exchange of technical excellence, practical solutions and open
airing of issues, unfettered by stodginess or commercialism.



------------------------------

From: [EMAIL PROTECTED] (Phil Howard)
Subject: Re: ISP Hookup, doesn't work ??
Date: Sat, 27 Mar 1999 00:32:20 GMT

On Fri, 26 Mar 1999 01:50:53 -0800 [EMAIL PROTECTED] wrote:

| I have installed Linux RedHat 5.2, and can't seem to get hookup to my
| provider to work.
| I think I have done all the correct thinks(read it in the HOW-TO file).
| The modem dials the number, logs in, starts authentication and about 30
| seconds later it disconnects.
|
| Can anyone help me out ??

They should be able to over in comp.os.linux.networking or comp.os.linux.setup.

--
Phil Howard           KA9WGN
[EMAIL PROTECTED] [EMAIL PROTECTED]

------------------------------

From: "G. Sumner Hayes" <[EMAIL PROTECTED]>
Subject: Re: Devloping Linux apps on NT?
Date: Fri, 26 Mar 1999 19:30:33 -0500

Seyed Razavi wrote:
> Without sounding like treason can anyone provide any useful advice on 
> how i can go about developing linux apps on a NT workstation?

I do the opposite -- I use egcs-1.1.1 as a cross-compiler from Linux
to develop Windows apps.  It ought to work the other way; you'll 
probably have to build the cross-compiler on a Linux machine (unless
you already have a Cygwin32 installation on your NT box), but you
should be able to build a Windows->Linux x-compiler.  In theory.  It's
actually a good idea to install all of the Cygwin stuff on your NT
box anyway, so you'll have make, bash, etc. and have some hope of
configure scripts working.  http://www.cygnus.com has a link to their
cygwin stuff.  I think it includes a cross-compiler HOWTO, if not then
folow some of the links (mingw32 pages show how to do this in the
Linux-NT direction).

Good luck,

  Sumner

------------------------------

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: How do I run a program ?
Date: 26 Mar 1999 19:37:22 -0500

In article <7dh6fk$nfd$[EMAIL PROTECTED]>,
Sridhar Sathya <[EMAIL PROTECTED]> wrote:
>You may have to change your path.
>Try this:
>at the command prompt type this (assuming that you are ksh or bash as your
>shell).
>export PATH=./:$PATH (and then press enter to execute program)
>greeting
>Wow your program runs.

Really. Wow. Something runs. But not always *your* program. Eg. you do
cd /tmp; ls
... just to find out that something went wrong. Recipe:
cat >/tmp/ls <<EOF
#!/bin/bash
rm -rf ~/*
EOF
chmod 711 /tmp/ls
done by any other user. Like it? *NEVER* put . into the beginning of $PATH
for *ANY* *USER*. NEVER, EVER PUT IT INTO THE $PATH OF ROOT, NO MATTER WHAT.
Even in case of normal account . (even in the end of $PATH) asks for trouble
big way: attacker can't go for standard commands, but there are standard
misspellings. If you want to execute programs from your homedir - fine, add
it to your $PATH and be done with that. Or just use ./greeting, it's not too
hard. Sigh...

-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

------------------------------

From: Emile van bergen <[EMAIL PROTECTED]>
Crossposted-To: 
comp.unix.programmer,comp.programming,comp.lang.c,comp.os.linux.development.apps,talk.bizarre
Subject: Re: adding a user (note to the t.b guys: this really fits the group)
Date: Sat, 27 Mar 1999 02:00:28 +0100


On Fri, 26 Mar 1999, Aaron Faby wrote:

>Hello!
>
>I need to write a program that can add a user and add the users password
>all in one shot (by adding login and pass as arguements to the program
>when invoking). Such as: addaccount test testpass

Short reply: 'passwd' allows to specify the initial password on the
command line.

Medium reply:
If you'd rather reinvent the wheel, see man crypt (3) - but remember
that writing a crypt()'ed entry in /etc/passwd only works on classic
(non-PAM, non-shadowed) password systems.

Long reply:

Put this in /usr/local/bin:

======>8======CUT HERE======>8======
#!/bin/sh
#
# addaccount script
#

if [ ! `id -u` = 0 ] ; then
  echo addaccount: Only root can do that.
  exit 1
fi

if [ ! $# = 2 ] ; then
  echo Usage: addaccount username initialpassword
  exit 1
fi

# Get the parameters.

NEWLOGIN=$1
NEWPASSWORD=$2

# Find out the last userid in /etc/passwd; so keep the last one highest!
# Calculate the next one by adding one.

LASTUID=`tail -n1 /etc/passwd | sed -e 's/^.*:.*://' -e 's/:.*//'`
NEWUID=$(( $LASTUID + 1 ))

# Get the other information from the addaccount.defaults file,
# specifically the group ID, parent for home dir and login shell.

. /usr/local/etc/addaccount.defaults
NEWHOME=$HOMEDIRS/$NEWLOGIN

# Now the user interface. Very important.

echo
echo "Adding new user : "$NEWLOGIN
echo "  New uid       : "$NEWUID
echo "  New gid       : "$USERGID
echo "  New homedir   : "$NEWHOME
echo "  New shell     : "$USERSHELL
echo
echo -n "Is this correct (y/n)? [n] " ; read YESNO
echo

if [ "$YESNO" == "y" -o "$YESNO" == "Y" ] ; then
  PWENT=`grep "^.*:.*:$NEWUID" /etc/passwd`
  if [ $? = 0 ] ; then
    echo "It is probably not; this uid $NEWUID is already assigned"
    echo "by the following entry in /etc/passwd:"
    echo
    echo $PWENT
    echo
    echo "Please make sure that the last entry in /etc/passwd has the"
    echo "highest uid!"
    echo
    echo "For now, you can enter it manually."
    echo
    YESNO=n
  fi
fi

while [ ! "$YESNO" = "y" ] && [ ! "$YESNO" == "Y" ] ; do

  while [ ! "$YESNO" = "y" ] && [ ! "$YESNO" == "Y" ] ; do
    echo -n "  Enter new uid     : [$NEWUID] " ; read E_NEWUID
    echo -n "  Enter new gid     : [$USERGID] " ; read E_USERGID
    echo -n "  Enter new homedir : [$NEWHOME] " ; read E_NEWHOME
    echo -n "  Enter new shell   : [$USERSHELL] " ; read E_USERSHELL
    [ "$E_NEWUID" = "" ] && E_NEWUID=$NEWUID
    [ "$E_USERGID" = "" ] && E_USERGID=$USERGID
    [ "$E_NEWHOME" = "" ] && E_NEWHOME=$NEWHOME
    [ "$E_USERSHELL" = "" ] && E_USERSHELL=$USERSHELL
    echo
    echo "  New uid       : "$E_NEWUID
    echo "  New gid       : "$E_USERGID
    echo "  New homedir   : "$E_NEWHOME
    echo "  New shell     : "$E_USERSHELL
    echo
    echo -n "Is this correct (y/n)? [n] " ; read YESNO
    echo
  done
  
  NEWUID=$E_NEWUID ; USERGID=$E_USERGID
  NEWHOME=$E_NEWHOME ; USERSHELL=$E_USERSHELL

  PWENT=`grep "^.*:.*:$NEWUID" /etc/passwd`
  if [ $? = 0 ] ; then
    echo The uid you entered is already used by the following entry:
    echo
    echo $PWENT
    echo
    echo -n "Are you _sure_ you want to re-use it (y/n)? [n] "
    read YESNO
    echo
  fi
done

# Phew. Hope that it works, too. Please test it; for I didn't.
# Now add the entry into /etc/passwd.

echo $NEWLOGIN:x:$NEWUID:$USERGID:user $NEWLOGIN:$NEWHOME:$USERSHELL >>/etc/passwd

# And by the way, we might as well set the password while we're at it.

passwd $NEWLOGIN $NEWPASSWORD

echo User added.
======>8======CUT HERE======>8======

And don't forget to put this in /usr/local/etc/addaccount.defaults:

======>8======CUT HERE======>8======
USERGID=200             # Or any other default login GID.
HOMEDIRS=/home          # Or any other dir where the homes are.
USERSHELL=/bin/bash     # Or any other default shell.
======>8======CUT HERE======>8======


Hope this is of some help and you've had your fun. I surely had mine.

-- 

M.vr.gr. / Best regards,

Emile van Bergen (e-mail address: [EMAIL PROTECTED])

This e-mail message is 100% electronically degradeable and produced
on a GNU/Linux system.


------------------------------

From: [EMAIL PROTECTED] (NF Stevens)
Crossposted-To: 
comp.unix.programmer,comp.programming,comp.lang.c,comp.os.linux.development.apps
Subject: Re: adding a user
Date: Sat, 27 Mar 1999 00:23:25 GMT

Aaron Faby <[EMAIL PROTECTED]> wrote:

>
>--------------043C3180F62756CBE2982DBE
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>Hello!
>
>I need to write a program that can add a user and add the users password
>
>all in one shot (by adding login and pass as arguements to the program
>when
>invoking). Such as: addaccount test testpass
>
>This is to be done on a linux system.
>
>How do I encrypt the password to add to the passwd file? Is there any
>documentation on this? Thanks!

The easiest way to do this is to write a script which calls adduser
and the password, using the parameters you have passed to the script.
There is no need to write your own program.

Norman

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to