Feeds:
Posts
Comments

Archive for the ‘Code’ Category

Atheros 9k series based wireless cards are among the most commonly found wireless networking cards on laptops. While Linux Kernel 2.6 and later provide support for these cards through ath9k module/driver, madwifi is also an option for some.

Despite the card’s popularity and integrated module availability, the driver is not bug-free. Users of all flavors of Linux (to name a few: RHEL 5,6; Centos 5,6; Ubuntu 11.x,12.x; FC 12,13) seem to have had issues with this driver. The two most commonly reported issues are slow wireless connectivity and wireless network disconnecting intermittently – either due to inactivity or after coming out of suspend/hibernate. The latter issue also sometimes manifests itself as the network card refusing to “come up”.

Here is an easy fix that fixes both issues. It has been tried and tested to fix the issues on at least the above mentioned Linux distros and should also work on other distros that use ath9k module.

Run the following commands as root (or prefix sudo)
Add the option nohwcrypt for ath9k: this removes the hardware based encryption and moves it to software

echo "options ath9k nohwcrypt=1" > /etc/modprobe.d/ath9k.conf

Turn off the automatic power management for your wireless card

iwconfig wlan0 power off

Now Reboot.

Alternatively, instead of rebooting you can perform the steps below
Unload the driver and reload it again

modprobe -rv ath9k
modprobe ath9k

Restart the network manager service

service NetworkManager restart

Now you are all set. Have fun!

Advertisements

Read Full Post »

Often RDS users trying to import data face this error when they try to create triggers:

ERROR 1419 (HY000) at line 49: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

The reason for this is that the default DB parameter group doesn’t have the privileges set to create and insert triggers into the database. To get rid of this error, do the following:

  1. Obtain RDS CLI tools from AWS website here, and follow the installation steps.
  2. On your terminal (or command line) create a new parameter group (since we can’t directly modify the default parameter group)
    rds-create-db-parameter-group allow-triggers --db-parameter-group-family mysql5.5 --description "parameter group to allow triggers"
  3. Now modify the parameter group created just now
    rds-modify-db-parameter-group allow-triggers --parameters "name=log_bin_trust_function_creators, value=true, method=immediate"
  4. Apply the new group to the database
    rds-modify-db-instance --db-instance-identifier instance-name --db-parameter-group-name allow-triggers --apply-immediately
  5. Finally, you will need to restart your RDS instance.

After running the above you should be able to import your schema/data and create triggers without problem. In case you receive the following error while using mysqldump

ERROR 1227 (42000) at line 2492: Access denied; you need (at least one of) the SUPER privilege(s) for this operation.

then, the problem is with the definer statement in your trigger. Change it from

DEFINER=user_a@localhost

to something like

DEFINER=correctuser@ip

Read Full Post »

I was in Washington, DC the week of June 10, 2012 attending JCDL 2012.

A detailed summary of the conference has been put together on the official WS-DL blog of Web Science and Digital Libraries Research Group from Department of Computer Science, ODU by my colleague Hany SalahEldeen.

Here are my slides from the presentation.

Read Full Post »

So the other day I had to back up all database objects for an Oracle instance i manage and I was looking for some tool that would help me generate DDL for each object in a separate SQL file.

A quick Google search revealed I could backup DDL using TOAD (full version), DB Solo and RazorSQL. I use DBArtisan at work and my organization doesn’t want to move to TOAD yet. I have used DB Solo in the past and I have liked the clean and light interface and the quick ability to back up DDL but I just couldn’t use it this time because I had already expired my trial version and didn’t have enough time to get the folks sign off on purchase of a license (which is not very expensive). So I decided to try RazorSQL, but was disappointed because it dumps all objects in one single SQL file. Also, when I tried to back up stored procedures (over 5000 of them), the program refused to copy.

Out of luck and exhausted, I remembered the good old DBMS_METADATA commands. I quickly created a new directory entry in the database for the location where i wanted to dump my DDL, and executed a procedure that I wrote to perform the DDL backup.

Here are the steps I followed: (one can use SQL PLUS or any DB tool he wants)

–create a new directory in all_directories table. This is important to avoid ORA-29280 invalid_path execption.

CREATE OR REPLACE DIRECTORY BACKUP_DIR AS 'E:\DATA_BKP';

–also grant permissions to everyone to read, write (maybe restricted based on your requirement).

GRANT READ,WRITE ON BACKUP_DIR TO PUBLIC;

–the stored procedure for DDL backup
–note that we are reading from USER_OBJECTS data dictionary, this way it exports only the current user’s objects.
–to export all objects, execute procedure as sys or sysdba and use the table ALL_OBJECTS instead.

CREATE OR REPLACE PROCEDURE	EXPORT_DDL
AS
	V_DDL_CLOB  CLOB;
	VPATH VARCHAR2(255);
BEGIN
	FOR C IN (SELECT OBJECT_NAME, OBJECT_TYPE
             FROM USER_OBJECTS
             WHERE OBJECT_TYPE IN ('TABLE','VIEW','FUNCTION','PROCEDURE','PACKAGE','PACKAGE_BODY'))
	LOOP
		V_DDL_CLOB := DBMS_METADATA.GET_DDL(C.OBJECT_TYPE, C.OBJECT_NAME, 'EAGLE');
		DBMS_XSLPROCESSOR.CLOB2FILE(V_DDL_CLOB, 'BACKUP_DIR', C.OBJECT_TYPE || '_' || C.OBJECT_NAME||'.SQL');
	END LOOP;
END;
/

EXEC EXPORT_DDL;

Now that was simple, wasn’t it? 🙂

Read Full Post »

Now here is something that a programmer would have come across sometime or the other. Let us say you have a table where more than one columns make up the primary key and you need to find out all those rows which have two of these columns (attributes) same but the third attribute is different. You can do this using a simple join like this

SELECT * FROM Table1 A INNER JOIN Table1 B ON A.PK1=B.PK1 AND A.PK3=B.PK3 AND A.PK2 <> B.PK2

Read Full Post »

Its so exciting when you accidently discover the follies of the biggest player in the market. Microsot’s IE is the most widely used browser esp. because it comes pre-bundled with the OS and seldom a non-techie user would use an alternative such as Firefox or Opera.

MS has been trying to make its browser more efficient and popular for a while now, and it continues to lose in front of FF or Opera. However, seldom has it acknowledged the fact. However, recently, I was working on something and it required me to download some of the content from maps.live.com .

As usual, out of curiosity, I went around tinkering with the scripts and the content and voila here’s what I found. Hidden between all the super duper code that makes this website jazzy, are some of the comments written by MS programmers themselves. Check it out:

html
{
overflow: auto;                /* for IE, so it doesn’t show disabled scrollbars.  FF (of course) doesn’t have this problem */
}

#pageContext
{
position: relative;
width: 75%;                /* some width is necessary in order for IE6 to honor the overflow and text-overflow declarations */
padding: 8px;
z-index: 100;
color: #444;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 1.1em;
min-height: 1.3em;
float: left;
}

#msve_ScratchPad .collectionList
{
position: relative;
min-height: 200px;
max-height: 280px;
height: auto;
width: 258px;   /* This really shouldn’t be necessary, but unfortunately, becuase of IE’s lack of standards support, it is. */
overflow-y: auto;
overflow-x: hidden;
}

These are just some of the comments I found. MS knows that its  browser is sub-standard, but has too much pride to acknowledge it publically.

I am a die-hard user of FF anyway. Hope you migrate there soon.

Read Full Post »

I am  a developer and at Peek Mobile Communications India, I spend most of my time hacking around the source code of Peek device in order to provide better features and to optimise the existing ones. For those who don’t know what Peek is, it is an email device similar to Blackberry, minus its phone capabilities.

Peek
Peek

It has already been voted Best Invention of Year 2008 by Time magazine, Wired Magazine’s Favourite Product of the year 2008 (Check the december issue) and is already on the top list of Amazon and the like. Peek has been received warmly by US and now it is ready to make an impact in India as well.

Peek in India has its operations in Bangalore where we have a small team working its ass off, day and night, preparing for a launch in India. Meanwhile, there is something else that has been keeping me busy. Enterprise customers are requesting for presonalization and I have been trying to do just that. As a part of this, one of things that Peek has to offer is form filling application for medical representatives for pharmaceutical companies. Take a look at the snapshot below.

Med Rep Form

Med Rep Form

Its nifty. All that the user has to do is to fill in a form and it appears right in the company’s mailbox. Then there’s a .Net app, that retrieves the email, processes it, and voila there you have the data you sent in the format that can seamlessly attach with your db.

Check out for the next post that has the video of the system. Also shall be available onYoutube soon.

P.S. Be on the lookout for Peek. The device is gonna change the way you email.

Read Full Post »

Older Posts »