MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
November
Sun Mon Tue Wed Thu Fri Sat
   
     
2005
Months
Nov


Mon, Nov 28, 2005 11:07 pm

Bad interpreter: No such file or directory

If you receive the message "bad interpreter: No such file or directory" when attempting to execute a Perl script, it may because the path to Perl is incorrect in the script. You can check the location of the Perl executable with which perl. Some common locations for Perl are shown below:

/uisr/bin/perl
/usr/sbin/perl
/usr/local/bin/perl
/usr/bin/perl5
/usr/local/bin/perl5

The first line of the Perl script should point to the location revealed for Perl by which perl. E.g., if Perl is in /usr/bin, you should see the following line as the first line of the Perl script.

#!/usr/bin/perl

But, if the path is listed correctly in the script, another check to make is that you aren't using a Perl file in DOS format. For instance, if the file was created on a Windows system and was transferred to a Unix or Linux system in binary mode rather than ASCII mode, then the lines in the file may not be terminated properly for the Linux or Unix system. For a Linux or Unix system, each line should be terminated with a newline character, i.e. hexadecimal 0A. A DOS formatted file, i.e. the text file type you would find on a Windows system will use both a carriage return (CR) and line feed (LF), i.e. a hexadecimal 0D followed by a hexadecimal 0A.

If you attempt to run a Perl script which uses the DOS format on a Unix or Linux system, you will likely get the error message ": bad interpreter: No such file or directory"

You can check the line endins with the hexdump command. Below are two example files test.pl and test2.pl, which are identical, except for the line endings.


# hexdump -C test.pl
00000000  23 21 2f 75 73 72 2f 62  69 6e 2f 70 65 72 6c 0d  |#!/usr/bin/perl.|
00000010  0a 0d 0a 70 72 69 6e 74  20 22 68 65 6c 6c 6f 5c  |...print "hello\|
00000020  6e 22 3b 0d 0a                                    |n";..|
00000025
# hexdump -C test2.pl
00000000  23 21 2f 75 73 72 2f 62  69 6e 2f 70 65 72 6c 0a  |#!/usr/bin/perl.|
00000010  0a 70 72 69 6e 74 20 22  68 65 6c 6c 6f 5c 6e 22  |.print "hello\n"|
00000020  3b 0a 0a                                          |;..|
00000023

If you examined the code in a regular editor, you would see the following lines in each file:

#!/usr/bin/perl

print "hello\n";

But, if you tried to execute them on a Unix or Linux system, you would see different results.

# ./test.pl
: bad interpreter: No such file or directory
# ./test2.pl
hello

You can convert a file, e.g. test.pl, to Unix text file format with dos2unix, which is a DOS/MAC to UNIX text file format converter.

dos2unix test.pl

References:

  1. Perl & CGI Tutorial: Your First CGI Script
  2. dos2unix

[/languages/perl] permanent link

Mon, Nov 28, 2005 8:07 pm

List Perl Modules

I encountered a problem with a Perl module not being found when I tried to run a Perl script that required it, even though I thought I had successfully installed that module. I wanted to see a list of all the Perl modules installed on the system. I found a free Perl script list-modules.pl at http://webnet77.com/scripts/list-modules/, which will list all of the Perl modules installed on the system on which it is run. The output of the program is an HTML page listing the modules. So you can put the script in a cgi-bin directory on your Web server to make the information accessible over the web. On a Linux or Unix system, you should use chmod 755 list-modules.pl to first make the file executable.

I did encounter one problem when I first attempted to run the script. I kept getting a ": bad interpreter: No such file or directory" message whenever I tried to run it. That usually indicates the path to the Perl interpreter in the first line of the file is incorrect. When I checked it, I found it was "#!/usr/bin/perl". When I checked Perl's location, I saw it was in /usr/bin/perl.

which perl
/usr/bin/perl

It took me a few minutes to realize that when I downloaded list-modules.zip from the Webnet77 page and then unzipped it on my Linux server, that the extracted Perl file, list-modules.pl, was in DOS format, i.e. the end of every line was terminated with a carriage return and line feed (hexadecimal 0D and 0A) rather than just a line feed (hexadecimal 0A), which is how newlines are indicated on Unix and Linux systems. I spotted the problem when I used hexdump -C list-modules.pl. I used dos2unix list-modules.pl to convert the file to the Unix text file format. I was then able to successfully run the list-modules.pl script.

Download: list-modules.pl

[/languages/perl] permanent link

Tue, Nov 22, 2005 11:42 pm

Symantec AntiVirus - Scan engine returned error 0x2

I updated the virus definitions on all the systems at a site today where Symantec AntiVirus Corporte Edition 8.0 is deployed. I then attempted to start scans on all systems. For the first system, I started a scan from the Symantec System Center, which completed successfully with no viruses detected on the system. I was sitting next to another system, so I started the scan of that system by logging into the local user's account on that system. That scan also ran successfully. There was a third system that was managed by the Symantec System Center where I was unable to start the scan from the server, so I tried starting the scan from the system itself. I also attempted to start the scan while logged into the local user's account on a fourth system that was operating as an unmanaged client. When I attempted to run the scans on the third and fourth systems, the scans failed with the error message below:

Could not start scan. Scan engine returned error 0x2.

I rebooted the fourth system, but that did not resolve the problem. I checked to make sure the Symantec Antivirus Client service was running on the system. Its status was listed as "started".

After a few tests, I found that I could run the scans without the error, if I logged into the local system administrator's account on the two systems where the error occurred. When I started the scans on the third and fourth systems I had been logged into an account in the Power Users group on the third system and a regular user account on the fourth system. But in both cases, I had started the scans by right-clicking on the icon for Symantec Client Security while holding down a shift key and then selected "Run as" and selected the local administrator's account from which to run the scan. But that didn't work. I had to actually log into that account in order to successfully run the scans. In the case of the second system where I had run the scan successfully from the local user's account, that local user account was in the administrators group for that system.

I found someone else reporting the same problem at Some1 PLZ help Symantec AV will not scan. Someone had replied to that poster that rebooting resolved the problem for him, but it didn't help for me. Other URLs listed in replies referred to error messages that didn't match the 0x2 one I saw, so I don't think they were applicable.

[/security/antivirus/symantec] permanent link

Tue, Nov 22, 2005 5:32 pm

VNC Local Loop-back Connections Disabled

I installed TightVNC on a Windows SBS 2003 server in order to be able to remotely manage it from a Unix or Linux host. I had previously installed OpenSSH for Windows on the system so that I could login to the system remotely and check on the system, but I also wanted to have a GUI connection to the system so that I could run programs that can't be run from the command line

From a Unix workstation running Solaris, I entered the command ssh -L 5901:localhost:5900 administrator@192.168.0.5 to establish an SSH connection to the system with port 5901 on the Unix workstation being forwarded to port 5900 on the Windows SBS 2003 server. Port 5900 is the default port for a VNC server and the one I used on the Windows system. However, when I tried to connect to the Windows system with vncviewer by connecting to port 5901 on the Unix system, which then should be forwarded over the SSH connection to port 5900 on the Windows system, I saw the message "Local loop-back connections are disabled."


bash-2.03$ vncviewer localhost:1

VNC viewer for X version 4.0 - built Jun 14 2004 12:04:05
Copyright (C) 2002-2004 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Tue Nov 22 16:08:49 2005
 CConn:       connected to host localhost port 5901
 CConnection: Server supports RFB protocol version 3.3
 CConnection: Using RFB protocol version 3.3

Tue Nov 22 16:08:50 2005
 main:        Local loop-back connections are disabled.

Doing a Google search on the error, I learned I needed to have the registry key HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3 on the Windows system set to a DWORD value of "1". Since I had a command line prompt on the Windows system via the SSH connection, I used the reg query command to check the current value of that registry key. Sure enough, its current value was "0".


C:\Documents and Settings\Administrator>reg query HKEY_LOCAL_MACHINE\SOFTWARE\OR
L\WinVNC3                                                                       
                                                                                
HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3                                         
    ConnectPriority    REG_DWORD    0x0                                         
    DebugMode    REG_DWORD    0x0                                               
    DebugLevel    REG_DWORD    0x2                                              
    LoopbackOnly    REG_DWORD    0x0                                            
    EnableHTTPDaemon    REG_DWORD    0x1                                        
    EnableURLParams    REG_DWORD    0x0                                         
    AllowLoopback    REG_DWORD    0x0                                           
    AuthRequired    REG_DWORD    0x1                                            
                                                                                
HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default                                 

Fortunately, the reg command can also be used to modify the registry from the command line.


C:\Documents and Settings\Administrator>reg add HKEY_LOCAL_MACHINE\SOFTWARE\ORL\
WinVNC3 /v AllowLoopback /t REG_DWORD /d 1                                      
Value AllowLoopback exists, overwrite(Yes/No)? yes                              
The operation completed successfully.                                           

The REG ADD command uses the following syntax:

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

In this case, the parameters used have the following meaning:

/v     The value name, in this case "AllowLoopback", to be added under the selected key.

/t     Allows one to specify the data type, which can be REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_DWORD, REG_BINARY, or REG_NONE. If none is specified, REG_SZ is assumed. In this case REG_DWORD is needed.

/d     The data to assign to the registry ValueName being added, which is "1" in this case.

Another reg query HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3 shows the value was changed.


C:\Documents and Settings\Administrator>reg query HKEY_LOCAL_MACHINE\SOFTWARE\OR
L\WinVNC3 

HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3                                         
    ConnectPriority    REG_DWORD    0x0                                         
    DebugMode    REG_DWORD    0x0                                               
    DebugLevel    REG_DWORD    0x2                                              
    LoopbackOnly    REG_DWORD    0x0                                            
    EnableHTTPDaemon    REG_DWORD    0x1                                        
    EnableURLParams    REG_DWORD    0x0                                         
    AllowLoopback    REG_DWORD    0x1                                           
    AuthRequired    REG_DWORD    0x1                                            
                                                                                
HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default

After modifying the registry value, you then must stop and restart the VNC Server service.


C:\Documents and Settings\Administrator>net stop "VNC Server"                   
The VNC Server service is stopping..                                            
The VNC Server service was stopped successfully.                                
                                                                                
                                                                                
C:\Documents and Settings\Administrator>net start "VNC Server"                  
The VNC Server service is starting.                                             
The VNC Server service was started successfully.    

You should then be able to use vncviewer localhost:1 to access the remote system with VNC. After the message about the protocol version, you should see a VNC Authentication window open.


bash-2.03$ vncviewer localhost:1

VNC viewer for X version 4.0 - built Jun 14 2004 12:04:05
Copyright (C) 2002-2004 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Tue Nov 22 17:07:42 2005
 CConn:       connected to host localhost port 5901
 CConnection: Server supports RFB protocol version 3.3
 CConnection: Using RFB protocol version 3.3

In this case, I was then able to enter the VNC authorization password and then hit Ctrl-Alt-Del on the Solaris system to enter the user name and password for the Windows SBS 2003 server.

References:

  1. Cygwin ssh (OpenSSH), and Win98 - Use "crypt newpassword" to add a password into /etc/passwd

[/os/windows/software/remote-control/vnc] permanent link

Sun, Nov 20, 2005 10:34 pm

Abacast Software Plays Music from Wrong Radio Station

A user reported a problem when switching from one on-line radio station to another. Both stations relied on Abacast streaming media software. I found that terminating the abaclient.exe process or choosing "exit" from the Abacast Client icon in the system tray would allow me to switch to ther other station and hear its music rather than the first station's music.

[ More Info ]

[/music/abacast] permanent link

Wed, Nov 16, 2005 12:47 pm

Mounting a USB Key under Solaris 10

The following steps can be used to mount a USB key under Solaris 10.

Check to see whether a /rmdisk directory already exists.

# ls /rmdisk
zip zip0

In this case, the system, which happens to be a PC running Solaris 10, has a Zip drive and the directory already exists. If it didn't, you would use mkdir /rmdisk to create it.

Insert the USB key, aka flash memory or USB memory, into the system. Stop and then restart volmgmt.

# /etc/init.d/volmgt stop
# /etc/init.d/volmgt start
volume management starting.

You can use the mount command to list the mounted drives and pipe the results to the grep command to search for the USB key or you can just use ls /rmdisk and look for usbmemory.

# mount | grep rmdisk
/rmdisk/usbmemory on /vol/dev/dsk/c3t0d0/usbmemory:c read/write/setuid/devices/nohidden/nofoldcase/dev=1741001 on Wed Nov 16 11:45:28 2005
/rmdisk/zip on /vol/dev/dsk/c0t0d0/zip:c read/write/setuid/devices/nohidden/nofoldcase/dev=1741002 on Wed Nov 16 11:45:30 2005
# ls /rmdisk
rmdisk2 usbmemory zip zip0

You should then be able to find the contents of the USB drive under /rmdisk/usbmemory or perhaps under /rmdisk/unnamed_rmdisk.

[/os/unix/solaris] permanent link

Tue, Nov 15, 2005 11:30 pm

Toolbox Grayed Out in Microsoft Access

When designing a form in Microsoft Access, you can normally access a toolbox that allows you to add buttons, text boxes, etc. by selecting "View" and then "Toolbox". If the toolbox is grayed out when you try to make changes to a form in Microsoft Access, close the database and then hold down the shift key while reopening it.

References:

  1. Toolbox Grayed Out

[/os/windows/office/access] permanent link

Mon, Nov 14, 2005 11:10 pm

Eudora Owner.Lok Remains After Eudora Crash

When I started Eudora 4.2 on Pamela's system, I saw the following:

Remote Instance

An instance of Eudora may be running on a remote computer. Accessing a mailbox from two instances of Eudora may lead to data corruption. Please indicate how you wish to proceed.

[ Exit this instance ]

[ Terminate remote instance ]

[ Continue (I'll accept the consequences) ]

I chose "terminate remote instance". But that just led to Eudora closing. So I looked in the directory where Eudora stores the user's email and found an OWNER.LOK file. Eudora creates the file when it starts to keep two instances of Eudora from modifying the same mail files. But, if Eudora crashes, the file may remain and you may need to manually delete it. I deleted the file.

[/network/email/clients/eudora] permanent link

Mon, Nov 14, 2005 11:04 pm

Intel Pro/100 VE Adapter Lost Settings

Pamela reported that her system no longer had network access. When I checked the IP configuration by issuing "ipconfig/all" at a command prompt, nothing was displayed.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>ipconfig /all

Windows IP Configuration


C:\Documents and Settings\Administrator>

I checked the network card's status under the device manager ("Start", "Control Panel", "System", "Hardware", "Device Manager" from the Windows XP "classic" control panel view). It showed the following for the network interface card:


Intel(R) PRO/100 VE Network Connection

Driver files:
C:\WINNT\System32\DRIVERS\e100b325.sys

Provider: 	Intel Corporation
File version:	8.0.19.0 built by: WinDDK
Copyright:	1995-2004, Intel Corp. All Rights Reserved.
Digital Signer:	Microsoft Windows Hardware Compatibility

Device Instance Id
PCI\VEN_8086&DEV_1039&SUBSYS_4000107B&REV_82\4&29817089&0&40F0

Resource settings:

This device isn't using any resources because it has a problem.

I rebooted the system. But the problem remained the same after rebooting. The "Intel(R) PROSet II" troubleshooting aid was present under "Start", "All Programs", "Intel". It listed the following under "Troubleshooting":

Problem:
The system has not enabled IO address mapping for the device you have installed. The device driver will not work correctly on this adapter.

Possible causes:

PC BIOS is set to Plug and Play.

Possible solutions: Try turning off Plug and Play in the PC BIOS. See your PC manual for instructions on changing your BIOS settings.

When I clicked on the "Next" button, I saw the following:

Problem:
Unable to locate the drivers for this adapter.

Possible causes:

The drivers for this adapter were not installed, or are not installed properly.

Possible solutions:
Use the "Add/Remove Hardware" wizard in the Control Panel to install the drivers for this adapter.

I went into the "Device Manager" under the "Control Panel" again and right clicked on "Intel(R) PRO/100 VE Network Connection", which was under "Network Adapters". I chose "uninstall". I received the message "Failed to uninstall the device. The device may be required to boot up the computer." I tried disabling the device prior to uninstalling it, but that yielded the same results on the uninstall step. So I re-enabled the adapter and tried "update driver" instead of "disable" or "uninstall". When I took that step, I no longer saw a yellow exclamation mark next to the "Intel(R) PRO/100 VE Network Connection". And when I went to a command prompt and issued an "ipconfig/all" command, I saw the expected results, i.e. I saw the expected IP address, subnet mask, gateway, and DNS server addresses.

I checked the "automatic updates" setting on the system and found it set for "automatically download recommended updates for my computer and install them". I changed it to "download updates for me, but let me choose when to install them." This problem was reported to me on Monday, November 14. I did see that updates had been automatically downloaded and installed for the system early in the morning on Friday, November 11.

The updates that were installed Friday were "Security Update for Windows XP (KB896424)" and "Windows Malicious Software Removal Tool - November 2005 (KB890830)". Those updates led to a system reboot, since I saw the entry below listed afterwards:

Restart Required: To complete the installation of the following updates, the computer will be restarted within 5 minutes:
- Security Update for Windows XP (KB896424)
- Windows Malicious Software Removal Tool - November 2005 (KB890830)

I don't believe either of those updates are the likely cause of the problem, however. When I checked the timestamps on files updated by the user's email client, Eudora, I saw they had been updated much later during the day on Friday.

I also noticed the following error in the system event log for November 14:


Event Type:	Warning
Event Source:	PlugPlayManager
Event Category:	None
Event ID:	256
Date:		11/14/2005
Time:		7:54:05 AM
User:		N/A
Computer:	ELLIE
Description:
Timed out sending notification of device interface change to window of "MyTest"

For more information, see Help and Support Center at 
http://go.microsoft.com/fwlink/events.asp.

When I clicked on the link in the event entry, I saw the following:

Details

Product: Windows Operating System
Event ID: 256
Source: PlugPlayManager
Version: 5.2
Symbolic
Name
WRN_INTERFACE_CHANGE_TIMED_OUT
Message: Timed out sending notification of device interface change to window of "%1"

Explanation

A window was registered for Plug and Play device event notification, but it did not respond to the notification within 30 seconds. While Windows was waiting for the device to respond, Plug and Play stopped responding, which caused performance problems.

User Action

If performance problems are associated with this event, close any programs that are running at the same time.


Currently there are no Microsoft Knowledge Base articles available for this specific error or event message. For information about other support options you can use to find answers online, see http://support.microsoft.com/default.aspx.

I don't know of any hardware change that might have been made on the system. I noticed the user's iPod was unplugged. I think it was plugged in previously, but I don't know if that had any bearing on the problem.

[/hardware/network/nic/intel] permanent link

Sun, Nov 13, 2005 11:05 pm

Abacast Streaming Software

A user reported a problem when switching from one on-line radio station to another. She had downloaded Abacast software from a link on one station's site. I couldn't duplicate the problem initially, but did find that a separate download is needed to use the service with Firefox versus Internet Explorer.

[ More Info ]

[/music/abacast] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo