Thursday, November 28, 2013

Installing Ralink 3090 wifi driver

I installed Kubuntu 10.10 on my new laptop, my laptop is Compaq CQ62- 308AX. It has Ralink 3090 wifi, which is not automatically detected by Kubuntu. Even restricted driver manager does not show any option for this device. So I downloaded the driver from Ralink site (http://www.ralinktech.com/support.php?s=2).  It is in the source format. I thought I might have to patch the kernel source. I went through the readme file and I found that I don’t have to compile kernel ( yippee an hr saved). Only device driver source is needed to be compile. These days things are much more simple. So I compiled the driver by running command “make” and installed it by “make install”.  It has compiled other ralink wifi modules along with 3090 module.

After installation (using ‘make install’)  reboot the machine, reboot is not necessary in Linux after installing driver.  After reboot it loaded incorrect  rt2086 module. So I tried manually unloading and loading module using insmode and rmmod commands, but it did not worked. To fix this open /etc/modprobe.d/blacklist.conf (as root) and add at the end: blacklist rt2800pci. Also open (as root) file /etc/modules and add: rt3390sta.

After rebooting the machine, wifi is working fine perfectly.

Note :- kernel version 2.6.38 and later contains the driver, so you don’t need compile it.

Here is the step by step guide to install to install Ralink wifi driver

  1. Download driver from Ralink site http://www.ralinktech.com/support.php?s=2 for your chipset.
  2. Extract it, cd to extracted folder, run make command to compile it.
  3. Run make install as root to install the module.
  4. Open /etc/modprobe.d/blacklist.conf (as root) and add at the end: blacklist rt2800pci. Also open (as root) file /etc/modules and add: rt3390sta.
  5. Reboot machine

Monday, November 25, 2013

Adding additional class to a button in drupal

Recently we were building a multi-domain site, we are using same theme for all sites but we want to have different colors for buttons for each domain. We achieved this using my overriding theme_button in template.php of theme, here is the snippet.

/**
 * Overwrite theme_button()
 * @file template.php
 */
function mytheme_button($variables) {
  $element = $variables['element'];
  // Add some extra conditions to make sure we're only adding
  // the classto the right submit button Now add our custom class
  if (isset($element['#attributes'])) {
    $element['#attributes']['class'] [] = 'button';
    $domain = domain_get_domain();
    $element['#attributes']['class'] [] = $domain['machine_name'];
  }
  $variables['element'] = $element;
  return theme_button($variables);
}

Friday, June 07, 2013

OpenSuse 12.3 - Review - Very good performance

The first thing that I note is faster booting. It takes about 15 secs, with previous version it was about 45 secs. Second thing is better performance. Desktop is very responsive and takes lesser memory. As compared to Ubuntu 12.04 with KDE 4.10, it consumes about 300MB less RAM in OpenSuse on my office laptop.

Installation


I installed it on 2 different variants on 2 different laptops, first one is Dell Vostro- Core i5 2nd generation,4GB ram and second is Compaq CQ-62 AMD Phenom X4, 6GB ram. I installed KDE live on AMD one and Mango Linux on intel one. Mango Linux a OpenSuse derivative developed and maintained by me, contains all additional stuff that is needed after installing OpenSuse, like Google chrome, flash, google earth, vlc, etc... and updates. Installation is no different from previous version. Installation went smooth without any issue.

Hardware support

On both the laptops all the device are detected and are working well. For the first time in KDE bluetooth is working, although not perfectly, I'm not able to receive files via bluetooth. Previously nothing was working for bluetooth using KDE, so I've to use Blueman to share files over bluetooth. I had an issue with wifi on Dell laptop using Ubuntu 12.04, that even with fast internet connection, pages open very slow, so I’ve to use cable for internet. I did not faced such issues with OpenSuse/Mango Linux. I have dual graphics in Compaq laptop first one is Radeon 45XX series one IGP and another is 1Gb 5520 addon graphics cards. IGP belongs to legacy series of catalyst driver and discrete belongs to new catalyst, so I cannot install AMD proprietary drivers, as both cannot be installed together, so I’m open source driver. To disable discrete graphic driver at boot I’m following this thread.

Software


OpenSuse12.3 come with kernel 3.7.10, KDE 4.10.0, Gnome 3.6, LibreOffice 3.6. Latest version of LibreOffice is release 4.0, which release after feature freeze hence not included in default software selection, but is available in a separate repo. I'm use KDE as default desktop environment. I did not find any major issue with it, it is very smooth and stable. I used KDE 4.10 with Ubuntu 12.04, where is faced few crashes and performance was not very good, which did not happen in this case. OpenSuse has reputation of providing best KDE desktop experience, it is feel more polished than previous version. Overall performance is far better than Ubuntu 12.04 and also better than 12.2. The major change in default software selection is MariaDb in place of MySql.

Conclusion

In this release performance is improved a lot, from booting to opening applications and doing day to day tasks. It takes 15 secs to boot with default applications/services,which is very good. In VMWare player it takes about 8 secs. Faster booting matters a lot, although it is Linux, you don't need to reboot often as compared to Windows, but it matters. For example you are about leave office, you shut down your laptop/desktop and then you manager ask to respond to an important email he just send. At this moment if you machine take too long to boot, you feel frustrated.

Another improvement is it takes lesser memory. It takes about 300 to 400 MB less as compared to Ubuntu 12.04. I've 8-10 tabs opened in firefox, 5-6 tabs in Opera, Netbeans with Oracle JRE, Konsole, mysql and apache. I'm running almost same version for all app except MySql and Apache. The performance improvement is because of improvement is base libraries. I would recommend OpenSuse 12.3 for expert and new users alike who are looking for a stable Linux distro with good performance and for fair balance of simplicity and good configuration options for those who want to tweak.

Thursday, January 10, 2013

html encode/decode in drupal

Like all major CMS drupal stores text fields in encoded html format, to prevent cross site scripting attacks. Some times drupal does not process custom fields and encoded text is displayed as it is. I come across similar issue in my current project. I also post question on StackOverflow. While search for solution I come to know about decode_entities function. decode_entities converts html encoded text to more friendly text. Similary to encode special charters in text you can use check_plain.

decode_entities function
http://api.drupal.org/api/drupal/includes!unicode.inc/function/decode_entities/7

check_plain function
http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/check_plain/7

My question on StackOverflow
http://stackoverflow.com/questions/14229641/rss-feeds-view-showing-encoded-special-character-in-title