Code

I am disappointed by Ubiquiti Networks

It is been a while I check forums and Ubiquiti products. They are really good products. At the beginning the really interesting thing in ubiquiti was the Open minded / Open Source direction they used. I begun to use their product with SR and XR card (when they don’t seek any final products). It was really easy to make your own product firmware with an embedded MIPS motherboard and their cards. The SDK was available at this time.

Tip Mysql : Cannot delete or update a parent row: a foreign key constraint fails

For those of you who are faced to this type of error, the command “SHOW ENGINE INNODB STATUS;” is your friend.

[...]
------------------------
LATEST FOREIGN KEY ERROR
------------------------
130322 12:03:42  Cannot drop table `test`.`events`
because it is referenced by `test`.`attachments`
[...]

Here it is my 2 cents of the day ;)

'netcat' : my best friend :)

For those of you who read this unpretentious blog, you must have noticed this week-end a maintenance window.

The DD of my hosting has crashed. To be more precise, it is crashing. His time to live is near to expire…

So to save my files on this server, a simple tar and scp is not enough. In fact, if you do this, you will create inodes and store on your FS. You will have lot of chance to have corrupted tarballs.

Dennis Ritchie : RIP

As lot of people on twitter :

/* For Dennis Ritchie */
#include <stdio.h>
void main ( )
{
        printf("Good bye World n");
        printf("RIP Denis Ritchie");
}

Thank you for UNIX, thank you for C programming language !

Thank you : Dennis M. Ritchie

Extjs : How to 'real' clear a cookie

If you are in extjs application designing and coding, you might need to use use ‘Ext.util.Cookies.*’ function.
You can :

  • Ext.util.Cookies.get(‘my_cookie’) : get cookie value
  • Ext.util.Cookies.get(‘my_cookie’, ‘cookie_value’) : set cookie value
  • Ext.util.Cookies.clear(‘my_cookie’) : clear cookie

In theory you can delete cookie by means of ‘clear’ function.

In practice, you should use :

Ext.util.Cookies.set('my_cookie', null, new Date("January 1, 1970"));
Ext.util.Cookies.clear('my_cookie');

Because you can be faced to a problem where you cannot delete your cookie and cannot understand why…

For fun : 'ena' C program

I think it has been really often done in the past, but for fun :

For those of you whom use a lot of xterm, I think it have happen you mistake tape an ’ena’ command in your sh friend shell program :)
It can be funny to have a result on your stdout other than :

Commande « ena » non trouvée, vouliez-vous dire :
 La commande « enna » issue du paquet « enna » (universe)
 La commande « eva » issue du paquet « eva » (universe)
 La commande « enca » issue du paquet « enca » (universe)
 La commande « ent » issue du paquet « ent » (universe)
 La commande « env » issue du paquet « coreutils » (main)
ena : commande introuvable

It can be funny to have :

Ext.js : one simple tip

I am a network engineer, but in a small company you are able to do lot of things. I am in charge (in same time as network job) to developp second generation of customer managment tool. I have choiced to developp it in ext.js. I am in an early prototyping and evaluate this framework. It is pretty awesome !! A little tip to load data with extjs in a form :
Ext.getCmp('your-form').getForm().load({url: "load.php", params: {do: "cmd"}}); it is your friend. But you must now that your json answer must be as : { success: true, data: { clientName: "Fred. Olsen Lines", portOfLoading: "FXT", portOfDischarge: "OSL" } } You have more information to read there.