Stupid things on Unix/Linux

The following are a number of stupid things I encountered on unix machines. Most of these problems are much more technical and less strange than the problems with Macintosh. But that may be related to the fact that I use Unix mainly for programming, while I use Macintosh for all desktop stuff (I like Apple's window system): document writing, image preparation, mathematics, email etc.
Note: I'm using mac osx instead of linux and irix since 2003, so these tips are getting a bit obsolete.

SYMPTOMS POSSIBLE CAUSE POSSIBLE SOLUTION
While using vi on a remote unix machine, occasionally (but just too often to be workable) your cursor movements are ignored, instead strange characters are inserted into your text. don't know. Maybe some environment variable? Start an xterm on the remote machine (don't forget to set the DISPLAY to your own terminal) and use the new window for vi.
YP_BINDPROC: domain not bound This vague error indicates that the automounter fails. This means that you don't have access to your files on the fileserver, and therefore that you cannot do anything - even not log in - as you usually have don't any access rights on the local file system. If you have root access: log in as root, and type cd /etc/rc.d/init.d. Then type ./amd stop; ./ypbind stop; ./ypbind start; .amd start. If this still fails try to ping to the fileserver and check"lsmod" to check whether the network driver has been loaded.
If you don't have root access: check if the fileserver is up, and if so reboot your system (ctrl-alt-delete) and hope the best. After 2 or 3 failures I would think it's time to reboot the file server itself...
You get "host or gateway not responding: " or ": connection refused" when trying to rsh . rsh may be disabled because of security reasons Use ssh instead.
You cannot remote log in to a linux machine that you have an account on The machine you try to login from is not mentioned in the file /etc/hosts.allow and/or in $(HOME)/.rhosts Enter the machinename or number in these files, and type /ets/rc.d/init.d/inet restart (you need to be root to change /etc/hosts.allow)
vi uses only part of your window. Scrolling does not work OK the window size that vi assumes does not match the actual window size type "eval `resize`" in your xterm. Note the backquotes around resize.
Using arrow keys in vi sometimes causes strange characters to be inserted. Probably some network congestion problems start vi in a remote window instead of a local window. To do this, type on your local machine
xhost remote_machine_name
rsh remote_machine_name
setenv DISPLAY local_machine_name:0.0
xterm &
and now use the new window that appears after the xterm command.
How to replace carriage returns with newlines in vi somehow the carriage returns cannot be found? It seems that carriage returns are found also when searching for newlines. Try the following
set noai
vi <filename>
:s/<ctrl-v><enter>/<ctrl-v><enter>/g<enter>
How to turn off automatic replies on mails that you're on holiday (turn this on with making a "vacation.msg" file containing your message and giving the command "vacation -i") The suggestion of touching the vacation.msg file does not work on the SGI I worked on. remove the .forward file
You have a table with multiple columns, and pictures with "width=100%" in the cells. The images are scaled at full-page size instead of full-column size when the page is opened, and scaled at column-size only after the window is resized. Bug in Netscape? It is not clear whether this is proper use of html. See my tip on this problem on my mac tips page.
g++ compiler message "undefined reference to `XXX virtual table'" The class XXX has some virtual function(...) that has not been implemented make function pure virtual by appending "=0", thus virtual function(...)=0; or implement the function.
A good point from C++ FAQs Lite:
Many compilers put this magical "virtual table" in the compilation unit that defines the first non-inline virtual function in the class. Thus if the first non-inline virtual function in Fred is wilma(), the compiler will put Fred's virtual table in the same compilation unit where it sees Fred::wilma(). Unfortunately if you accidentally forget to define Fred::wilma(), rather than getting a Fred::wilma() is undefined, you may get a "Fred's virtual table is undefined".
shmget succeeds only when requested very small chunks, for instance it may fail when more than 1Mb is requested while the manuals indicate that the limit is 8 blocks of 4Mb = 32Mb. This problem occurs both in Linux2.0.34 and on SGI Irix6.4. shmget seems very sensitive to the specific key given. If you use ftok to create the key (for instance I saw key=ftok(".",'M') in some example program), the amount of available shared memory may even depend on the specific directory where the program is run. Use a path referring to some stable file, eg "/tmp". I'm not sure whether this solves all problems.
g++ compiler message "In method XXX const
blablabla"
The class is defined const (ie it does not change the object) and therefore the functions it calls have to be const as well Check whether this function really will not change the object.
g++ warning "trigraph(s) encountered" You have in your source code a string starting with two question marks, such as ??= or ??!. These are shortcuts for special characters in ANSI C (see here or K&R page 296?) Replace these with their single-characters equivalent or remove them altogether. (you need -pedantic option with gcc to compile trigraphs). (Thank you Vijo for additional info).
Java comes with message: Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/wouter/workspace/Interpreter/bugfix_prolog/foreignframe/libforeign.so: Can't load IA 32-bit .so on a IA 32-bit platform Java seems to catch a lower-level exception and translates it into this stupid message. What usually is the case is that there is an unresolved link during loading a native c library. Apparently you need to set the LD_LIBRARY_PATH environment var to point to the .so files. Sometimes explicit linking is needed as well. Make sure the LD_LIBRARY_PATH var points to the .so files needed. Furthermore. Turn on the java debugger with "setenv LD_DEBUG libs" and re-run the java program. This time you get lots of debug output. Locate the first error message above the failure.

Updated 30 jan 2001