Archive

Archive for October, 2009

How to secure your WordPress blog ?

October 31st, 2009 Guillaume No comments

A little tip to secure your WordPress blog (you can use it with another CMS indeed) : just put a .htaccess into you admin folder : for WordPress it’s in wp-admin

Example .htaccess

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist home IP address
allow from my.ip.at.home
# whitelist work IP address
allow from my.ip.at.work
</LIMIT>

And of course, you change this file with your own IP addresses…

Categories: Wordpress Tags: ,

How to create a debian package from sources ?

October 31st, 2009 Guillaume No comments

Sometimes it happens we want to create his own .deb package from the sources repository (e.g. when you like to use the last up-to-date version and the binary package doesn’t exist…)

It’s very easy if you follow the rules in the good order :-)

  1. Download sources files of your software (for this example it could be drupal6 even if the binary package exists now…)
    1. drupal6_6.14-1.orig.tar.gz
    2. drupal6_6.14-1.diff.gz
    3. drupal6_6.14-1.dsc
  2. Un-compress drupal6_6.14.orig.tar.gz
  3. Un-compress drupal6_6.14.diff.gz
  4. You’ll probably need some tools if it’s your first building package process :
    1. sudo apt-get install dpatch
    2. sudo apt-get install fakeroot
  5. Run : patch -p1 < xxx.diff
  6. Move the debian directory created in previous step into the folder created in step 2 (the one which contents the sources from *.orig.tar.gz, for this example it’s drupal-6.14) : mv debian drupal-6.14
  7. Go into the sources directory : cd drupal-6.14
  8. You’ll probably make debian/rules script executable… Run : chmod +x debian/rules
  9. Then run : dpkg-buildpackage -rfakeroot -uc -b
  10. That’s all ! You just have to install your new freshly compiled package. So, for our example it will be :
    1. cd ..
    2. sudo dpkg -i drupal6-6.14_all.deb

You know the way now…

Categories: OS Tags: ,

World of Goo

October 31st, 2009 Guillaume No comments

World of Goo

Programming is fun and exciting but from time to time a game is good to relax ! So, I give you a free advice : play with the brilliant “World Of Goo” … For 13 euros 50 (20 dollars) you will play hours to solve enigma of this “puzzle game”. Honestly, it’s worth it ! It’s original even if “puzzle game” is a classical. What you have here is a game where interest and fun are more important than to “kill them all” boring concept… Levels are not so easy and require agility and brain efforts ;-) You will be quickly addict ! Moreover, developers have choosen to not protect this game against the copy (no DRM, no protection at all) : and even more, by buying one licence, you can download the Windows, Mac and Linux version (32 and 64 bits) !! Try it, and if you like it, support them by buying this cooooool game !

Categories: Games Tags: ,

WPML, multi language and search engine

October 31st, 2009 Guillaume No comments

If you are using WordPress and the WPML plugin to manage your web site in multi language, you have surely noticed that when a visitor uses the search engine, WordPress displays the result list of the default language and not of the language currently used by the visitor…

To upgrade this feature, I’ve done a little patch… It’s a quick and dirty one but it works (you can easily optimise this by using a function to overload the default behavior of WordPress instead of directly modifying the standard WordPress files (and loosing your modification during the next upgrade…)

Update the file wp-includes/general-template.php for the function get_bloginfo like this :

case 'short_language':
  $output = get_locale();
  $short_language = explode("_", $output);
  $output = $short_language[0];
break;

And the on your theme (e.g. iNove in wp-content/themes/inove/templates/header.php file) :

You just have to modify the form like this :

<form action="<?php bloginfo('home'); ?>/<?php bloginfo('short_language'); ?>/"
      method="get">

Have fun with WordPress and WPML !

ps : you can also modify the links to your title/home to avoid switching language when a user click on the logo

<h1 id="title">
  <a href="<?php bloginfo('url'); ?>/<?php bloginfo('short_language'); ?>/">
    <?php bloginfo('name'); ?>
  </a>
</h1>

and for the breadcrumbs…

<a title="<?php _e('Home', 'inove'); ?>"
   href="<?php echo get_settings('home'); ?>/<?php bloginfo('short_language'); ?>/">
  <?php _e('Home', 'inove'); ?>
</a>

By the way, the idea comes from this thread…

Categories: Wordpress Tags: ,

WPtouch in french

October 31st, 2009 Guillaume No comments

If, like me, you are using WPtouch to manage the display of your web site in “iPhone mode”… You can use the french translation I did.

You have just to add this code in the beginning of your wptouch.php file under the line
define( 'WPTOUCH_PROWL_APPNAME', 'WPtouch');

/** l10n */
function wptouch_plugin_localization(){
  load_plugin_textdomain('wptouch', false, 'wptouch/locale');
}
add_action ('init', 'wptouch_plugin_localization');

And then unzip the translation file for WPtouch 1.9.19.14 into your wptouch/locale folder.

You should have the following treeview :

./wptouch/locale
./wptouch/locale/wptouch-fr_FR.mo
./wptouch/locale/wptouch-fr_FR.po

That’s all folks
The frontoffice and backoffice side of this plugin are then translated in french.

You can use this “addon” for free, don’t hesitate to upgrade it or send me a comment !

See alse :

Categories: Wordpress Tags: ,

Ubuntu GNU/Linux 9.10 is launched !

October 29th, 2009 Guillaume No comments

The Ubuntu GNU/Linux 9.10 is released !

Instead of losing your money with Windows Seven… switch to Linux ;-)

Categories: OS Tags: ,

Once upon a time in the WebKit galaxy

October 14th, 2009 Guillaume No comments

Who says WebApp for iPhone, says WebKit. Behind this weird word is simply a collection of images in PNG, CSS style sheet and one Javascript page, the whole optimized to look and feel like a true native iPhone application.

Yes, but there it is… The WebKit War rages on ! In the beginning was iUI, then iWebKit appears and finally WebApp.net comes to life (Why to choose a name like this for a library that has strictly no relation with the .Net Microsoft framework ? I suppose it’s only to surf on the hype of this word… pfff).

I tests these webkit for 1 month to build my own little iMedia application (I’ve shortened the name who was initially iMediaLibrary). And the report is that none of these webkit is convenient for me.

All have qualities and defects. iWebKit is rich and well documented. iUI manage the “slide” effect almost perfectly and has few bugs. WebApp.Net is a compromise between these 2 ones but it’s the one I’ve the least tested… so it’s difficult to give a definitive advice.

Make no mistake, behind these concise comments I’ve much admiration for all this work done and I’m impressed how precisely a wep application can mimic the behavior of a native iPhone application with these kits.

But indeed, the most frustrating thing is to notice that all these projects are working to achieve the same goal… and it would be much more efficient if they were all federate around a single one instead of being scattered.

Obviously the NIH syndrome (Not Invented Here) is still raging and I will probably contribute to make it worse by trying to build my own webkit. It will be a synthesis of all the good ideas we can find inside the three webkits above.

yaiWebKit : Yet Another iPhone Web Kit (by waiting to find better ;-) )

This is the name of the project I’m starting to create jointly with iMedia. If you are interested or if you’re already participating to an iPhone Webkit, contact me !

The main objectif will be to reproduce as faithfully as possible the graphical interface and the native behavior of the iPhone… and add feature when and only when the current version contains zero bug… In other words, I’m not ready to have a webkit as rich as iWebKit :-) But as the short-term purpose is to supply a library for iMedia and no more, it is not necessarily a bad thing.

To be continued…

Categories: iPhone Tags: , ,

New site, new projects…

October 14th, 2009 Guillaume No comments

Sometimes, you change your phone and you want to change your website too ;-)

Then, instead of trying to do the “perfect” website once again without having the time to do it like I would like… I’ve decided to just create this simple webpage for now to show you my first iPhone web application !

iMediaLibrary : A few words about a long story…

For a long time I collect books, CD, DVD and more recently Blu-ray… to find a particular item and to not buy many times the same article (when publishers change the cover’s picture for a reedition you can do mistakes…) I’ve started to manage all this stuff in a spreadsheet.

But of course I never had this file with me in a shop when needed. A short time later I’ve bought a Palm IIIe and transformed my file to a small database with HandBase then with Pilot-DB which, maybe simpler, was published under GPL license, used a non-proprietary format to store data and was able to run under Linux (a true happiness : I’ve definitively switched to Linux on my own PC since year 2000).

New problem : data synchronisation when I modified my database on my Palm or on my PC, the conflicts to solve, etc… I have nevertheless to use this system several years waiting for an hypothetical PalmPhone with a Kernel Linux… reported year after year with the long declin of Palm Inc… (yes I know, since that Palm has launched the Palm Pré but it’s too late for me (and now Google Android is ready too…)).

As the result I’ve finished to decide to buy a smartphone under Windows Mobile 5, quickly upgraded to WM6 : an HTC P3600 (also known as Trinity). And the Palm database has been totally migrate to a web application using PHP and MySQL… No more synchronisation problem : from my phone or my PC I can access to my database through the Internet. With a clean design, using this application on the little screen of a smartphone is pretty good… I’ve even added some features : displaying of the CD and DVD covers, and management of the additionals data for authors, players, actors, directors associated to these works… It’s always this program I use now.

But now… I’ve just “switched” to a brand new iPhone 3GS :-) So, a new version is in progress to develop a specific iPhone graphical user interface !

And the cherry on the cake (for you if you are reading these lines) : the new version in progress will be multi-users !

You can use it free of charge* if you want to register your own library ! Informations of each user will be strictly isolated and only people with the proper permissions can see data of course. Finally, you can manage the loans, give access to you media library for reading and/or writing to your friends (and even manage grants levels by document (private, public, restricted, etc)) and import/export your data to CSV file.

Be patient… Waiting for, if you have any idea to add a new feature, don’t hesitate to send me an email !

*but you can make a donation with Paypal if you want :-)

Categories: iPhone Tags: , , ,