Looking for a good foothold to get you started with your BeOS scripting? Chris Herborth wrote an excellent chapter on Scripting for The BeOS Bible. While this chapter did not make it into print due to space limitations, it is available online at www.beosbible.com (you must own the book to access that part of the site). In addition, Herborth wrote a shorter but also excellent introductory piece for the former Be Magazine.
For something a little more hands-on, download TrackerBase — it’s packed with shell scripting tutorials, documentation, and re-usable code snippets.
Most applications running under BeOS 5 support the scroll wheels on most mice. If you want to really burn rubber when scrolling up or down in a web page or document, hold down Opt while you scroll (Opt on PC keyboards is left Win or right Ctrl). This will cause each notch of the wheel to send a PageDown or PageUp, for super-fast scrolling of long documents.
In BeOS 5, fixing broken symlinks gets (a bit) easier. Right click the broken link and choose Get Info (or select the link and tap Alt+I). The Info panel will say „Link to: Broken Link.“ Click on the „Broken Link“ text and a file panel will appear. Navigate to the link’s correct target for the link and the link will be repaired.
If you’re running the Robin Hood web server and want to work with PHP, be aware that the current version of Robin Hood does not natively support the filtering mechanism you need to execute PHP as a standard CGI. You can, however, create a CGI wrapper for PHP that works quite nicely. Here’s how.
Download PHP for BeOS and put the PHP binary in ~/config/bin
. Next, download Jonathan Perret’s CGI wrapper for PHP. Install this in ~/config/bin
as well.
Now, instead of making the first line of your PHP scripts the path to PHP, use the path to the wrapper, with the path to PHP as an argument to that. Therefore, the simplest possible PHP script would look like this:
<?php echo "Hello -- I'm a PHP script!"; ?>
To see this script running on this Robin Hood web server, click here.
To learn more about PHP and Robin Hood, read these In Focus articles by Seth Flaxman at BeNews:
BeOS In Focus: PHP and RobinHood
BeOS In Focus Update: Making PHP Work
Note that Stegemann and Stegemann’s web server diner comes with PHP capabilities built in, though some users have had difficulty getting it to work.
BeOS 5 adds more than 400 new printer description files, which means you can do PostScript printing from many more printers than before. If you have a PostScript printer that’s not listed in the Printer preferences panel, try this:
Go hit the Adobe web site and look around for a Postscript printer definition file (.ppd) for your printer model. If you happen to be a MacOS user, copy the file corresponding to your printer model from the System Folder (System Folder:Extensions:Printer Definitions).
After you download/copy it, make sure it’s got the right line endings — open it up in BeIDE and click on the little „file“ icon in the bottom left corner and choose „Be,“ then save.
Place the file in /boot/beos/etc/ppd/
.
When configuring your printer, choose „Apple Laserwriter Compatible“, and then select your newly-added printer model from the popup.
Hopefully you’ll be able to print now. 🙂
For more information on things you can do to get unsupported printers up and running, see Watts Martin’s article Don’t Give Up on Unsupported Printers at BeNews.
I have a Compaq Proliant 800 system /w dual PPro 200’s, and couldn’t get both CPUs to be detected in BeOS (Pulse showed only one CPU). The solution is to enter the BIOS and select Configure hardware | Edit Details and change the operating system from „Other“ (or whatever else you have in there) to UNIX. Then, on that submenu, choose Linux. Once back in BeOS, both CPUs will be detected and used.
If you’re serving a web site with the Robin Hood web server and want to password-protect specific areas of your site, don’t be confused into thinking that you need the RHDirectoryHandler for this. Instead, you want to implement „Realms.“
There is a small amount of documentation on realms in the RH docs, but you need to read carefully. The key words are „When a resource is requested for which public access has not been granted …“
The trick here is that RH makes what use it can of Be’s multiuser filesystem, even though the OS isn’t yet multiuser. Therefore you can deduce that you need to modify permissions on the directories in question.
To set this up, create a directory on your site called „realmtest“. Then, add a realm line to your virtual_hosts
file, under the server definition (this is important because you can set up multiple servers from the same RH instance) that looks like this:
Realm: name="zero" pattern="realmtest" pattern="*" user="foo" passwd="bar";
This will cause RH to search every URL request for the string „realmtest“ (which is the directory name) and prompt for a user/pass if public access has not been granted for that file or directory. To remove public access on the realmtest directory and the files it contains, open a Terminal and type:
cd <site_root> chmod -R a-r realmtest
(the -R flag on chmod tells it to change permissions on the directory and everything in it, recursively).
Restart the server. When someone tries to access a file in the realmest directory, they’ll be prompted for a username and password, which in this case would be user=foo, pwd=bar.
Did you know that you can look at serial debugging output even if you don’t have anything hooked up to the serial port? The command tail shows you the end of a file, and if you use the -f option it continues showing lines as they are added to the file. If you turned on serial debugging at boot by hitting Delete or F1, you can type
tail -f /var/log/syslog
into a Terminal to watch serial debug output as it happens.
You may also want to check out the kernel settings file in /boot/home/config/settings/kernel/drivers/sample/
. If you make it an active settings file by moving it up to the drivers directory, you can control the behavior of syslog and serial debug output without having to remember which keys to hold down when.
Right-click any file and choose Get Info. As of BeOS 5, the Get Info panel grows several new functions.
Click in the filename in this panel and you’ll get an editable field — you can change the name of the file, folder, or link directly from this panel.
Drag the icon for that file or folder to any location in the Tracker and it will be moved (not copied) there.
Right-click the icon for options relating to that file or folder. If you right-click a folder, you can use the usual hierarchichal navigation to quickly open any subdirectory in the Tracker.
If the panel has directory names listed in blue (denoting Tracker location or symlink target), click them to open those folders in the Tracker instantly.
If you’re getting info on a file rather than a folder or symlink, you’ll get an „Opens With“ picklist from which you can choose a preferred handling application for that file.
Remember, the fastest way to Get Info on any file or folder is to select it and tap Alt+I.
Once in a blue moon, the Be File System may refuse to allow you to delete a file or folder. BeOS 5 includes a new command-line tool called forcerm
, made for just this purpose. Just open a terminal, cd to the location of the stubborn file, and use:
forcerm filename
See also: Check filesystem integrity