<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: benoitbalon: date</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>Modifier la date de la prise d'une photo dans les informations EXIF</title>
        <link>http://www.posteet.com/view/1217</link>
        <description>
        <![CDATA[<pre>#! /bin/bash

for i in `ls -1 *.jpg`
do
    # Affiche la date et l'heure auxquelles la photo a ete prise (encore faut-il que l'appareil photo soit correctement configure !)
    exiv2 $i | grep Horodatage

    # Change l'annee de la prise de la photo (ici l'annee 2008)
    jhead -ds2008 $i

    # Avance l'heure de la prise de la photo (ici 1h 30m et 5s)
    jhead -ta+01:30:05 $i

    # Recule l'heure de la prise de la photo (ici 0h 20m et 0s)
    jhead -ta-00:20:00 $i
done</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/date">[date]</a>  <a href="http://www.posteet.com/tags/exif">[exif]</a>  <a href="http://www.posteet.com/tags/exiv2">[exiv2]</a>  <a href="http://www.posteet.com/tags/jhead">[jhead]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Fri, 22 Aug 2008 16:27:43 +0000</pubDate>

            <category>bash</category>
            <category>date</category>
            <category>exif</category>
            <category>exiv2</category>
            <category>jhead</category>
    
    </item>

  
    <item>
        <title>Quantième jour</title>
        <link>http://www.posteet.com/view/797</link>
        <description>
        <![CDATA[<pre>#!/bin/sh

usage=&quot;Usage : $0 -q `date +'%j'` [-y `date +'%Y'`]&quot;

# gestion de la ligne de commande
if test &quot;$#&quot; -eq 2
then
	if test &quot;$1&quot; != &quot;-q&quot;
	then
		echo $usage
		exit 1
	fi
elif test &quot;$#&quot; -eq 4
then
	if test &quot;$1&quot; != &quot;-q&quot;
	then
		echo $usage
		exit 1
	fi
	if test &quot;$3&quot; != &quot;-y&quot;
	then
		echo $usage
		exit 1
	fi
else
	echo $usage
	exit 1
fi

qte=$2

if test &quot;$4&quot; != &quot;&quot;
then
	annee_act=$4
	val_y=`expr $annee_act + 1 2&gt;&gt; /dev/null`
	if test &quot;$?&quot; != &quot;0&quot;
	then
		echo $usage
		exit 1
	fi
fi

# verification des nombres
val_q=`expr $qte + 1 2&gt;&gt; /dev/null`
if test &quot;$?&quot; != &quot;0&quot;
then
	echo $usage
	exit 1
fi

# depassements de valeurs
if test &quot;$qte&quot; -gt 366
then
	echo $usage
	exit 1
fi

if test &quot;$qte&quot; -lt 1
then
	echo $usage
	exit 1
fi

# comparaison avec le quantieme actuel
if test &quot;$4&quot; = &quot;&quot;
then
	qte_act=`date +'%j'`
	annee_act=`date +'%Y'`

	if test &quot;$qte_act&quot; -gt &quot;$qte&quot;
	then
		continue
	elif test &quot;$qte_act&quot; -lt &quot;$qte&quot;
	then
		# la date recherchee est dans l'annee passee
		annee_act=`expr $annee_act - 1`
	else
		# la date recherchee est celle d'aujourd'hui
		echo `date +'%Y-%m-%d'`
		exit 0
	fi
fi


bis=`expr $annee_act % 4`
if test &quot;$bis&quot; -gt 0
then
	fin_janvier=31
	fin_fevrier=`expr 31 + 28`
	fin_mars=`expr 31 + 28 + 31`
	fin_avril=`expr 31 + 28 + 31 + 30`
	fin_mai=`expr 31 + 28 + 31 + 30 + 31`
	fin_juin=`expr 31 + 28 + 31 + 30 + 31 + 30`
	fin_juillet=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31`
	fin_aout=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31`
	fin_septembre=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30`
	fin_octobre=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31`
	fin_novembre=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30`
	#fin_decembre=`expr 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31`
else
	fin_janvier=31
	fin_fevrier=`expr 31 + 29`
	fin_mars=`expr 31 + 29 + 31`
	fin_avril=`expr 31 + 29 + 31 + 30`
	fin_mai=`expr 31 + 29 + 31 + 30 + 31`
	fin_juin=`expr 31 + 29 + 31 + 30 + 31 + 30`
	fin_juillet=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31`
	fin_aout=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31`
	fin_septembre=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30`
	fin_octobre=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31`
	fin_novembre=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30`
	#fin_decembre=`expr 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31`
fi

# annee non bissextile
if test &quot;$qte&quot; -eq 366 &amp;&amp; test &quot;$bis&quot; -gt 0
then
	exit 1
fi

# detection de l'annee bissextile
if test &quot;$qte&quot; -le &quot;$fin_janvier&quot;
then
	mois=&quot;01&quot;
	jour=`expr $qte + 0`
elif test &quot;$qte&quot; -le &quot;$fin_fevrier&quot;
then
	mois=&quot;02&quot;
	jour=`expr $qte - 31`
elif test &quot;$qte&quot; -le &quot;$fin_mars&quot;
then
	mois=&quot;03&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_avril&quot;
then
	mois=&quot;04&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_mai&quot;
then
	mois=&quot;05&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_juin&quot;
then
	mois=&quot;06&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_juillet&quot;
then
	mois=&quot;07&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_aout&quot;
then
	mois=&quot;08&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30 - 31`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30 - 31`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_septembre&quot;
then
	mois=&quot;09&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30 - 31 - 31`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30 - 31 - 31`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_octobre&quot;
then
	mois=&quot;10&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30 - 31 - 31 - 30`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30 - 31 - 31 - 30`&quot;
	fi
elif test &quot;$qte&quot; -le &quot;$fin_novembre&quot;
then
	mois=&quot;11&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30 - 31 - 31 - 30 - 31`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30 - 31 - 31 - 30 - 31`&quot;
	fi
else
	mois=&quot;12&quot;
	if test &quot;$bis&quot; -gt 0
	then
		jour=&quot;`expr $qte - 31 - 28 - 31 - 30 - 31 - 30 - 31 - 31 - 30 - 31 - 30`&quot;
	else
		jour=&quot;`expr $qte - 31 - 29 - 31 - 30 - 31 - 30 - 31 - 31 - 30 - 31 - 30`&quot;
	fi
fi

# affichage de la date trouvee
if test &quot;$jour&quot; -lt 10
then
	echo &quot;${annee_act}-${mois}-0${jour}&quot;
else
	echo &quot;${annee_act}-${mois}-${jour}&quot;
fi</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/date">[date]</a>  <a href="http://www.posteet.com/tags/jour">[jour]</a>  <a href="http://www.posteet.com/tags/numero jour">[numero jour]</a>  <a href="http://www.posteet.com/tags/quantieme">[quantieme]</a>  <a href="http://www.posteet.com/tags/quantieme jour">[quantieme jour]</a>  <a href="http://www.posteet.com/tags/shell">[shell]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Thu, 28 Feb 2008 12:43:59 +0000</pubDate>

            <category>bash</category>
            <category>date</category>
            <category>jour</category>
            <category>numero jour</category>
            <category>quantieme</category>
            <category>quantieme jour</category>
            <category>shell</category>
    
    </item>

  
    <item>
        <title>Calendrier dynamique mois par mois</title>
        <link>http://www.posteet.com/view/713</link>
        <description>
        <![CDATA[<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//FR&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;fr&quot; lang=&quot;fr&quot;&gt;
	&lt;head&gt;
		&lt;script language=&quot;javascript&quot;&gt;
			function get_mois(annee, mois, bloquer_a_date_actuelle, emplacement, bouton)
			{
				var today = new Date();
				var date_a_traiter = today;
				
				if (annee != null &amp;&amp; mois != null)
				{
					if (! bloquer_a_date_actuelle)
					{
						if (annee != today.getFullYear() || mois != today.getMonth())
						{
							date_a_traiter = new Date(annee, mois, 1);
						}
					}
					else
					{
						if (annee &lt; today.getFullYear() || mois &lt; today.getMonth())
						{
							date_a_traiter = new Date(annee, mois, 1);
						}
					}
				}
				
				var current_year = date_a_traiter.getFullYear();
				var current_month = date_a_traiter.getMonth();
				
				var debut_mois = new Date(current_year, current_month, 1);
				var premier_jour_mois = debut_mois.getDay();
				
				var fin_mois = new Date(current_year, current_month + 1, 0);
				var derniere_date_mois = fin_mois.getDate();
				
				var mon_code = &quot;&quot;;
				mon_code = &quot;\&lt;table\&gt;&quot; +
								&quot;\&lt;tr class=\&quot;deplace\&quot;\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;a id=\&quot;annee_precedente\&quot; href=\&quot;\&quot; class=\&quot;survol\&quot; title=\&quot;Ann&amp;eacute;e pr&amp;eacute;c&amp;eacute;dente\&quot;\&gt;\&lt;\&lt;\&lt;/a\&gt;\&lt;/td\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;a id=\&quot;mois_precedent\&quot; href=\&quot;\&quot; class=\&quot;survol\&quot; title=\&quot;Mois pr&amp;eacute;c&amp;eacute;dent\&quot;\&gt;\&lt;\&lt;/a\&gt;\&lt;/td\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;span id=\&quot;mois_annee\&quot;\&gt;\&lt;/span\&gt;\&lt;/td\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;a id=\&quot;mois_suivant\&quot; href=\&quot;\&quot; class=\&quot;survol\&quot; title=\&quot;Mois suivant\&quot;\&gt;\&gt;\&lt;/a\&gt;\&lt;/td\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;a id=\&quot;annee_suivante\&quot; href=\&quot;\&quot; class=\&quot;survol\&quot; title=\&quot;Ann&amp;eacute;e suivante\&quot;\&gt;\&gt;\&gt;\&lt;/a\&gt;\&lt;/td\&gt;&quot; +
									&quot;\&lt;td\&gt;\&lt;a id=\&quot;fermer_calendrier\&quot; href=\&quot;javascript: cacher_calendrier('&quot; + emplacement + &quot;', '&quot; + bouton + &quot;');\&quot; class=\&quot;survol\&quot; title=\&quot;Fermer le calendrier\&quot;\&gt;x&lt;/a\&gt;\&lt;/td\&gt;&quot; +
								&quot;\&lt;/tr\&gt;&quot; +
							&quot;\&lt;/table\&gt;&quot;;
				mon_code = mon_code + &quot;\&lt;table\&gt;\&lt;tr class=\&quot;titre\&quot;\&gt;\&lt;td\&gt;Lu\&lt;/td\&gt;\&lt;td\&gt;Ma\&lt;/td\&gt;\&lt;td\&gt;Me\&lt;/td\&gt;\&lt;td\&gt;Je\&lt;/td\&gt;\&lt;td\&gt;Ve\&lt;/td\&gt;\&lt;td\&gt;Sa\&lt;/td\&gt;\&lt;td\&gt;Di\&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
				
				for (var i = 1 ; i &lt;= derniere_date_mois ; i++)
				{
					var ma_date = new Date(current_year, current_month, i);
					
					var style_today = &quot; onclick=\&quot;javascript: alert('&quot; + i + &quot;/&quot; + current_month + &quot;/&quot; + current_year + &quot;');\&quot;&quot;;
					if (i == date_a_traiter.getDate() &amp;&amp; (ma_date.getDay() == 0 || ma_date.getDay() == 6) )
					{
						if (date_a_traiter == today)
						{
							style_today = style_today + &quot; class=\&quot;today_we\&quot;&quot;;
						}
						else
						{
							style_today = style_today + &quot; class=\&quot;not_today_we\&quot;&quot;;
						}
					}
					else if (i == date_a_traiter.getDate() &amp;&amp; (ma_date.getDay() != 0 &amp;&amp; ma_date.getDay() != 6) )
					{
						if (date_a_traiter == today)
						{
							style_today = style_today + &quot; class=\&quot;today_not_we\&quot;&quot;;
						}
						else
						{
							style_today = style_today + &quot; class=\&quot;not_today_not_we\&quot;&quot;;
						}
					}
					else if (i != date_a_traiter.getDate() &amp;&amp; (ma_date.getDay() != 0 &amp;&amp; ma_date.getDay() != 6) )
					{
						style_today = style_today + &quot; class=\&quot;not_today_not_we\&quot;&quot;;
					}
					else if (i != date_a_traiter.getDate() &amp;&amp; (ma_date.getDay() == 0 || ma_date.getDay() == 6) )
					{
						style_today = style_today + &quot; class=\&quot;not_today_we\&quot;&quot;;
					}
					
					if (i == 1)
					{
						switch (ma_date.getDay())
						{
							case 1:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 2:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 3:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 4:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 5:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 6:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;&quot;;
									break;
							case 0:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td&quot; + style_today + &quot;\&gt;1\&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
						}
					}
					else if (i == derniere_date_mois)
					{
						switch (ma_date.getDay())
						{
							case 1:
									mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 2:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 3:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 4:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 5:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 6:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;td\&gt; \&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
									break;
							case 0:
									mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;/tr\&gt;\&lt;/tr\&gt;&quot;;
									break;
						}
					}
					else
					{
						if (ma_date.getDay() == 0)
						{
							mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;\&lt;/tr\&gt;&quot;;
						}
						else if (ma_date.getDay() == 1)
						{
							mon_code = mon_code + &quot;\&lt;tr\&gt;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;&quot;;
						}
						else
						{
							mon_code = mon_code + &quot;\&lt;td&quot; + style_today + &quot;\&gt;&quot; + i + &quot;\&lt;/td\&gt;&quot;;
						}
					}
				}
				
				mon_code = mon_code + &quot;\&lt;/table\&gt;&quot;;
				document.getElementById(emplacement).innerHTML = mon_code;
				document.getElementById(&quot;mois_annee&quot;).innerHTML = get_select_month(current_month, current_year, bloquer_a_date_actuelle, emplacement) + &quot; &quot; + get_select_year(current_year, current_month, bloquer_a_date_actuelle, emplacement);
				
				var annee_precedente = new Date(current_year - 1, current_month, 1);
				var annee_suivante = new Date(current_year + 1, current_month, 1);
				var mois_precedent = new Date(current_year, current_month - 1, 1);
				var mois_suivant = new Date(current_year, current_month + 1, 1);
				document.getElementById(&quot;annee_precedente&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + annee_precedente.getFullYear() + &quot;, &quot; + annee_precedente.getMonth()  + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
				document.getElementById(&quot;mois_precedent&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + mois_precedent.getFullYear() + &quot;, &quot; + mois_precedent.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
				if (bloquer_a_date_actuelle)
				{
					if (current_year &gt;= today.getFullYear() &amp;&amp; current_month &gt;= today.getMonth())
					{
						document.getElementById(&quot;annee_suivante&quot;).setAttribute(&quot;href&quot;, &quot;javascript: alert(\&quot;Vous ne pouvez pas aller au-delà de la date actuelle\&quot;);&quot;);
						document.getElementById(&quot;mois_suivant&quot;).setAttribute(&quot;href&quot;, &quot;javascript: alert(\&quot;Vous ne pouvez pas aller au-delà de la date actuelle\&quot;);&quot;);
					}
					else if (current_year &gt;= today.getFullYear() &amp;&amp; current_month &lt; today.getMonth())
					{
						document.getElementById(&quot;annee_suivante&quot;).setAttribute(&quot;href&quot;, &quot;javascript: alert(\&quot;Vous ne pouvez pas aller au-delà de la date actuelle\&quot;);&quot;);
						document.getElementById(&quot;mois_suivant&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + mois_suivant.getFullYear() + &quot;, &quot; + mois_suivant.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
					}
					else
					{
						document.getElementById(&quot;annee_suivante&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + annee_suivante.getFullYear() + &quot;, &quot; + annee_suivante.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
						document.getElementById(&quot;mois_suivant&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + mois_suivant.getFullYear() + &quot;, &quot; + mois_suivant.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
					}
				}
				else
				{
					document.getElementById(&quot;annee_suivante&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + annee_suivante.getFullYear() + &quot;, &quot; + annee_suivante.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
					document.getElementById(&quot;mois_suivant&quot;).setAttribute(&quot;href&quot;, &quot;javascript: get_mois(&quot; + mois_suivant.getFullYear() + &quot;, &quot; + mois_suivant.getMonth() + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;', '&quot; + bouton + &quot;'&quot; + &quot;);&quot;);
				}
			}
			
			function get_nom_mois(numero)
			{
				var nom_mois = &quot;&quot;;
				
				switch (numero)
				{
					case 0:
							nom_mois = &quot;Janvier&quot;;
							break;
					case 1:
							nom_mois = &quot;F&amp;eacute;vrier&quot;;
							break;
					case 2:
							nom_mois = &quot;Mars&quot;;
							break;
					case 3:
							nom_mois = &quot;Avril&quot;;
							break;
					case 4:
							nom_mois = &quot;Mai&quot;;
							break;
					case 5:
							nom_mois = &quot;Juin&quot;;
							break;
					case 6:
							nom_mois = &quot;Juillet&quot;;
							break;
					case 7:
							nom_mois = &quot;Ao&amp;ucirc;t&quot;;
							break;
					case 8:
							nom_mois = &quot;Septembre&quot;;
							break;
					case 9:
							nom_mois = &quot;Octobre&quot;;
							break;
					case 10:
							nom_mois = &quot;Novembre&quot;;
							break;
					case 11:
							nom_mois = &quot;D&amp;eacute;cembre&quot;;
							break;
				}
				
				return nom_mois;
			}
			
			function get_select_month(mois, annee, bloquer_a_date_actuelle, emplacement)
			{
				var today = new Date();
				
				var select = &quot;\&lt;select name=\&quot;mois\&quot; onchange=\&quot;javascript: get_mois(&quot; + annee + &quot;, this.value, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;'&quot; + &quot;);\&quot;\&gt;&quot;;
				
				if (annee == today.getFullYear() &amp;&amp; bloquer_a_date_actuelle == true)
				{
					for (var i = 0 ; i &lt;= today.getMonth() ; i++)
					{
						if (i != mois)
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot;\&gt;&quot; + get_nom_mois(i) + &quot;\&lt;/option\&gt;&quot;;
						}
						else
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot; selected=\&quot;selected\&quot;\&gt;&quot; + get_nom_mois(i) + &quot;\&lt;/option\&gt;&quot;;
						}
					}
				}
				else
				{
					for (var i = 0 ; i &lt;= 11 ; i++)
					{
						if (i != mois)
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot;\&gt;&quot; + get_nom_mois(i) + &quot;\&lt;/option\&gt;&quot;;
						}
						else
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot; selected=\&quot;selected\&quot;\&gt;&quot; + get_nom_mois(i) + &quot;\&lt;/option\&gt;&quot;;
						}
					}
				}
				
				select = select + &quot;\&lt;/select\&gt;&quot;;
				
				return select;
			}
			
			function get_select_year(annee, mois, bloquer_a_date_actuelle, emplacement)
			{
				var today = new Date();
				
				var select = &quot;\&lt;select name=\&quot;annee\&quot; onchange=\&quot;javascript: get_mois(this.value, &quot; + mois + &quot;, &quot; + bloquer_a_date_actuelle + &quot;, '&quot; + emplacement + &quot;'&quot; + &quot;);\&quot;\&gt;&quot;;
				
				if (bloquer_a_date_actuelle &amp;&amp; today.getFullYear() - annee &lt;= 10)
				{
					for (var i = today.getFullYear() ; i &gt; today.getFullYear() - 20 ; i-- )
					{
						if (i == annee)
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot; selected=\&quot;selected\&quot;\&gt;&quot; + i + &quot;\&lt;/option\&gt;&quot;;
						}
						else
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot;\&gt;&quot; + i + &quot;\&lt;/option\&gt;&quot;;
						}
					}
				}
				else
				{
					for (var i = annee + 9 ; i &gt; annee - 10 ; i-- )
					{
						if (i == annee)
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot; selected=\&quot;selected\&quot;\&gt;&quot; + i + &quot;\&lt;/option\&gt;&quot;;
						}
						else
						{
							select = select + &quot;\&lt;option value=\&quot;&quot; + i + &quot;\&quot;\&gt;&quot; + i + &quot;\&lt;/option\&gt;&quot;;
						}
					}
				}
				
				select = select + &quot;\&lt;/select\&gt;&quot;;
				
				return select;
			}
			
			function afficher_calendrier(calendrier, bouton_calendrier)
			{
				document.getElementById(calendrier).setAttribute(&quot;style&quot;, &quot;display: block;&quot;);
				document.getElementById(bouton_calendrier).setAttribute(&quot;onclick&quot;, &quot;javascript: cacher_calendrier('&quot; + calendrier + &quot;', '&quot; + bouton_calendrier + &quot;');&quot;);
			}
			
			function cacher_calendrier(calendrier, bouton_calendrier)
			{
				document.getElementById(calendrier).setAttribute(&quot;style&quot;, &quot;display: none;&quot;);
				document.getElementById(bouton_calendrier).setAttribute(&quot;onclick&quot;, &quot;javascript: afficher_calendrier('&quot; + calendrier + &quot;', '&quot; + bouton_calendrier + &quot;');&quot;);
			}
		&lt;/script&gt;
		&lt;style type=&quot;text/css&quot;&gt;
			body
			{
				background-color: black;
				color: white;
				font-family: sans-serif;
				font-weight: bold;
				font-size: 12px;
			}
			
			div.calendrier
			{
				border: 1px solid grey;
				width: 250px;
				display: none;
			}
			
			td.not_today_not_we, td.today_not_we, td.not_today_we, td.today_we
			{
				text-align: right;
				border: 1px solid transparent;
			}
			
			td.not_today_not_we:hover, td.today_not_we:hover, td.not_today_we:hover, td.today_we:hover
			{
				cursor: pointer;
				border: 1px solid white;
			}
			
			td.not_today_not_we, td.today_not_we
			{
				background-color: black;
			}
			
			td.not_today_we, td.today_we
			{
				color: grey;
			}
			
			td.today_we, td.today_not_we
			{
				color: red;
			}
			
			tr.titre
			{
				text-align: center;
				color: white;
				background-color: grey;
			}
			
			table
			{
				width: 100%;
			}
			
			tr.deplace
			{
				text-align: center;
			}
			
			tr.deplace span
			{
				border: 1px solid transparent;
				padding-left: 2px;
				padding-right: 2px;
				font-size: 10px;
				margin: 0px;
				color: white;
			}
			
			tr.deplace a.survol
			{
				border: 1px solid transparent;
				padding-left: 2px;
				padding-right: 2px;
				font-size: 10px;
				margin: 0px;
				color: white;
				text-decoration: none;
			}
			
			a#fermer_calendrier
			{
				color: red;
			}
			
			tr.deplace a.survol:hover
			{
				cursor: pointer;
				border: 1px solid white;
			}
			
			select, option
			{
				background-color: black;
				color: white;
				font-family: sans-serif;
				font-weight: bold;
				font-variant: small-caps;
				font-size: 10px;
				margin: 0px;
				border: 1px solid transparent;
			}
			
			option:hover
			{
				background-color: black;
				border: 1px solid white;
			}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body onload=&quot;javascript: get_mois(null, null, true, 'calendrier', 'bouton_calendrier');&quot;&gt;
		&lt;input type=&quot;button&quot; name=&quot;afficher_calendrier&quot; value=&quot;Calendrier&quot; onclick=&quot;javascript: afficher_calendrier('calendrier', 'bouton_calendrier');&quot; id=&quot;bouton_calendrier&quot;/&gt;
		&lt;div class=&quot;calendrier&quot; id=&quot;calendrier&quot;&gt;&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre> <a href="http://www.posteet.com/tags/calendrier">[calendrier]</a>  <a href="http://www.posteet.com/tags/Date">[Date]</a>  <a href="http://www.posteet.com/tags/getElementById">[getElementById]</a>  <a href="http://www.posteet.com/tags/innerHTML">[innerHTML]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Fri, 01 Feb 2008 20:17:23 +0000</pubDate>

            <category>calendrier</category>
            <category>Date</category>
            <category>getElementById</category>
            <category>innerHTML</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Backup quotidien de repertoires</title>
        <link>http://www.posteet.com/view/575</link>
        <description>
        <![CDATA[<pre>#!/bin/sh

# Ce script est a appeler dans la crontab :
# ~$ crontab -e
# 0 6 * * * /home/benoit/make_backups.sh &gt;&gt;/home/benoit/backups_automatises.log
# Dans l'exemple, ce script sera execute tous les jours a 6h00 du matin

# sauvegarde d'un repertoire
make_backup ()
{
	rep=$1
	
	# Si un fichier porte deja ce nom, on le renomme (juste au cas ou)
	if test -f &quot;${rep}_${date_du_jour}.tar.gz&quot;
	then
		mv &quot;${rep}_${date_du_jour}.tar.gz&quot; &quot;${rep}_${date_du_jour}_old.tar.gz&quot; &gt;&gt; &quot;$log&quot; 2&gt;&gt; &quot;$log&quot;
		echo &quot;Le fichier ${rep}_${date_du_jour}.tar.gz a ete renomme en ${rep}_${date_du_jour}_old.tar.gz&quot; &gt;&gt; &quot;$log&quot;
	fi
	
	echo &quot;SAUVEGARDE DE `echo $rep | tr [a-z] [A-Z]`...&quot;  &gt;&gt; &quot;$log&quot;

	# Sauvegarde du repertoire a la date du jour
	tar -cf &quot;${rep}_${date_du_jour}.tar&quot; &quot;${rep}&quot; &gt;&gt; &quot;$log&quot; 2&gt;&gt; &quot;$log&quot;
	gzip &quot;${rep}_${date_du_jour}.tar&quot;
	
	echo &quot;EFFECTUEE&quot;  &gt;&gt; &quot;$log&quot;
	
	# Suppression du fichier backup datant d'il y a trois jours
	if test -f &quot;${rep}_${avant_avant_hier}.tar.gz&quot; &amp;&amp; test -f &quot;${rep}_${avant_hier}.tar.gz&quot; &amp;&amp; test -f &quot;${rep}_${hier}.tar.gz&quot;
	then
		\rm -f &quot;${rep}_${avant_avant_hier}.tar.gz&quot; &gt;&gt; &quot;$log&quot; 2&gt;&gt; &quot;$log&quot;
		echo &quot;Le fichier ${rep}_${avant_avant_hier}.tar.gz a ete supprime&quot; &gt;&gt; &quot;$log&quot;
	fi
	
	echo &quot;&quot;  &gt;&gt; &quot;$log&quot;
}

repertoire_racine=&quot;/home/benoit&quot;
log=&quot;backups_automatises.log&quot;
date_du_jour=`date +'%y%m%d'`
hier=`date +'%y%m%d' -d 'yesterday'`
avant_hier=`date +'%y%m%d' -d '2 days ago'`
avant_avant_hier=`date +'%y%m%d' -d '3 days ago'`

cd &quot;$repertoire_racine&quot;

echo &quot;********************************************************************************&quot; &gt;&gt; &quot;$log&quot;
echo &quot;&quot;  &gt;&gt; &quot;$log&quot;
echo &quot;SAUVEGARDE DU `date +'%Y-%m-%d'` A `date +'%H:%M:%S'`&quot;  &gt;&gt; &quot;$log&quot;
echo &quot;&quot;  &gt;&gt; &quot;$log&quot;
echo &quot;&quot;  &gt;&gt; &quot;$log&quot;

make_backup &quot;repertoire1&quot;
make_backup &quot;repertoire2&quot;

exit 0</pre> <a href="http://www.posteet.com/tags/backup">[backup]</a>  <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/crontab">[crontab]</a>  <a href="http://www.posteet.com/tags/date">[date]</a>  <a href="http://www.posteet.com/tags/shell">[shell]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Tue, 11 Dec 2007 09:01:08 +0000</pubDate>

            <category>backup</category>
            <category>bash</category>
            <category>crontab</category>
            <category>date</category>
            <category>shell</category>
    
    </item>


</channel>
</rss>
