Tweak or add modem initialization strings

In BeOS R4 and prior, adding a custom initialization string to BeOS entailed editing /boot/beos/etc/modems.ppp. Since this is technically a system-level file, doing so was technically a bug in the operating system, since users should never have to touch system-level files. In R4.5, this situation is rectified with the addition of a new dialog to the DUN panel.
If your modem doesn’t appear in the DUN modems picklist, click the Custom button and give your modem a name (the manufacturer and model would be a good choice). From here, you have two ways to proceed. If you already know your modem’s initialization string (e.g. you’ve got the modem’s documentation or you’ve found the manufacturer’s web site), you can simply type or paste it into the dialog and click OK. You may want to search through the massive database of init strings at http://www.modemhelp.org/.
058.CustomModem
If you can’t find the init string for you modem, you can try and build a string from scratch. Some of the most basic modem commands are accessible from the new AT commands picklist, while advanced documentation is now provided by Be and can be accessed by clicking the AT Commands… button.

Note: New modems are not added to the modems.ppp file, but are stored in configuration files living in the ~/config/settings/DUN hierarchy.

If you already have a working modem but want to add commands to the existing init string, the same dialog will let you make changes to your existing modem.
The instructions below are for users of BeOS R4 and earlier.


Many (in fact, most) modems not listed by default in the Dial-Up Networking panel can be made to work in BeOS by adding their initialization strings to /boot/beos/etc/modems.ppp. Adding a section or new modem to this file will cause it to appear in the DUN panel. (See also Ultimate init string database).
However, this file is write-protected, so you’ll need to give the file write permissions before you can edit it, then turn them off again when you’re finished. You can do this with the SetPerms Tracker add-on, or via the shell’s chmod command. Alternatively, see the tip Simplified read/write permissions.

  1. Open a Terminal window and cd to /boot/beos/etc.
  2. Type chmod a+w modems.ppp
  3. Open modems.ppp in your favorite text editor.
  4. Add a line at the top that reads similar to „MyModem ATZ“ with your init string in place of ATZ. If there are any spaces in the modem’s name, replace them with underscores.
  5. Save and close the file.

You will need to find a working init string for your modem to make the change useful. The easiest way to find a working init string is to steal it from another operating system on the same computer. Alternatively, read the modem’s manual or check the vendor’s Web site.

 

Create a Win95/BeOS Boot Menu

[Editor’s note: It’s far easier and slicker to use BeOS‘ bootman to manage a multi-boot system than it is to do it through Windows, which isn’t friendly to multiple operating systems. This tip is here for the curious or masochistic user only.]
Win95 includes a menu of boot options that you can access by hitting F8 when you see „Starting Windows 95“ during startup. However, it’s not hard to create a custom menu that will let you choose between DOS, Windows 95, and BeOS. Your custom menu can also be set to boot straight into any of these choices after a given number of seconds. Note that many parts of this process can be done with TweakUI, which you can download for free from Microsoft. I think it’s useful to know what’s going on though, so here are instructions for doing it manually. You’ll also get a much higher degree of customization if you do it manually.
To make this work, you’ll need to get three DOS files all talking to each other: autoexec.bat, which specifies what processes to launch automatically; config.sys, which specifies things about your system configuration (such as loading CD-ROM drivers), and msdos.sys, which specifies things about how to launch Windows95 before the GUI comes up. The first two go all the way back to the earliest versions of DOS, while msdos.sys was added when 95 came along.
Make backup copies of these three files before modifying them, just to be safe. Since msdos.sys is a hidden, read-only system file, you need to turn off these attributes before you can save any changes to it. If you’re working in DOS, type ATTRIB -H -S -R MSDOS.SYS. If you’re in Win, right-click it and choose Properties, then uncheck those attribute boxes. When you’re done editing this file, you need to turn these attributes back on, or the file will be ignored at boot time. From DOS, type ATTRIB +H +S +R MSDOS.SYS, or recheck the boxes in the Property sheet.
Open up msdos.sys in any text editor (from DOS, type EDIT MSDOS.SYS), scroll down to the [Options] section, and set BootGUI to 0 (zero). If you hate the insipid Windows 95 startup screen, add a line reading Logo=0. Make sure BootMulti is set to 1. Add BootMulti=1 if it doesn’t already exist. If you don’t want the default boot menu to appear (and you probably don’t, since we’re going to replace it), add a line reading BootMenu=0. Save the file and restore its attributes as above.
Open up config.sys and add information about the custom menu you want to create. Just paste this text at the top of the file:

[Menu]
MenuItem = Win95
MenuItem = DOS
MenuItem = BeOS
MenuDefault BeOS,10
MenuColor 15,1
[Win95]
DEVICE=DEVTAISATAP.SYS /D:MSCD000 /N:1
[DOS] DEVICE=DEVTAISATAP.SYS /D:MSCD000 /N:1
[BeOS]

Note that any information that was already in config.sys will need to be moved to appropriate areas of the file. For instance, in this example the CD-ROM driver info is added to both DOS and Win sections so that the CD will be available either way. The BeOS section is empty because Be doesn’t need anything special passed to it from DOS (obviously).
The MenuDefault line says that if you don’t do anything, BeOS will be automatically booted in 10 seconds. Season to taste. The MenuColor line gives you white text on a blue background.
Finally, open up autoexec.bat, where we’ll tell it to run different things depending on what was chosen during the config.sys step. Paste in the example below, then customize to suit your own needs:

@ECHO OFF
SET PATH=C:;C:WINDOWS;C:WINDOWSCOMMAND
GoTo %CONFIG%
@ECHO ON
:WIN95
C:WINDOWSCOMMANDMSCDEX.EXE /D:MSCD000
win
goto end
:DOS
C:WINDOWSCOMMANDMSCDEX.EXE /D:MSCD000
goto end
:BeOS
SET PATH=
beos.bat
:end

Note that :beos section loads the beos.bat file specified in the tip Launch Beos x86 from DOS/Win.
You should be all set. If you got everything right, your machine should boot normally, briefly say „Starting Windows 95,“ then thrown up a blue and white screen giving you a list of operating system choices. You can choose one by choosing its number, or wait ten seconds to boot straight into BeOS (in this example).
And of course you can extend this to add an option for loadlin, if you’re running Linux.
Many thanks to JoshB (joshb@techie.com) and Braden McGrath (dilbert@lightstream.net) for helping to really dial in this process.

 

Launch BeOS x86 from DOS/Win

The BeOS x86 install CD includes a directory called BeLaunch which allows you to launch BeOS by clicking an icon. Even better, it includes a DOS batch file called beos.bat which lets you launch BeOS without having to wait for Windows to load first.
Copy the BeLaunch folder to you hard drive, CD to that folder, and type beos. If everything is set up properly, you should boot straight into BeOS. The included notes say it doesn’t work on dual-processor machines, but it works fine on mine. If it works properly, you’re all set to boot into BeOS without launching Windows.
As your machine is booting, keep your finger on the F8 key. When you see the line „Starting Windows 95,“ hit F8 and choose Command Line Only from the menu to arrive at a DOS prompt. You can now CD to the BeLaunch directory and type beos.
To make it even easier, rename beos.bat to b.bat and move or copy the file into your C: root so you don’t have to CD to the right directory first. Alternatively, add the BeLaunch directory to your path.
To automate all of this even more, see the tip Create a Win95/BeOS Boot Menu.

 

Tweak your menu colors

Some people complain that it’s hard to distinguish pop-up menus with their wealth of offerings from a plain button with it’s single action. Visually both look identical…but.
The BeOS has a nice preference panel: /boot/beos/preferences/Menu which offers the ability to set the menu fonts and their sizes (somewhat). You’ll also find a „Color Scheme“ entry here which lets you set the background of the menus to a new color (the text will remain drawn in black).
Now for the tip: Adjust this background color in some pleasing way (purists might slightly lighten or darken from the original gray (r=g=b=219), while the more bold will do as I and simply reduce the green value to 29), you always have the option of the „Default“ button to get you back to the original.
Any new programs run after this will have the new looking menus, both pop-up and regular. This will make it very simple to tell buttons from pop ups!

 

Mount disks from Terminal

If you’re in Terminal and you’ve just slid a removeable disk into its bay (like a SyQuest, Jaz, or CD-ROM), you don’t have to go digging around in the Tracker menus to mount the new volume in your filesystem. Be has provided us with a much friendlier version of Unix‘ mnt command.
Give your disk a second to spin up, and type mountvolume -r -l. BeOS will scan the system bus and let you know which volumes are either already mounted or are available for mounting. Then all you have to do is type mountvolume diskname where „diskname“ is one of the members of the disk list that mountvolume came up with.
The new volume will be mounted in the root — so if you had a Zip disk called BeZip, you would just type cd /BeZip to access it.

 

Run GUI apps from Terminal

You can actually launch many GUI apps from the command line, as long as they live somewhere in your path (for example, in /boot/beos/apps/) . For instance, just type NetPositive or StyledEdit at the command line to launch them normally. The nice thing is, you don’t have to hunt around for the icon. Even better, you can pass filenames or URLs to these apps as arguments. For instance, to get to this site from the Terminal, type:

NetPositive http://www.betips.net/

Or open a pre-existing text document called „foobar“ by typing:

StyledEdit foobar

You can even open a second Terminal window by simply typing Terminal.
There are times when doing something like this could take over control of the command line for a while. For instance, opening a URL might require first invoking the dialer and then finding the site, during which time you wouldn’t be able to use Terminal. To avoid this, designate the task as a background process by following it with a &. For instance,

NetPositive http://www.betips.net/ & 

will assign a process ID and return control of Terminal to you.
Many apps will also print debug info back to the shell if you start them from the command line rather than from their icons. This can be useful for troubleshooting misbehaved applications.

 

View and change file attributes

In addition to the many standard Unix tools Be has included in /boot/beos/bin, there are also a couple of custom tools that make it easy to view and change a file’s attributes.
To view a file’s attributes from the Terminal, type listattr filename.
However, this will only show you the byte size, name, and type of the attributes. It won’t show you its value (contents). To see contents, use the Tracker Add-On AttributeViewer. To add attributes to a file type addattr fieldname value filename
For example: addattr huey duey foobar will add an attribute named „huey“ with a value of „duey“ to a file called foobar. To remove attributes, use: rmattr fieldname filename. You can get more details on usage by typing addattr –help .
Better yet, check out the following shell scripts that use this and other commands to process multiple files…
email_conv – Email Conversion Package, at
http://www.box.net.au/~jaq/ema il_conv.zip
[Editor’s note: URL no longer functional].
People Porter, at
http://www.betips.net/software/

 

Reducing Deskbar clutter

Do you run a few handy programs (Workspaces, PoorMan, etc.) automatically every time you use BeOS? Have you come to think of these programs as an integral part of the OS experience? Would you rather not have them listed on your deskbar?
If you select any program and go into the FileTypes add-on, you’ll see a little checkbox marked „Background App“. If you close your app, check this, save it, and re-run it, you’ll notice that the app runs, just as before, but there’s no entry for it in the Deskbar!
This tip is also very useful for things like app-launching strips and docks (e.g. DeposIt, Launchpad or ToolDock).
NOTE: Make sure that you have some form of I/O with the program if you intend to hide it, and that you either are comfortable with ps and kill, or have some kind of process control software, when doing this, because if you hide the app, it’s not quite so easy to bring it back without the Deskbar entry! I turn the log file on for PoorMan so that I can check its progress, and I tend to never hide Workspaces, but I have Geb’s ProcessController for quitting it gracefully and allowing a restart if I do so by accident.
The single and multiple launch radio buttons are used to allow or prevent the application from launching multiple copies of itself.

 

BeMail: Select text for quoted reply

If you want to reply to a message in BeMail, and quote only a portion of the message text, select the text you wish to quote BEFORE using cmd-R (or „Reply To Sender“ from the menu). The new mail message window that opens will contain ONLY the text that was selected, and it will be quoted.
This tip also works in BeatWare’s Mail-It.

 

Text files from directory listings

From time to time, you may find it useful to have a text record of a particular directory listing. For instance, you may need to mail a list of all the JPEGs in a project folder, or you may need to send documentation of what’s going on on your hard drive to a software vendor. This is something that Tracker can’t do, but it’s easy with bash (Terminal).
Fine-tune your listing until you’ve got it right, then just use „>“ to redirect the output, then specify a path and filename. For example:
ls -l -R *.jpg > /boot/home/Desktop/jpegs.txt
This will look down recursively from the current directory, creating a detailed listing of files ending with the .jpg extension, then spit the results to a file called jpegs.txt on your desktop.

 
 

Kategorien