For some reason I kept getting this error (even when the file was readable by all) in one of the munin (mysql slave) plugins that I had written.

So this was the solution that worked for me;

under the [mysql*] section in /etc/munin/plugin-conf.d/munin-node
I added this: env.mysqlopts -u{user} -p{password}

and in my plugin

I did something like this:

mysql ${mysqlopts} -e'show slave status \G'

and that seemed to have picked up the user and password from env.mysqlopts and the plugin started working (ofcourse after I restarted munin).

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • YahooMyWeb
  • Furl
  • Netscape
  • Fark
  • StumbleUpon
  • De.lirio.us
  • IndiaGram
  • IndianPad
  • Simpy
  • SphereIt

Have a look at this sql statement:

  1.  
  2. mysql> CREATE TABLE `t1` (`id` INT NULL AUTO_INCREMENT, KEY(`id`));
  3. Query OK, 0 rows affected (0.92 sec)
  4.  
  5. mysql> SHOW CREATE TABLE `t1`;
  6. +——-+————————————————————————————————————————-+
  7. | Table | CREATE TABLE                                                                                                            |
  8. +——-+————————————————————————————————————————-+
  9. | t1    | CREATE TABLE `t1` (
  10.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  11.    KEY (`id`)
  12. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
  13. +——-+————————————————————————————————————————-+
  14. 1 row IN SET (0.08 sec)
  15.  

See, how MySQL implicitly converts the NULLable column `id` to NOT NULLable because the column `id` was also a key?

Also have a look at the following statements:

  1.  
  2. mysql> CREATE TABLE `t2` (`id` INT NULL AUTO_INCREMENT KEY);
  3. Query OK, 0 rows affected (0.11 sec)
  4.  
  5. mysql> SHOW CREATE TABLE `t2`;
  6. +——-+————————————————————————————————————————-+
  7. | Table | CREATE TABLE                                                                                                            |
  8. +——-+————————————————————————————————————————-+
  9. | t2    | CREATE TABLE `t2` (
  10.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  11.   PRIMARY KEY (`id`)
  12. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
  13. +——-+————————————————————————————————————————-+
  14. 1 row IN SET (0.00 sec)
  15.  

Having KEY in the column specification makes that column a PRIMARY KEY!

I am going to go through these pages:
http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html
http://dev.mysql.com/doc/refman/5.0/en/create-table.html

and try to understand why the context really matters while specifying the key. and also the reasoning behind implicitly changing stuff instead of throwing an error.ATM, it just doesn’t make any sense!

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • YahooMyWeb
  • Furl
  • Netscape
  • Fark
  • StumbleUpon
  • De.lirio.us
  • IndiaGram
  • IndianPad
  • Simpy
  • SphereIt

Since my upgrade to Lucid, I have been experiencing dropouts on my wireless connection and since the solutions that I had found on the net did not solve the above problem, I decide to script a temporary fix until it gets fixed in (K)Ubuntu or in the Kernel.

I found that that after I get disconnected if I were to disable wireless or sometimes disconnect and then try to (enable wireless &) connect again I am connected for a random amount of time. I automated this by writing a bash script to check for connectivity to the net and try to reconnect if there is no connection.

This has worked well for me so far and if your are experiencing similar issues, give it a try. The script is available here.

Update: Looks like the wireless dropout issue has been been fixed in Lucid :)

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • YahooMyWeb
  • Furl
  • Netscape
  • Fark
  • StumbleUpon
  • De.lirio.us
  • IndiaGram
  • IndianPad
  • Simpy
  • SphereIt

I hit this bug after the upgrade to PHP 5.3 (which happened with my Kubuntu Upgrade to Lucid Lynx). I read in another bug report that this issue was fixed in the latest snaphshot, so I tried compiling from source – using the latest 5.3 snapshot. This didn’t go well, as I hit a seg fault after installation and after about an hour of playing with gdb, I gave up!
So, I had to downgrade to PHP 5.2 ;(. Now lucid repos have 5.3 and I had no idea what to do. Googled around and came across a solution here. That worked. I just had to make sure that each individual php5 package (php5-dev, php5-memcache, php5-curl, etc,.) was listed in the file like this;

Package: php5
Pin: release a=karmic
Pin-Priority: 991

Package: php5-dev
Pin: release a=karmic
Pin-Priority: 991

Package: php5-curl
Pin: release a=karmic
Pin-Priority: 991

and so on(try to script the generation of the file).

I was very glad that the designers of apt had made this easy for us! I knew yum had priorities but, I wasn’t aware of a similar solution for apt. Everyday you learn something new ;)

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • YahooMyWeb
  • Furl
  • Netscape
  • Fark
  • StumbleUpon
  • De.lirio.us
  • IndiaGram
  • IndianPad
  • Simpy
  • SphereIt

I have just recently created a bookmarklet to sort the news stories on the front page of HN.

There are a  few minor issues that I have noticed but, should work for most parts.

When you click on the bookmarklet, two links get created at the top as shown in the screenshot below:

Clicking on ‘Comments’ will sort the posts by the number of comments that they have and Clicking on ‘Points’ will sort the stories by the number of points associated with the stories. Clicking on the links more than once will toggle the sort direction.

The code is available on GitHub(Do whatever you want license) here.

I have used jQuery and a cookie plugin as it saved me a lot of time.

So here is the link to the bookmarklet: HN Sorter

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Technorati
  • YahooMyWeb
  • Furl
  • Netscape
  • Fark
  • StumbleUpon
  • De.lirio.us
  • IndiaGram
  • IndianPad
  • Simpy
  • SphereIt
© 2010 trk's weblog Suffusion WordPress theme by Sayontan Sinha