Ressources documentaires pour Mandriva Linux et les Logiciels Libres

PHP Toolbox : determining file mimetype

On the extranet I developed for my society, the users have the ability to upload files, but I do restrict the files types depending on the document’s nature. That’s why i need a way to determined the mimetype of the document in PHP. For this I’m using finfo, here the code as used for a document which have been just uploaded.

function check_document_form($vars)
{
   // check if file have been correctly uploaded 
   if($_FILES['document']['error'] != 0)
   {
        return FALSE;	
    }

   $fres = finfo_open(FILEINFO_MIME); /* ask to return mime type */

    // it seems that sometimes finfo_file returns mimetype;charset=xxx
    // like "application/pdf;charset=binary"

   // return the first element of the array by using reset
  $mimetype=reset(explode(';',finfo_file($fres,$_FILES['document']['tmp_name'])));
  
   // $GLOBALS['mimetype_document_tab'] is a global array containing the list of authorized mimetype
  if(!in_array($mimetype, $GLOBALS['mimetype_document_tab']))
  {
      return FALSE;
  }
  finfo_close($fres);
  return TRUE;
}

The issue with finfo_file() returning the mimetype and the charset instead of just the mimetype happen with PHP 5.2.9 under Mandriva Spring. I know at least that the charset was not return with 5.2.5 under Mandriva 2008 Spring. As the mimetype and the charset are separated by a semi-column, I’m using explode with ‘;’ as a delimiter to split the string in an array, and then use reset to return the first element of the array. This codeworks even when finfo_file() return just the mimetype.

]]

KDE 4 job notifications issues when using removable medias

One of the most useful KDE 4 feature sometimes annoy me a lot : KDE 4 job notifications.

One of the new feature of the KDE 4 desktop is the new job framework thanks to the new Kuiserver which allow to display and group all KJobs in one place. This is useful to have a central place for notification or job progress ( notably file copy, … ). By default a job dialog will be displayed during a short period, and then it will be automatically hidden in the systray.I do really appreciate this.

With KDE 4.3, we will have even further improvements like the ability to disable auto-hiding, animated job icon the systray, better grouping, etc … Please read Jobs and notifications in the plasma systray. by Scheepmaker. However i still have one issue : the handling of copies to removable devices. Let me explain.

IMHO the application should be able to tell if it the job should be auto-hidden or not. This is pretty important when copying files to removable medias ( USB keys, USB or Firewire HD, USB mass storage mucic players, … ). Indeed, when copying a file to a removable media, a user should most of the time :

  1. open dolphin on the removable media
  2. copy the files to the removable media ( normally from dolphin )
  3. when the copy is completed, select “remove safely” to ensure that files are correctly copied on the media
    then remove the media. This is equivalent to doing umount in the CLI.

This means that you need to know precisely when the copy is finished, but also you should be proposed to select the “safely remove” option if needed as you may screw your USB key/datas. Last but not least, a new user, not knowing how things are working, should not be tempted to removed unplugged the removable media before the end of the copy and without having select « safely remove ».
New users, or at least those not comfortable when using a computer, tend to have a very limited “view”. What I mean is the fact they only clearly see a tiny portion of the screen at a time, and have a bad peripheral broader view. Because of this, if you display the job window, and then hide it, then won’t be able to see where it have been hidden, and may not even noticed the icon in the notification area at the left bottom, and eventually understand its meaning. That’s why also the animation when hiding the job dialog should clearly show that the dialog is being reduced in the systray and where. Aaron Seigo already talked about these magical effects when things tend to appear or disappear suddenly as if it was a magical object. In short : you should have clear and proper transitions between the two states/locations of a dialog or widget.

Concerning our case with Kuiserver and files operations on a removable device, I think that :

  • when someone copy files from dolphin to a removable device, Dolphin should told to no hide the job by default. Now smart/advanced users could still click on “hide this job” and fall back to present default behavior ( job is hidden, progress is shown in notification area ). This will allow new users to know what’s going.
  • If not, a proper transition should be done explaining and showing that the job is not finished ad that the window is being hidden in the systray. However the issue with this is the fact that only composited environments will be able to handle this.
  • At the end of the job, we should even have the ability to “remove safely” ( umount ) the removable device directly from the job dialog. It means that applications should be able to defined customs actions to do when a job is finished and allow users to do the action or not. Of course, i guess that this can’t be some applications specific actions, except if this can be handle by DBUS calls. Most of the time it could be phonon or solid ones. This way, when the job is finished, the dialog will propose to « safely remove » to ensure data integrity. Something like :
    If you have finished copying your files to this media, don't forget to click on "safely remove" to ensure that your data have been
    correctly transfered. After this you will be able to unplugged your media safely.
    [close]                                     [safely remove]
    

IMHO this feature will be very welcomed notably for users not knowing Linux or computers. How many times do we have to explain to a user under Windows that he needs to click on the tiny icon in the bottom right before unplugging the USB key ? At first they don’t see the icon, then they have complicated thing to do : right click -> safely remove -> select the device ( with some duplicated entries ) -> stop -> at the end they can unplugged the media. At least they know when the copy is finished as the dialog stay on the screen, which allow to reduce the risks of data corruption as they will not normally remove the media while the copy is still running. Under KDE 4, the auto-hide feature increase the risk that the user will just remove the media whereas the copy is still not finished. Please be aware that some USB keys don’t provide a LED showing that the key is being used, or if the user hurried/rushed, he won’t noticed this ( or the Kuiserver icon in the systray ) and will just unplugged the device thinking that the copy is finished and that Linux is marvelous as the transfer/copy was so fast … In the end he ends up with corrupted data or partitions.

References :
More on kuiserver and extenders by rscheepmaker
Extender grouping and notification images by rscheepmaker
fewer magical appearances by Aaron Seigo
Jobs and notifications in the plasma systray. by rscheepmaker
Easy, Beautiful Progress Notification in the Task Bar on forum.kde.org

]]

Thoughts about Linux marketing #3 : Mandriva and its R D projects PR

Last time I talk about the Xtreem OS. As we could see, there were very few communication/PR about this on Mandriva website. This complete lack of communication from Mandriva about theses R&D projects is very strange. Nothing on Planet Mandriva, or in english linux news site like Linux Today, Linux.com, OSNews or LWN.net. If you want to see the different R&D Mandriva projects, have a look at Mandriva R&D page. This page is very well hidden as you can’t see it from the Mandriva website front page. First you need to enter in the Pro section of the website, and then in little letters mostly invisible at the bottom, you will have the link to the R&D page. Don’t expect to have after dedicated pages on the Mandriva website detailing these projects, or having news or further informations notably in the PR page … only the minimum is done. So for everybody visiting the Mandriva corporate page, Mandriva is only doing a Linux distribution ( One and PowerPack ) and a Flash key ( Mandriva ).

If you look in the enterprise section, you will see things about Mandriva Corporate Server, Pulse ( is it a CLI or a GUI thing ? no screenshot ), and Mandriva Directory Server ( vs Linagora LinID ).

Suppose that you want to know the products containing Mandriva Linux products. Indeed, are the products from Mandriva use somewhere in the world ? Have a look at the OEM page … Ok, you have pretty nothing. If you want more informations you need to send an email. But do they talk about what they can provide to OEMs ? IIRC, Mandriva is able to provide support ( vs Linagora support page ) and Consulting, custom Linux distribution and UI ( Mandriva Mini, tailored systems for computers/netbook ( Mandriva mini ) but also media centers solutions ( TouchDiva ), distribution and e-commerce channel ( store.mandriva.com/ ). Mandriva is sold in products like Hercules eCafe, EMTEC Gdium, however you have nothing about this. If I were Mandriva, i would have done the following :

  • Reorganize the Mandriva Corporate site : End-user but also enterprise solutions should be promoted. R&D projects should be more visible and the link should be put in the front page.
  • Visual : if you browse Mandriva website, you will noticed that you have few images. No images or diagram to illustrate the Mandriva products. It’s as if you were selling a laptop or a camera without providing an image and by just providing a minimal technical sheet. Sorry but in modern world with high speed internet connection, people want to see image, video or hear audio ( podcast ) about the products you want to sell.
  • References : When looking for example at Oracle or Microsoft pages, each time and for each of their products, they have references/testimonies from customers or known IT consulting companies like Gartner. Show that your product is known, used, and that your costumers are happy. Check also Linagora website.
  • How do you compare : How does your product compare with other equivalent products ? What do you provide that others don’t have ?
  • « Veille technologique » : What do I mean by this french word ? I mean that your PR department should follow the big news sites ( Linux ones, but also general computers ones, and even news site ), but also big bloggers. A new buzz ? a FUD against Linux ? A new product ? Someone willing to ditch Linux after using distribution X ? Show how mandriva does positioned itself concerning this : react. Hype about cloud-computing ? show that Mandriva is involved in grid-computing. Linux on mobile ? Andro

KDE 4.3 enters in Mandriva Cooker : targetting Mandriva 2010.0

Now that the Mandriva 2009 Spring have been released, the Mandriva development tree for the next version is now opened. Helio Chissini de Castro, from the Mandriva KDE team, announced a few days ago that KDE 4.3 pre-release version will land in cooker. As of today, a few KDE 4.2.70 packages begin to appears on Mandriva cooker FTP repositories. Some KDE applications are being updated too, for example amarok 2.1 Beta1 just hit the repo. Please note that Qt 4.5.1 have been introduced in the repo too. KDE users are advised to wait a little as many things may break.

Others packages have been updated also, so now cookers users can enjoy : mono 2.4, bash 4.0, webkit 1.1.6, drupal 6.11, packagekit 0.4.6, openvas 2.0.1, kernel-linus 2.6.29.2, ndiswrapper 1.54, mesa 7.4.1, kdenlive-0.7.3, wine 1.1.20, nexuiz 2.5, firsts versions of btrfs userpace tools. Please note also the introduction of kernel-netbook 2.6.29.2, a kernel package with optimizations and patches intended for netbook based hardware.

I’ve just noticed than Frederik had already wrote a more detailed post about this 🙂 : Mandriva Cooker (2010.0) opened

]]

Mandriva 2009 Spring et les futures orientations de Mandriva

Ouf, je viens enfin de terminer de mettre

Is MIPS support an opportunity for Mandriva ?

In the first post of my Thoughts about Linux marketing series, at one point I talk about the fact that Mandriva was running under MIPS CPU with the G-dium netbook from EMTEC. Today I’ve read a very interesting article from Ars Technica about Andro

Thoughts about Linux marketing #2 : Mandriva and Grid-computing

Cloud-computing is the magic word theses days. But cloud-computing is based on Grid computing. So what Mandriva have to do with Grid computing ?

From wikipedia definition, Grid computing is the application of several computers to a single problem at the same time – usually to a scientific or technical problem that requires a great number of computer processing cycles or access to large amounts of data. Few people know about it, but Mandriva is involved in the Xtreem OS which aims at investigating and proposing new services that should be added to current operating systems to build Grid infrastructure in a simple way. What’s interesting with Xtreeem OS is the fact that even PDA ( or netbbok ) could be used in the grid system. The main objectives of the XtreemOS project are :

  • To build a reference open source Grid operating system based on Linux for PCs, clusters and mobile devices
  • To provide a simple Grid API compliant with POSIX while adding new functionalities and supporting Grid-aware applications
  • To identify fundamental functionalities to be embedded in Linux for secure application execution in Grid environments
  • To develop a set of self-healing OS services for secure resource management in very large dynamic grids
  • To aggregate cluster resources into powerful Grid nodes by integrating single system image mechanisms in Linux
  • To build an XtreemOS flavour for mobile devices enabling ubiquitous access to Grid resources
  • To validate the design and implementation of the XtreemOS Grid operating system with a set of real use cases in scientific and business domains on a large Grid testbed
  • To promote XtreemOS software and create communities of users and developers.

Partners like EADS, EDF, Nec, SAP, Red Flag and Mandriva are working together to build an ubiquitous grid computing system based on Linux. ISO can be download on the Mandriva mirrors, and RPMS for the Xtreem OS are available. Xtreem OS is based on Mandriva 2008.0, but it seems that a new version may be based on the Mandriva 2009.0. Xtreem OS features list is impressive and can be consult at http://www.xtreemos.org/software/features. One notable feature is XtreemFS , a distributed object-based filesystem that can be mounted from anywhere in the Internet, POSIX-compliant, with client-side caching support and available for various Linux distributions, MacOS X and Win32. It’s strange to see that when people are talking about cloud or grid-computing, we don’t have people from Mandriva giving their advice, and showing the experiences that they have accumulated … At least Mandriva present the Xtreem OS project at Salon Solutions Linux 2009. A video interview is also available on Vnunet french website

Nouvelle page d’accueil de la partie francophone du wiki

Pour la sortie prochaine de la Mandriva 2009 Spring, la partie francophone de wiki.mandriva.com se drape d’un nouvel habillage qui se veut beaucoup plus visuel et didactique. N’hésitez pas à y faire un tour 🙂

http://wiki.mandriva.com/fr/

Interview d’Anne Nicolas la VP Engineering de Mandriva

Eh oui, il m’arrive de poster en fran

About Apple App Store like GUI for Linux

Last time I said that Linux had the technology to provide Apple App Store implementations. Please note that Apple is not the only one providing theses kind of features, as Microsoft, Nokia, Palm and RIM have their own. Of course presently this is done only in the mobile space. But what about doing this on desktop and workstations ? For example if Androïd based netbooks are really going to be shipped, then I’m pretty sure that Androïd Market will be available too. What preventing normal computers from having an application store ? Nothing.

Now look at what is needed to provide an application store :

  • A place to store and published the applications
  • An UI easy to use and allowing users to browse the application catalog
  • A way to allow users to pay and installing paying applications

Every Linux distribution on earth have the ability to store and published applications : just have a look at distributions FTP repositories. Now we just need the right UI, and really this may not be so hard to develop. Xandros understand it already as they are providing in their Presto system an Presto Application Store. If you look at Presto Application Store, you will noticed that the differences with common Linux package management systems are few but very important :

  1. Only the words software or applications are used
  2. Applications are sorted by categories, but you also have sub-categories like « Most popular », « New releases » or « Recommended »
  3. Proprietaries applications ( Acrobat Reader, Skype ) as Free ones are mixed. This is not new, and the same happen with current Linux packages management programs
  4. Only graphical applications are shown, and the notion of packages or dependencies are hidden. Indeed, no need to talk about this in theses kind of UI : just install the needed packages and tell that the application have been installed.
  5. Applications are represented with big icons. The only others informations which can be seen are : the size of the application ( I guess that the dependencies size are not taken into account ), the author ( Free applications could use the Packager or URL tag ) and the rate. IMHO the description of the application is missing, this could be the summary tag or eventually the description one. However as this is a web interface, if you click on the application icon, you will have access to the detailed description of the application, the license information, and some screenshots

I must admit that I’m somewhat skeptic about using a web site to install application, I’d rather use a normal application. Indeed a possible limitation of a web based UI would be the fact that web site doesn’t know which applications are already installed or not on your system, and then it will display unneeded applications. However it’s true that developing an application with theses kinds of UI under Linux may be hard. Indeed several issues will make the task hard : interface theming, ability to jump to applications details information, ability to display applications screenshots and show them at bigger size, and of course animations effects. Now the needed framework are coming slowly to Linux : Clutter for Gtk application and Plasma ( or Qt QGraphicsView ) allow now to designed complexed interfaces with animations effects support. With Webkit support, you can even embedded a web interface in the application or use it to display external resources.

Contrary to popular belief, this is not the first time that a Linux distribution is trying to provide theses kind of features. If you look closely, you will noticed that Presto Application Store is based on Xandros CNR technology. OpenSuse have also 1-click install but which is still too much technical ( you see the entire package name, while installing an application will be started and it will show too much informations ). Mandriva also had the same kind of technology than OpenSuse in the past.

Please note that I don’t think that classic packages managers UI should be removed. IMHO they should be used by advanced users or for advanced task, like installing servers or CLI applications.

Presto Application Store screenshot

Catégories

My Tweets