Thibauld - Imagination and Execution -

15Feb/100

How to exclude multiple directories while creating an archive with tar

RT @thibauld How to exclude multiple directories while creating an archive with tar

A very quick post again as I've just spent way too much time to find out how to use the --exclude option of tar. All I wanted is tar to omit a few subdirectories while creating an archive of a directory. I was surprised to see how much tar is picky about his --exclude option: if you don't use the exact syntax, it won't work and, unfortunately, the exact syntax is not so easy to figure out from the man page.

So here is the exact syntax you should use if you want to exclude multiples directories with tar:

tar cvfz myproject.tgz --exclude='path/dir_to_exclude1' --exclude='path/dir_to_exclude2' myproject

Hope it will save you some time!

15Feb/100

Moblin and Maemo projects are merging

RT @thibauld Moblin and Maemo projects are merging

Wow, just received this email from the Moblin mailing list. It announces the merge between Moblin (Intel initiated project) and Maemo (Nokia initiated project) :

Hi Everyone

I'm sure you've heard the news: Moblin and maemo are merging! We are taking the best pieces from these two open source projects and are creating the MeeGo software platform. Both teams have worked for a long time to support the needs of the mobile user experience - and MeeGo will make this even better. We want it to be fun, focused, flexible, technically challenging and ultimately, something that can change the world.

We all use mobile devices every day. The power and capability of handhelds has reached astounding levels - netbooks have been a runaway success - and connected TVs, tablets, in-vehicle infotainment, and media phones are fast growing new markets for devices with unheard of performance. Our goal is to develop the best software to go with those devices. The teams behind maemo and Moblin have plenty of experience and even more ideas on how to make things better - and together we will create something special.

So what does this mean for Moblin and its community? It's a huge opportunity. There are some changes (and those are always scary), but I think they are all for the better. Things will quickly shift to the new site, but from a technology point of view, migrations should be smooth. Especially if you are an application developer; everything you have done so far should continue to work - and with Qt and its development environment there are even more and easier options available to develop new and exciting apps for MeeGo.

The MeeGo website is still evolving - you'll run into a few "coming soon" pages as we pull all the content together and get things ready for our first project release in the second quarter. But there's already a lot to see - and a community to join! Please take a look - and come back often as we approach that first release.

We really want to hear from you. Be in on IRC, on our developer mailing list, or through bugzilla. MeeGo is an open project and it will be successful through its developer community. It's my personal goal to make sure that we can all together be successful. And have fun.

I invite you to join us at meego.com.

Imad Sousou

Director of Intel's Open Source Technology Center
(and now also co-chair of the MeeGo steering group)

From a business standpoint, it does make a lot of sense to merge these 2 projects, now let's see if the merge can be handled smoothly technically speaking... might not be as easy as it sounds.

5Feb/100

Configuring iptables to allow internet surfing while blocking all unsolicited incoming connexions

RT @thibauld Configuring iptables to allow internet surfing while blocking all unsolicited incoming connexions

I'm so used to connect to the Internet through network masquerading (NAT) that I was really surprised today when I realised that my laptop was actually receiving a lot of unsollicited connexions attempts from random external machines. Then I remembered that, by default, a freebox gives you a public ip !

It could not have been an issue if I was not doing web development on my laptop using a local (badly configured) webserver which happened to be worldwide accessible... oOops :)

A few iptables commands later, everything was secured :

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -j ACCEPT

The above lines configure iptables (the firewall) to drop every incoming connexions except the ones corresponding to a connexion I established with a remote server. Indeed, the server you're connecting to needs to be able to send information back to your machine in order for you to get it (blocking all incoming traffic is the same as unplugging the network connection).

I thought it might be useful to some of you too...

31Dec/090

Google real time search results

RT @thibauld Google real time search results

I've just noticed beautiful live search results integrated into google search results tonight. I had never seen them before so I thought I'd share this news-to-me with you :) Here's what I saw when I looked for "2010 resolutions" :

google_live_search_results

And then, a few seconds later, without refreshing anything on my side :

google_live_search_results1

I love it :)
Now let's go party for 2010!
Happy new year everybody!

15Dec/092

Société Générale en panne ?

RT @thibauld Société Générale en panne ?

J'aime quand le site de ma banque fonctionne bien... sans commentaires



societe_generale_website

8Dec/090

8th of December aka “The Longest Day”

RT @thibauld 8th of December aka “The Longest Day”

I don't why but, today, 8th of December, everybody decided that it was *the* day to make events and conferences. We had no event or such since a few month and then, suddenly, you have this crowded 8th of December. Today I would have love to attend :

  • The P'tits déjeuners de la science organised by my engineering school (INSA de Lyon) with Valérie Pécresse and Claudie Haigneré (french politics)
  • The Netbook World Summit organised by Mandriva with the presence of Scott Apeland, responsible for the Intel Software Network (read Application Store)
  • The World first Bizspark Camp organised by Microsoft with the presence of Scott Guthrie, Corporate Vice President de Microsoft Corp, .NET Developer Division
  • The Annuel meeting of G9+ with the following topic: "L'entreprise face aux Réseaux Sociaux" [quick translation: "Companies and Social Networks"] in the presence of Tara Hunt
  • The Life is better on party organised by OpenCoffee Paris before LeWeb
  • The Partners & Speakers reception for LeWeb'09 organised by Loïc & Géraldine

Now this is really great but please, next time, let's try to spread that a little over a few days so that I do not have to choose between the events :)

7Dec/090

Allmyapps 4 slides pitch for OpenCoffe Paris before LeWeb

RT @thibauld Allmyapps 4 slides pitch for OpenCoffe Paris before LeWeb

opencoffee

It's been sooo long since I blogged! The thing is that the activity at Allmyapps is just exploding (a good problem to deal with!) and unless days suddenly get bigger (say 48h a day), there's no way I can keep up-to-date with my todo list. Task prioritization is the keyword right now at Allmyapps :)

However, I really *want* to write more blog posts... so I'll try to make a bit smaller while keeping their interestingness high. Let's begin now and see if I can manage that in the long run.

Today, I just wanted to share with you the 4 slides we've proposed to pitch Allmyapps at the OpenCoffee Paris which is taking place right before LeWeb09.



I hope we'll be selected to pitch! [Edit: We've been selected to pitch!]

17Jul/091

PHP function to draw nice looking XY plot charts with google chart API

RT @thibauld PHP function to draw nice looking XY plot charts with google chart API

Creating nice charts used to be a hard task. Lately, I dug a little bit into Google chart API to see what they had to offer and how they could help me draw nice looking charts easily.

In theory, using Google chart is dead simple: just build an URL with the right parameters and Google will return you an image with your nice looking chart. However, in practice, it turned out a little bit more tricky. If you only want to draw a pie charts then it is pretty straight forward. But if you want to build an XY plot chart, then it gets harder!

Indeed, you should not use Google chart API like you'd use a spreadsheet. Keep in mind that Google chart API is about drawing an image: the X axis and the Y axis are treated completely independantly of your points coordinates.  If you do not pay enough attention, you'll end up with a chart with a completely wrong scale.

I tried to find some PHP libraries to help me draw my XY chart but found nothing satisfactory, so I finally decided to write my own little PHP function. Let me share it with you:

function getChart($chart) {
$y_max = $chart['y_max'];
$y_min = $chart['y_min'];
$y_step = $chart['y_step'];
$y_grid_step = $chart['y_grid_step'];
$x_max = $chart['x_max'];
$x_min = $chart['x_min'];
$chart_size = $chart['chart_size'];
$title = $chart['title'];
$x = $chart['x_axis'];
$x_nb = count($x);
$x_int = 100/$x_nb;
$first = 0;
if ($chart['x_labels_centered']) $first = $x_int/2;
for($i=0;$i<=$x_nb-1;$i++) { $positions[] = floor($first + ($i * $x_int)); }
foreach($positions as $n => $pos) { $x_values[$pos] = $x[$n]; }
$x_range = implode(',',array_keys($x_values));
$x_labels = implode('|',$x);
$grid_step = $y_grid_step*100/$y_max;
$url = "http://chart.apis.google.com/chart?";
$cht = "cht=lc";
if (!empty($chart['data_y'])) $cht="cht=lxy";
$chd = "chd=t:".implode(',',$chart['data']);
if (!empty($chart['data_y'])) $chd.="|".implode(',',$chart['data_y']);
$chg = "chg=$x_int,$grid_step,1,5";
$chxt = "chxt=x,y";
$tmp = array();
for ($i=0;$i<=$y_max;$i+=$y_step) { $tmp[] = $i; }
$y_labels = implode(',',$tmp);
$chxp = "chxp=0,".$x_range."|1,".$y_labels;
$y_labels = implode('|',$tmp);
$chxl = "chxl=0:|".$x_labels."|1:|".$y_labels;
$chxr = "chxr=1,$y_min,$y_max,$y_step";
$chtt="chtt=".str_replace(' ','+',$title);
$chs = "chs=".$chart_size;
$chds = "chds=$y_min,$y_max";
$chm="chco=0000FFFF&chm=B,76A4FB,0,0,0";#|s,0000FF,0,-1,10";
if (!empty($chart['data_y'])) $chds ="chds=$x_min,$x_max,$y_min,$y_max";
$url .= implode('&', array($cht,$chd,$chg,$chm,$chxt,$chxl,$chxp,$chxr,$chtt,$chs,$chds));
return $url;
}

Dont' get me wrong: this is really a quick and dirty function and not meant to be beautiful code. Here is an invokation example:

$data_x = array(0,4,5,9,10);
$data_y = array(20,5,7,9,10);
$months_x = array('Jan','Fev','Mar','Avr','May');
$chart_xy = array(
'title'=>"Chart Title", // CHART TITLE
'data'=>$data_x, // CHART DATA (X)
'data_y'=>$data_y, // CHART DATA (Y)
'x_axis'=>$months_x, // X AXIS LABELS LIST
'x_labels_centered'=>true, // SHOULD LABELS ON X AXIS BE CENTERED?
'y_min'=>0, // MIN VALUE OF Y AXIS
'y_max'=>25, // MAX VALUE OF Y AXIS
'y_step'=>5, // Y AXIS INTERVAL (NUMBERS ON THE AXIS)
'y_grid_step'=>5, // Y AXIS GRID INTERVAL (HORIZONTAL LINES ON THE GRID)
'x_min'=>0, // MIN VALUE OF X AXIS
'x_max'=>10, // MAX VALUE OF X AXIS
'chart_size'=>'300x300' // CHART DIMENSIONS
);
$url = getChart($chart_xy);

This code would result in the following graph:

And if I change :

$months_x = array('Jan','Fev','Mar','Avr','May');

by

$months_x = array('Jan','Fev','Mar');

I get the following graph:

What is important to note here is that it is up to you to make your X and Y axis consistent with your data, ortherwise, you'll end up with a totally meaningless chart.

Of course, this code is adapted to my needs so please feel free to copy this PHP function and adapt it so that it fits your particular needs!

Hope it will be useful for some of you...

25Jun/092

Interviewed about entrepreneurship on “Décideurs TV” [french web TV]

RT @thibauld Interviewed about entrepreneurship on “Décideurs TV” [french web TV]

Hi there! Just a quick post to let you know that I've been interviewed by Décideurs TV (a business focused web television) about entrepreneurship: Should you start your business alone or find a partner / cofounder? How to find the right partner for your business. What is a good partner? etc... The result can be seen here or directly below:


Start up par DECIDEURS TV

It was my first video interview ever and I must say that I'm pretty happy with the result :)

15Jun/090

ISP Speed test

RT @thibauld ISP Speed test

I just came accross this cool ISP speed test. I was pretty pleased with the results considering that I was listening to a web radio at the same time:



I guess that living in Paris helps a lot... However, I was more disappointed that France ranked only 20th in the list of the countries with the highest average download rate and 35th in the list of the countries with the highest upload rate. When I see some internet connection speeds, I realize there is room for improvement :)

However, it was quite cool to see that apart from Japan and South Korea, there are only european countries in the top 10 ! This is likely to give more arguments to our most fervent lobbyist for very high speed internet connections throughout France !

Filed under: Uncategorized No Comments