Archive

Archive for May, 2009

Installing WineD3D in Virtual Box

May 20th, 2009
With the latest version of Virtual Box comes a surprise, an option to install WineD3D, which enables the user to replace the Direct3D in the virtual installation of Windows. WineD3D is supposed to increase/improve your graphics acceleration and 3D rendering of the virtual system.

If you are on Ubuntu Jaunty, the Virtual Box installation from Add/Remove programs doesn’t include WinD3D and VBOXGuestAdditions by default. You can follow my previous post on installing VBoxGuestAdditions if you’re looking for that. To install WineD3D,

Go to http://download.savannah.gnu.org/releases-noredirect/wined3d/latest/ and download the ISO file.

Go to /usr/share/virtualbox and copy the downloaded file wined3d.iso into this directory.

Give read permission to the wined3d.iso file for users other than root.

Boot your virtual machine into safe mode (Press F8 during startup)

Now upon clicking “Install WineD3D” from Devices menu will begin the installation of WineD3D.

To further enhance the 3D acceleration, Go to the Settings of your virtual machine, Go to General and in the Basic tab, Check the “Enable 3D Accelaration” option. That’s it, you’re all set. Enjoy superior 3D rendering!

Your Ad Here

Ashok TT - How To, TT - Tips n Tricks, TechTalk , ,

Ubuntu Jaunty Atheros WiFi not working

May 17th, 2009
In Ubuntu Intrepid, Atheros wifi chip on my Compaq C770TU (C700 Series) didn’t work out of the box. I had to use the ndiswrapper, a wrapper for windows drivers. When I upgraded to Jaunty and saw that the wi-fi is working out of the box, Boy, I was so glad.

Today, I suspended my laptop for the first time after installing Jaunty. To my surprise, after the resume, my wi-fi stopped working. It cannot detect the wireless networks. The output of lspci still lists Atheors, indicating that the card is still being recognized by Ubuntu. I disabled and reenabled wireless, disabled and reenabled networking from the Network Manager, restarted the system a number of times but to no avail.

So I try to get help from my old friend Google, and all it gives me is a number of links where people are complaining about disabled wireless, but with no proper resolved posts. I followed most of them in vain (Loaded ndiswrapper, Installed linux-backport-modules-jaunty, Loaded MadWiFi etc) but still no result. During this process, I’ve stumbled upon a post in Ubuntu forums related to Intrepid and is about the Wi-Fi button not turning to blue when in operation.

In that post, I’ve read that in Ubuntu, we have to keep the wi-fi hotkey pressed for 5 seconds for Ubuntu to recognize the on/off routine. I wasn’t used to this because in Windows, the change was instantaneous. And when I switched to linux, I never had the need to use the Wireless button. So, I pressed the button for 5 seconds, and still no response. Another 5 seconds passed after I released the button, and my network applet showed the swirling animation of connecting to a wireless network and Voila! My wireless is working again!

I’ve spent almost two hours searching for a clear answer, and now that I found out, I can’t help feeling stupid for all those hours wasted for such a simple answer. Posting this experience here so that it may be of some help to someone!

@Ubuntu team - till Intrepid, after a resume the wi-fi worked seamlessly without any action from me. It’s great, Why did you change it to disabling the wi-fi after resume? I can’t guess what could be your reason.

Ashok TT - Linux, TT - Tips n Tricks, TechTalk , , ,

Setting up FTP permissions in XAMPP for Linux

May 16th, 2009

XAMPP for Linux (aka LAMPP) package contains proftpd server, which is quite a stable and highly configurable FTP server. It is GPL-licensed, capable of serving large files,  supports hidden directories, virtual hosts and per-directory “.ftpaccess” files, Advanced features like multiple authentication methods and upload/download ratios etc.

proftpd uses a single main configuration file which is located in “/opt/lampp/etc/proftpd.conf”. LAMPP configures the ftp server with a user called “nobody”, which is a fake account and doesn’t really exist. The password for this user can be changed by running the security utility of LAMPP i.e. “/opt/lampp/lampp security”.

When you create or upload files, there’ll be a default set of permissions applied to these files, that restricts access to other users. If you open the directory you’ve created in Nautilus, you can’t read/edit the contents. You can change these default set of permissions by editing the proftpd.conf file. You can also change the default directory of the ftp login.

sudo gedit /opt/lampp/etc/proftpd.conf

Change the directory to whatever you want to be redirected to when you login to ftp server.
# Normally, we want files to be overwriteable.
<Directory /home/ashok/xampp/*>
  AllowOverwrite        on
</Directory>

# only for the web servers content
DefaultRoot /home/ashok/xampp

To change the file permissions, find the line
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                022

Umask is the method used by proftpd, which is like an opposite to chmod. CHMOD 777 adds all permissions to files and directories (adds read, write capabilities) where as UMASK 777 removes all permissions from the files and directories. So, if you want the uploaded/created files to be accessed by everyone else, you have to use umask 000. More info about these permissions at: link

Ashok TT - How To, TT - Linux, TechTalk , ,

Custom keyboard shortcuts in Ubuntu Jaunty

May 14th, 2009
Apart from the “System>Preferences>Keyboard Shortcuts”, there is no other tool with which we can edit the default keyboard shortcuts in GNOME applications like Nautilus. If the options covered under Keyboard Shortcuts are not enough for you and you’re looking for editing shortcuts in the menus, Here’s the trick:

Right click on the desktop and select “Change desktop background”, select the “Interface” tab and check the “Editable shortcut keys”.

Now go to nautilus and highlight the option you want in the menu with your mouse pointer. At this point, hitting <Delete> will delete the existing shortcut assigned, hitting the key combination you want will be assigned as the new shortcut.

Be sure to uncheck the “Editable shortcut keys” after you’ve finished your customization since there is no way of restoring default keyboard shortcuts. If you accidentally delete a keybinding, you won’t be able to get it back automatically.. You’ll have to assign manually.

These customizations are saved in the home directory, so different users can have different setups of keyboard shortcuts.

Ashok TT - How To, TechTalk ,

Running Aptana Studio on Ubuntu Jaunty

May 14th, 2009

In order to run Aptana on Ubuntu without installing Firefox 2 or uninstalling Firefox 3, you have to install the package xulrunner from the default repositories.

sudo apt-get xulrunner

This will install XUL Runner v1.8, without which Aptana cannot run. Now download Aptana and extract it to your home directory. Open the aptana directory and create a new file, rename it as runaptana.sh. Paste the following into that file:

#!/bin/sh
MOZILLA_FIVE_HOME=/usr/lib/xulrunner
if [ $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
fi
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
/home/ashok/AptanaStudio/aptana/AptanaStudio

The above startup script not only allows to run Aptana, but it also fixes the issues of “Embedded browser not available” and “JVM Terminated”.

Aptana Studio is a very good IDE for PHP with it’s debugging capabilities. I recommend it for anyone who is looking for a good php debugger on linux. For simple coding, it might be an overkill and you may use a simple php editor, but if you do a lot of application development, Aptana’s the way to go! :-)

Ashok TT - How To, TT - Reviews , , ,

Running XAMPP on startup in Ubuntu

May 14th, 2009

Step 1: sudo gedit /etc/rc.local

Step 2: At the beginning of the file, add /opt/lampp/lampp start

XAMPP for linux (LAMPP) will now start automatically upon login.

Ashok TT - How To, TechTalk ,

Changing default directories of XAMPP on Ubuntu Jaunty Linux

May 10th, 2009

This post deals with changing the default directory of Apache in XAMPP.

Changing the Apache Directory:

Step 1: sudo gedit /opt/lampp/etc/httpd.conf

Step 2: Search for [ DocumentRoot "/opt/lampp/htdocs" ] without the brackets

Step 3: Change it to [ DocumentRoot "/whatever/directory/you/want" ]. Don’t put a / at the end of the path

Step 4: Search for [ ]

Step 5: Change it to [ ]

Step 6: Copy the files in /opt/lampp/htdocs/ to /whatever/directory/you/want

Restart the XAMPP server, and you’re all ready to go.

Ashok TT - How To, TechTalk ,

Connect to XAMPP MySQL using MySQL GUI Tools

May 10th, 2009

When you’re running XAMPP, using MySQL GUI tools (Contains MySQL Administrator and MySQL Query Browser) with default options throws the following error during the establishment of connection:

MySQL Error Nr. 2002 Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock

This is because XAMPP installs all the modules of Apache, MySQL etc in /var/opt whereas the tools look for default installation directory i.e. /var/run/…

You can find the sock file of XAMPP MySQL in /opt/lampp/etc/my.cnf. The default location for XAMPP MySQL is “/opt/lampp/var/mysql/mysql.sock“. In MySQL Administrator’s “Connect to…” dialog box, press the button “Details” and enter “/opt/lampp/var/mysql/mysql.sock” without the quotes in the “Connect Using Socket File” field.

Save this instance so that you can use this configuration automatically the next time you try to connect.

Ashok TT - How To, TechTalk ,

Running HTML Validator Firefox extension on Ubuntu Jaunty 9.04

May 8th, 2009
The HTML Validator extension for Firefox has been an essential tool in my arsenal of web development tools. The extension has both the W3C algorithms (HTML Tidy and the SGML Parser) implemented, and it works locally (offline) for validating web pages. It eliminates the cumbersome uploading to W3C Validator service and shows instant results of the tests, pretty fast too (The largest page loaded took less than 1/100th second).

The HTML Validator has a nice debug window which not only shows the errors & warnings, but also shows tips on how to solve the errors, including small bits of demonstration code. It provides a wholesome learning experience about HTML standards.

The HTML Validator works flawlessly on Windows based systems, but on Linux, it faces a bit of trouble especially on Ubuntu. This is due to incompatibility of the LIBC++ version used to compile the extension and the one available on our system. The following steps will make the HTML Validator work on Ubuntu systems:

1. sudo apt-get install libxul-dev
2. sudo apt-get install libstdc++5
3. sudo apt-get install libnspr4-dev
4. At the end of /etc/profile, add the following line:
“export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/usr/lib/xulrunner/”

Then restart Firefox. If the status bar icon still doesn’t turnup, restart your X session and you’ll have the validator ready.

Ashok TT - How To, TT - Linux, TT - Tools, TechTalk , , ,

Enabling Compiz for Intel Graphics in Ubuntu Jaunty

May 5th, 2009
Due to a bug, certain Intel chipsets were added to blacklist of Compiz. Compiz is intentionally disabled on these machines, and the effects & animations stopped working. This lead to a confused state for people who updated to Jaunty just to see their effects gone when they worked flawless in Intrepid and previous versions (This includes me too). After I’ve installed Jaunty and tried to enable the Desktop RightClick>Change Desktop Background>Visual effects, it throwed up “Desktop effects cannot be enabled”.

Googling immediately after the Jaunty release didn’t return any results, but  googling now we can find a number of results for solving this. The two workarounds I found are:

1. Reverting to 8.10’s Intel Drivers (How to: Link)
2. Making Compiz skip the check (How to: Link)

Unfortunate for me, both of them didn’t work. I’ve searched deeper into the launchpad and found the solution in the bug 363821 report page. Here’s the work around:

1. Open the file /usr/bin/compiz with root permissions in a text editor
2. Go to the section “# blacklist based on the pci ids”
3. Add a # before the PCI ID of your graphics card (Commenting the line excludies it from processing)
4. Save, Close, Restart
5. Desktop RightClick>Change Desktop Background>Visual effects and choose your favourite mode.

How to find PCI ID of your card? Use the following command:

$lspci -nn | grep VGA

This usually gives a output like the following:

00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller [8086:2a02] (rev 03)

8086:2a02 is the PCI ID of this Intel Card. In the /usr/bin/compiz file, You’ll be changing as follows:

Original -

T=”$T 8086:2a02 ” # Intel GM965

Modified -

#T=”$T 8086:2a02 ” # Intel GM965


Warning: Be careful about removing your card from the blacklist. It may lead to crashes of X. If you are experiencing such problems, login in safe mode and add the comment back so that Compiz gets disabled.

My card is the one listed above, GM965/GL960. It works absolutely fine with compiz with no crashes.

Update: After three weeks of usage without any crashes, I’m beginning to see some of the glitches due to which the card was blacklisted. X is getting freezed, but I can still here the songs running in the background or the notifications of applications running. Just the video gets freezed. Am reverting to Intrepid’s Intel 2.4 drivers (See workaround 1 in the above post). Hope Ubuntu developers will fix the problem soon…

Ashok TT - How To, TT - Linux, TechTalk , ,