EzDevInfo.com

ubuntu-9.10 interview questions

Top ubuntu-9.10 frequently asked interview questions

Making a Ubuntu executable

i have made a program in C using the gcc compiler. Right now it has no GUI components. I am compiling it with makefile and running it in the terminal. I need to deploy it so that the executable is standalone. I want the executable to have an icon and when clicked start the program in the terminal. Can anyone tell me how to do this?


Source: (StackOverflow)

How can I install a new version of gcc on ubuntu

I am using ubuntu 9.10 and it comes with gcc 4.4. How can I install gcc 4.5 without screwing up my gcc 4.4. environment. I just need gcc 4.5 to compile 1 application.

Thank you.


Source: (StackOverflow)

Advertisements

Is it possible to have a common pointer between 2 different programs on the same computer

I need 2 different programs to work on a single set of data. I have can set up a network (UDP) connection between them but I want to avoid the transfer of the whole data by any means.

It sounds a little absurd but is it possible to share some kind of pointer between these two programs so that when one updates it the other can simple get the pointer and start using it ??

I am using Ubuntu 9.10


Source: (StackOverflow)

svnadmin create: Option Expected

Can someone enlighten me on this...

When I uncomment the line in /etc/subversion/config store-auth-creds = no, and when I create a new repo, I see the following error:

svnadmin: /etc/subversion/config:37: Option Expected

I understand that that 37 line is pointing to the store-auth-creds = no option but what option does svnadmin expect now??

Kind of new in SVN.. =) and I'm using Ubuntu 9.1 for my SVN.


Source: (StackOverflow)

PHP memcached Fatal error: Class 'Memcache' not found

I've pasted the example from php.net for using memcached in php and I'm getting:

Fatal error: Class 'Memcache' not found

I have this in my php.ini:

[memcache]
memcache.hash_strategy = "consistent"
memcache.max_failover_attemps = 100
memcache.allow_failover = 1

Here's info from php -i and php -m respectively:

php -i | grep -i memcache
memcached
memcached support => enabled
libmemcached version => 0.37
Registered save handlers => files user sqlite memcached

php -m | grep -i memcache
memcached

So php seems to have loaded memcached as a module, and php info says that it is loaded and is using v .37. I have not tried yet via apache, I've only been using this through cli right now. Any thoughts?


Source: (StackOverflow)

Magento Installation stuck at configuration

I am not sure what is going wrong when I am trying to install magento to my local ubuntu machine. I did all the steps mentionsed in the magento wiki. Everything goes well until I reach the point where I am here which is the magento config page. When I try and continue after entering the necessary details like host, database name and user name and submit it comes back to the same page. I checked for everything like db in my phomyadmin panel and it still gets stuck there. What is the possible reason for that.

Thanks


Source: (StackOverflow)

Error With Port 8080 already in use

Can anyone help me to solve the following case?

I am trying to generate my first web site using java and working with Eclipse Galileo running on Ubuntu 9.10. Since I generate my first lines of code I haven't seen the web. All the time when I try to run the program I get the following error:

Several ports (8080, 8080) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

I have read a lot about the way to change the ports for my tomcat (pass from the 8080 to 80) but it has been impossible. I read some forums where the way to solve this problem is going to the file that contents the server number for tomcat, which is a XML file, but when I open the folder there is not a xml file with the name.

I already explored the port using sudo lsof -n -P -i :, start and shut-down tomcat but the mistake is still there.

What can I do?

Thanks a lot.


Source: (StackOverflow)

nfs client on ubuntu 9.10, /etc/init.d/nfs-common does not exist

This seems like a trivial problem, but I can not find a solution for several days now.

I am trying to configure an nfs client on ubuntu 9.10 (64 bit). All the tutorials I've read say I need to restart a few things, such as portmap, and also nfs-common. Specifically:

sudo /etc/init.d/nfs-common restart

However, this file (/etc/init.d/nfs-common) does not exist.

sudo apt-get install nfs-common

returns "nfs-common is already the newest version."

When I try:

sudo service nfs restart

I get:

nfs: unrecognized service

What am I missing here?

Thank you to the kind soul who can help me with this.


Source: (StackOverflow)

eclipse 3.5.1 (Galileo) with ubuntu 9.10 (Karmic) busted! Can not install maven2 plugin! (Or any other plugin)

I see a lot of stuff online related to fixing buttons that can't be pressed, and fixing network issues with proxies. This seems like a different problem to me, related to jem.util.0.0.0 in the case of maven2 or needed libs for other plugins.

The setup:

Eclipse 3.5.1 (Galileo) installed with apt-get. Ubuntu 9.10 (Karmic Koala) (This is running as a VM, not that is should matter.)

General problem description: Maven2 eclipse plugin installation fails.

Specifically, I can not install maven2 plugin from the eclipse installation flow using this target site: http://m2eclipse.sonatype.org/sites/m2e/

The maven site is found, installation begins, and then returns this error:

Cannot complete the install because one or more required items could not be found. Software being installed: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800\ (org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800) Missing requirement: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 (org\ .maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800) requires 'org.eclipse.jem.\ util 0.0.0' but it could not be found

Official Ubuntu documentation claims eclipse 3.5.1 support, and recommends using the Synaptic Package Manager, and nothing else about any issues.

Does anyone has any insight into this?


Source: (StackOverflow)

How do I configure multiple Ubuntu Python installations to avoid App Engine's SSL error?

I have Karmic Koala which has Python 2.6 installed by default.

However I can't run any Python App Engine projects because they require Python 2.5 and python ssl.

To install ssl I installed python2.5-dev first while following some instructions I found elsewhere.

sudo apt-get install libssl-dev
sudo apt-get install python-setuptools
sudo apt-get install python2.5-dev 
sudo easy_install-2.5 pyopenssl

However, I am afraid this is not good for my Ubuntu installation since Ubuntu expects to see version 2.6 of Python when you type 'python' on the command line. Instead, it says '2.5.5'.

But App Engine still doesn't work after all this. I continue to get an SSL-related error whenever I try to run my Python app:

AttributeError: 'module' object has no attribute 'HTTPSHandler'

UPDATE1: Just checked whether SSL actually installed as a result of those commands by typing this:

$ python2.5
Python 2.5.5 (r255:77872, Apr 29 2010, 23:59:20) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ssl
>>> 

As you can see, SSL is still not installed, which explains the continuing App Engine error.

UPDATE2:

I tried to revert to the original default version of Python by doing this:

sudo ln -s /usr/bin/python2.6 python

in my /usr/bin/local folder.

Now I get Python 2.6.4 when I type 'python' on the command line.

But this doesn't solve my App Engine SSL issue.

If anyone knows how I can dig myself out of this hole, I would appreciate it.


Source: (StackOverflow)

Tomcat runs but complains about missing server.xml

I'm using ubuntu 9.10 and I installed java and tomcat using the package manager. When I went to run startup.sh, it first complains about catalina.out not being there and not being writable. I fixed that and it doesn't complain about that (why isn't that included in the install??) Now it's complaining about server.xml not being there when I shut down the server. Here is my output from command line:

user@desktop:/usr/share/tomcat6$ ./bin/startup.sh 
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun-1.6.0.15
user@desktop:/usr/share/tomcat6$ ./bin/shutdown.sh
Using CATALINA_BASE:   /usr/share/tomcat6
Using CATALINA_HOME:   /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun-1.6.0.15
Dec 11, 2009 4:42:57 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: 
java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:407)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
user@desktop:/usr/share/tomcat6$

I'm really new to tomcat so this might be a dumb question, but why isn't there a sample server.xml in a fresh install of tomcat? What can I put in there to shut it up... even if its just a stub and a +1 to any one who can explain to me the structure of this file?


Source: (StackOverflow)

Mysql ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

I'm Running Mysql on ubuntu 9.10, the process of Mysql is running as root, I'm using root account when logging to Mysql, which I gave all privileges, I'm using my own db(not mysql), I can create a table, but when i try to create Temporary table i get this error:

ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

For this query:

CREATE TEMPORARY TABLE tmp (id int);

I've plenty of space in my hard drive, all permissions are granted(also var/lib/mysql have mysql permissions).

Any idea? Thanks, Koby


Source: (StackOverflow)

UDP sockets in ad hoc network (Ubuntu 9.10)

I am using BSD sockets in Ubuntu 9.10 to send UDP packets in broadcast with the following code:

        sock_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);
        //sock_fd=socket(AF_INET,SOCK_DGRAM,0);
        receiver_addr.sin_family = PF_INET;
        //does not send with broadcast in ad hoc
        receiver_addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
        inet_aton("169.254.255.255",&receiver_addr.sin_addr);
        receiver_addr.sin_port = htons(port);
        int broadcast = 1;
           // this call is what allows broadcast packets to be sent:
           if (setsockopt(sock_fd, SOL_SOCKET, SO_BROADCAST, &broadcast,
               sizeof broadcast) == -1) {
               perror("setsockopt (SO_BROADCAST)");
               exit(1);
           }
        ret=sendto(sock_fd, packet, size, 0,(struct sockaddr*)&receiver_addr,sizeof(receiver_addr));

Note that is not all the code, it is only to have an idea.

The program sends all the data with INADDR_BROADCAST if I am connected to an infrastructure wireless network. However, if my laptop is connected to an ad-hoc network, it is able to receive all the data, but not to send it. I have solved the problem using the 169.254.255.255 broadcast address, but I would like to know what is going on.

Thank you in advance!


Source: (StackOverflow)

how to have login in WebSVN

Can some one tell me how to do I enable LOGIN function for WebSVN in Ubuntu 9.1?

I was tasked to create a SVN for my team, and the following is one of the link i followed which helped me successfully setup my first repos.

http://agilior.pt/blogs/pedro.rainho/archive/2010/02/06/11698.aspx

But after installing WebSVN, i can see my repos but no authentication was prompted.

The difference between my settings and the above mentioned website are in my httpd.conf (the website uses dav_svn.conf).

my httpd.conf content: DAV svn SVNParentPath /home/svn2 AuthType Basic AuthName "Subversion repository" AuthUserFile /etc/apache2/passwd AuthzSVNAccessFile /etc/apache2/dav_svn.authz Require valid-user

my dav_svn.authz content: [myproject:/] xxx = r

Many thks~ =)


Source: (StackOverflow)

pythonpath issue? "python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory"

I added this line to my .bashrc (Ubuntu 9.10):

export PYTHONPATH=/opt/google_appengine/

And then I ran the dev_appserver through python2.5 on Ubuntu like this:

$ python2.5 dev_appserver.py guestbook/
python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory

As you can see, it can't find dev_appserver.py even though it's in my /opt/google_appengine/ directory. Just to make sure it's not a permissions issue I did this:

sudo chmod a+rwx dev_appserver.py

To check whether it's been added to the system path for python2.5 I did this:

$ python2.5
Python 2.5.5 (r255:77872, Apr 29 2010, 23:59:20) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> for line in sys.path: print line
... 

/usr/local/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg
/opt/google_appengine/demos
/opt/google_appengine
/usr/local/lib/python25.zip
...

The directory shows up in this list so I don't understand why it can't be found when I type:

$ python2.5 dev_appserver.py guestbook/

I'm new to Python so I would appreciate any help. Thanks.


Source: (StackOverflow)