Debugging shell scripts

All bash shell scripts must begin with the string:‘

 #!/bin/sh

However, if you want to see exactly what’s going on while a script is running, start your script with


instead. The shell will report back to you with every step, making it much easier to see exactly what’s going on (and thus how to fix it if necessary).

 

Getting serial mice recognized

Some machines have difficulty recognizing serial mice. If this is the case on your machine, try one of the following:
1) Disable Plug and Play (PnP) in your BIOS.
2) Set PnP to manual, and then make IRQ 3 and 4 „LegacyISA“ instead of PnP PCI Auto.
Your BIOS may have different terminology to the above, but you should be able to figure it out.
Remember to write down the changes you make so you can go back to the original settings if necessary.

 

BeMail: Leave mail on server

As you probably know, the BeMail client included with BeOS does not include an option to leave mail on the server. If you need this feature, you’re probably best off purchasing one of the several fine commercial mail clients available for BeOS. However, it is possible to hack BeMail to leave mail on the server, though it’s not a complete solution. This tip involves using DiskProbe to alter the mail_daemon binary. As is always the case with DiskProbe, handle with extreme caution. Note also that this will not give BeMail the intelligence to keep track of mail that’s already been downloaded, so you’ll be retrieving all your mail each time you check your POP box. That said, here’s how to do it. Note that this has been tested ONLY on R4.0 x86.
After making a backup copy, drag /boot/beos/system/servers/mail_daemon onto the DiskProbe icon. At offset 0x16E69 you’ll see the DELE command, which is sent to the server to delete a message. Just put a 0x00 (put 00 in the hexadecimal frame, not two „numbers“ zero over D and E) at this offset so you’ll erase the „D“ of „DELE“, mail_daemon is written in C, and is the end of an ASCII string, so the string will not be sent to the server.
Watching the debug window, you’ll see for example that if you have a message on your ISP’s mail server that mail_daemon sends „1“ instead of „DELE 1.“ The POP3 server will answer with an „incorrect command“ response, but will continue. A real hack, but it works :o)

 

Gobe Productive: Real-time font sizing

In Productive’s word processor, „tear off“ the font menu so it becomes a free-standing panel. Select some text, and use the slider on the new font panel — the fonts in your document will be resized in real-time, the rest of the document flowing dynamically around the changed text. Now go try that in MS Weird!

 

Connecting via MSN

If you’re using MSN as your ISP, add the following line to /boot/beos/etc/servers.ppp: (you’ll have to change its write permissions first. See Tweak modem initialization strings for details):

MSN_Login e ogin:s du assword: dw S

You can use winicpfg in Windows to find DNS numbers for MSN and put those in too. Depending on how you connect to MSN you may need to add „MSN/“ before your username.
Do not check static IP in DUN settings.

 

OK to install on a logical partition

[Editor’s note: This tip is from the R3 days. R4 and later installs into a logical partition just fine. However, the bundled version of Partition Magic won’t see logical partitions, so if you want to do this, do your partitioning with a 3rd party tool, format the partition with FAT, and then boot BeOS from floppy and CD and initialize the partition with BFS.]
Although the R3 install manual (correctly) claims that the BeOS won’t install onto extended partitions, it will install into logical drives created in those partitions. Here’s an example (what I did):
Before:

  • 2 GB primary DOS partition (C:) labeled „Win98“;
  • 2 GB extended DOS partition with a logica drive (D:) labeled „BeOSsoon“ (so
    I was optimistic).

To create an 800mb BeOS drive out of D:, I:
1.) Cleared everything off D:.
2.) Ran fdisk to delete the logical drive D:.
3.) Rebooted.
4.) Ran fdisk to create two logical drives, D: („blank“,
1.2Gb) and E: („BeOSnow“, 800Mb).
Then I was able to install the BeOS onto my bus 0, partition 5, which is how that E: space showed up. The BeOS installer will initialize it at the appropriate time, with your permission.

 

NetPositive: Speed launching

NetPositive is capable of incredibly fast launch speeds — well under one second. Unfortunately, the default startup page takes a few more seconds to load (something is weird about it, not sure what). You can speed up Net+ launch speeds by making a plain, blank HTML document and storing it somewhere (I suggest /boot/home/config/settings/NetPositive/home.html). Load up this page, copy its URL to the clipboard, and paste it into the startup page field in NetPositive’s preferences dialog. Close and restart NetPositive and you’ll see exactly how fast it can be!
Actually, you don’t even have to create a blank page and save it to disk. Just erase the contents of the home page path edit field in the N+ preferences window, and nothing will load up when you start NetPositive. However, some people enjoy coding up a light default page with a few custom links, which you can’t utilize with this second method.

 

Change your identd

If you get kicked or banned from an IRC channel, you’ll find it impossible to get back in even if you change your username, nick, and IRC server.
The reason is that the ban applies to your identd, an identification which is provided not by your IRC client, but by the username supplied in your Network preferences panel. This is the same as your FTP/telnet username.
To get back into the channel after a kick/ban, jump offline, change this username, restart networking, and log back in. You’ll be all set.

 

Viewing Acrobat PDF docs

There’s no official port of Adobe Acrobat for BeOS (yet), but there are two different applications which make it possible to view PDF files on BeOS.
By far the most popular is Hubert Figuiere’s BePDF, which handles most (but not all) Acrobat files floating around out there.
Alternatively, download and install Jake Hamby’s Ghostscript viewer. Follow the installation instructions in the readme, and from then on you’ll be able to type

 gs DocumentName.pdf

to bring that file up in the Ghostscript viewer (which handles PostScript and PDF files alike).

 

Autostart folder

To make an autostart folder, first make a directory for this purpose:

 $ mkdir ~/config/autostart

then add these lines to ~/config/boot/UserBootscript:

for program in /boot/home/config/autostart/*
do
	"$program" &
done

Now you may put links to application or shell scripts on the autostart directory, and they will be executed every boot.

 
 

Kategorien

 
 
Blogroll
Resources