Skip to main content

Posts

Showing posts from February, 2013

Mihamina Rakotomandimby on Internet

Profiles Google+ (Google Plus) profile LinkedIn profile Viadeo profile Stack Overflow profile LaunchPad profile Delicio.us bookmarks: http://www.delicious.com/rakotomandimby Identi.ca flow http://identi.ca/rakotomandimby Twitter flow http://twitter.com/#!/rktmb Code repository Google Code SVN repository , for some example and demonstration pieces of code More... Perform a Google Search on "Mihamina Rakotomandimby" Perform a Yahoo search on "Mihamina Rakoromandimby"

Situation légale Internet Madagascar

Plusieurs FAI Comme nous le savons, il y a plusieurs fournisseur d'accès à Internet à Madagascar. Blueline (pour lequel j'ai travaillé dans le passé) Orange (aussi connu sous l'acronyme OMA pour "Orange MAdagascar") Telma (propriétaire de Moov et DTS) Life Tous n'ont pas l'autorisation de commercialiser de l'accès à internet au particulier. Voir les documents suivants: Aout 2010 , Communiqué OMERT Sept 2010 , Communiqué OMERT Sept 2010 , Article Midi Madagasikara Je vous invite à commenter ces documents via le formulaire ci dessous.

update LILO GRUB2

But Les serveurs OVH sont installés avec LILO par défaut, je souhaite installer GRUB2 à la place. Je suis sous Ubuntu Karmic. Prérequis Il faut au prealable installer GRUB1 apt-get install grub et le configurer: grub-install /dev/sda Recette Installer GRUB2, et les package ne s'appelle pas "GRUB2": apt-get install grub-pc Catte installation va mettre en place une étape de transition GRUB1 -> GRUB2. Modifier: nano -w /etc/default/grub Enlever l'étape de transition par GRUB1 upgrade-from-grub-legacy Vérifier que tout s'est bien passé nano -w /boot/grub/grub.cfg Supprimer LILO apt-get remove lilo Rebooter reboot

huawei e1552 orange ubuntu debian

Orange Madagascar This internet access provider had initially provided a USB Huawei E160 . Then, then switched to the USB Huawei E1552 device. The modem is composed by A modem. (Why not?) An USB mass storage, read-only, containing Windows drivers Funny Windows After I got the USB Huawei E1552 , I wanted to to try it out on a spare Laptop running Microsoft Windows 7 32bits. I failed, because the driver provided on the USB stick is XP/Vista only, and known to be weird on Microsoft Windows 7 32bits. On Linux If the usb-modeswitch package is not installed, when plugging the modem, only the USB mass storage part is detected: usb 1-2: new high speed USB device using ehci_hcd and address 3 Initializing USB Mass Storage driver... scsi6 : usb-storage 1-2:1.0 scsi7 : usb-storage 1-2:1.1 usbcore: registered new interface driver usb-storage USB Mass Storage support registered. After installing usb-modeswitch and without any setup, when plugging the modem, the the USB mass st

bash fichiers avec tiret

Problème J'ai plein ed fichiers avec un "-" dans le nom, et pas partout dnas lenom mais au debut. Un "ls *" s'y perd, considérant ces fichiers comme des "options" de ligne de commande. Dans les faits meme un "mv" et un "cp" s'y perdent aussi. Solution D'apres un message sur stackoverflow , il suffit de mettre un "--", qui indique la fin des options transmises.

ecrire un email

C'est quoi le problème? Il y a un problème global: Les gens qui utilisent les emails ne savent pas utiliser les emails. Un email c'est un message: du contenu. Ce contenu doit être lisible le plus rapidement possible. Ecrire en HTML Ecrire un message en HTML, c'est utiliser sont Outlook ou Thunderbird dans sa cofiguration par défaut. Cela permet de faire des messages avec de la mise en forme, des couleurs, insérer des images,... Mais: On ne sait pas comment le destinataire va lire le message, on ne sait donc pas si l'HTML est supporté et par principe on utilise le plus petit dénominateur commun. Un message HTML prend trois fois plus de place au moins qu'un message en "texte brut", soit trois fois plus de bande passante (multiplié par les centaines d'aliases qu'on a dans une entrepise) De nombreux utilisateurs gardent les messages sur le disque pour pouvoir effectuer des recherches, en augmentant la taille par 3 on augmente d'autant le t

Settting up network in KVM

When installing a KVM VM in Ubuntu, one of the question is: How to configure its network. There is basically two choices: A virtual bridge that will NAT the VMs connected to it. A physical bridge so that all VMs will be able to have a "public" IP address NATing virtual bridge (default, virbr0) This is the default bridge if you follow the Ubuntu Official tutorial . This bridge will act as a DHCP server + a gateway. VMs will be able to reach internet but their source IP address will be seen as the virbr0 IP. Non-NATing bridge Most of my time, I want to use VMs as public servers. Having them NATed as described above is quite uselss for that purpose. Libvirt allows to do that, assuming you have The steps: Create a bridge containing only the physical existing interface Each created VM will then join that bridge Creating a VM that way is described on a precedent blog post.

utiliser les vues de BIND

Resolution variable de "smtp.rktmb.org" Le but est de faire en sorte que Depuis 192.168.1.0/24, "smtp.rktmb.org" resolve vers 111.222.333.444 Depuis 192.168.2.0/24, "smtp.rktmb.org" resolve vers 555.666.777.888 Globalement il s'agit d'utiliser les "view" de BIND. Actuellement "smtp.rktmb.org" est une enregistrement de type A dans la zone "rktmb.org". Prérequis Il y a deja 2 serveurs BIND en production, que nous appellerons "NS1" et "NS2" Les vues ne seront opérationelles que sur "NS2", si le client fait directement sa requete sur "NS2" . Déléguer les DNS Dans NS1, /etc/bind/hosts/masters/rktmb.org-hosts: smtp IN NS ns1.rktmb.org. smtp IN NS ns2.rktmb.org. Penser à supprimer les enregistrements A! "smtp.rktmb.org" n'est plus un simple enregistrement, mais maintenant une zone. Créer la zone sur NS1 Dans /etc/bind/named.conf.local: zone "smtp.rktmb.

dovecot mysql nfs

Existing Debian Lenny Dovecot querying MySQL (virtual users) Remote NFS server storing Maildirs (owned by vmail, iud 500) Configuration Dovecot is able to fetch (through IMAP or POP) Maildirs message if it has: The user's HOME The user's UID The user's GID For Dovecot: The user's Maildir is the user's HOME appended with "/Maildir" Dovecot executes the message fetching as the user's UID Dovecot executes the message fetching as the user's GID My troubles My user_query returned something like: home uid gid /data/mailaka/gulfsat.mg/m/mihamina/ 500 500 I found those lines in my debug logs: maildir: access(/data/mailaka/gulfsat.mg/m/mihamina//Maildir, rwx): failed: No such file or directory maildir: couldn't find root dir mbox: root exists (/data/mailaka/gulfsat.mg/m/mihamina//mail) mbox: INBOX: access(/var/mail/mihamina@gulfsat.mg, rw) failed: No such file or directory mbox: INBOX: access(/var/spool/mail/miham

lvm and PV listing

Goal I would like to list the PVs involved in a VG. Neither "vgs" nor "vgdisplay" tells me. I need that information in order to install and clone an existing Debian using LVM and want to have the same LVM configuration. Recipe The "vgs" output: root@maila:~# vgs VG #PV #LV #SN Attr VSize VFree disk0 1 1 0 wz--n- 931,51G 520,00M disk1 1 2 0 wz--n- 447,13G 397,13G The "pvs" output: root@maila:~# pvs PV VG Fmt Attr PSize PFree /dev/md1 disk1 lvm2 a- 447,13G 397,13G /dev/md2 disk0 lvm2 a- 931,51G 520,00M How to read it: There is only one PV per VG "md1" belongs to the VG disk1 "md2" belongs to the VG disk0 If the output where: root@maila:~# pvs PV VG /dev/md1 disk1 /dev/md2 disk0 /dev/md3 disk1 /dev/md4 disk0 /dev/md5 disk1 /dev/md6 disk0 /dev/md7 disk1 /dev/md8 disk0

Focus sur jQuery

Javascript vers jQuery Chez Ideo Neov, un objectif est de séparer: Le contenu La presentation La logique d'interaction Les CSS ont été adoptées pour séparer le contenu de la présentation. Ideo Neov souhaite insister pour techniquement aussi séparer la logique d'interaction. Ainsi, tout autant que nous n'utilisons plus "align=center", nous n'utiliserons plus "onclick=" et les autres attributs de cette famille: Nous déléguons à jQuery de se débrouiller pour cela. J'ai demandé à la promotion 1 du "Sas de formation" de se documenter sur jQuery, qu'en est-il ressorti?

utilisation de virsh et virt-install

Mon utilisation Cette entrée me sert plutot de bloc-note pour ne pas perdre de vue mes commandes usuelles de manipulation de machines virtuelles Voir si une machine virtuelle existe sudo virsh --connect qemu:///system list --all Définir une machine virtuelle à partir d'un xml sudo virsh --connect qemu:///system define le-fichier.xml Dump XML de la conf d'une machine virtuelle sudo virsh --connect qemu:///system dumpxml centos6-01 Démarrer une machine virtuelle sudo virsh --connect qemu:///system start centos6-01 Installer une machine virtuelle sudo virt-install --connect qemu:///system --name fedora-16-64-01 \ --ram 1024 --keymap=fr \ --cdrom=/media/500G/ISO/Fedora-16/Fedora-16-x86_64-Live-LXDE.iso --os-type=linux \ --os-variant=fedora16 --network=network:default --vnc --accelerate \ --force --disk path=/mnt/big/mihamina/Virtual/fedora-16-64-01,size=10G Se connecter à une machine virtuelle en VNC sudo virt-viewer --connect qemu://

interfaces pon poff wvdial

/etc/networking/interfaces As a full Debian/Ubuntu nerd, I use "/etc/networking/interfaces" to setup my network. But as far as I have Two different modems to connect with, I wondered how to make them work with "/etc/networking/interfaces". I found. ppp To connect with "ppp", I type "pon bluenet". To use "/etc/networking/interfaces" with it: iface ppp0 inet ppp provider bluenet wvdial To connect with wvdial, I type "wvdial orange". To use "/etc/networking/interfaces" with it: iface ppp0 inet wvdial provider orange How to use it

On fusionne les branches et on observe

Fusion avec Mercurial Chaque binôme a travaillé sur sa branche, et il est temps de fusionner le travail. Chacun a fait ses classes PHP, selecteurs CSS, morceaux de code Javascript/jQuery,... dans sa propre branche. C'est l'organisation typique d'un projet chez Ideo Neov, qui nécessite qu'on fusionne à un moment donné. Racontez comment ça se passe de fusionner: quels problèmes inattendus? quelles solutions inattendues? quelles réactions face aux évènements? ...

Apres le HTML, Javascript

Apres le HTML, Javascript Maintenant que nous avons pris le temps d'aborder HTML via un exercice d'intégration HTML, nous pouvons passer à l'étape suivante qui est Javascript Javascript de base Avant de manipuler les documents avec les frameworks comme jQuery, Mootools, Prototype,... nous allons dans un premier temps aborder "les bases". De nos jours, peu de gens utilisent Javascript de cette façon mais il est primordial de savoir comment les choses se passent au plus bas niveau avant de manipuler des outils qui font abstraction de ces bases-là. Qu'avez-vous appris? En utilisant les commentaires à ce billet, Racontez votre parcours et les choses que vous avez découvert dans le sas de formation que vous êtes actuellement en train de suivre.

Etude Drupal 7 dans le sas 01

Drupal J'ai donné à étudier le livre Pro Drupal 7 dans le but d'étudier le développement PHP avec Drupal. Le but de la manoeuvre est d'introduire au développement de modules le CMS en question. Ceci pour à terme créer des modules et contribuer à des modules existants. Déroulement Dans la logique de la formation dans le sas Ideo Neov, le cheminement devrait être: Comprendre ce qu'est un CMS de manière générique et ce que cela permet de faire Installer Drupal et maîtriser l'interface d'administration Installer les thèmes "populaires" ( Zen , Fusion , Sky ) et essayer des modificatios mineures (changement de couleurs, changement des images à la même dimension) Installer les modules utiles au développement ( Administration Menu , Devel , Masquerade , SEO Checklist ) Maîtriser la création de nouveau type de contenu sans besoin de programmation Installer quelques modules "populaires" ( CCK , Views , Advanced Help , Custom Breadcrumbs

zte g x760 blueline debian ubuntu

ZTE G X760 The ZTE G X760 is also known as "Orange VEGAS". I use one branded "T-Mobile", byt unlocked. I use it to phone and as a backup modem. It's a GPRS (2G) phone. When plugged to a computer through the USB, the telephone promts if it will be connected as "Mass storage" or "COM Port". Depending on the usage, You've got to choose. Blueline Blueline is one of the best Internet Service provider in Madagascar. With their mobile telephone product, they have a Data service. I use it to access Internet, with my telephone (see above), on my Ubuntu and Debian laptop. The APN is "bluenet". No password required. Connecting to Internet After pluggin the phone and choosing "COM Port", the phone is then detected as a modem cdc_acm 3-2:1.1: ttyACM0: USB ACM device usbcore: registered new interface driver cdc_acm cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters

Sas 01 et theme Drupal

Voici venu le temps d'apprendre à faire un thème Drupal. Pour la beauté de l'exercice, nous allons commencer par faire le thème pour Drupal 6 puis le migrer vers Drupal 7. Ceci, tout en conservant nos exigences sur le respect des normes, de la sémantique, l'usage de Mercurial,... Racontez vos avancées sur le sujet, les problèmes rencontrés, les solutions trouvées.

ocsigen img tag

Goal I want an IMG tag Recipe open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Xhtml let main_handler sp () () = Lwt.return (html (head (title (pcdata "ttt")) [] ) (body [ (div [img ~alt:"Ocsigen" ~src:(make_uri ~service:(static_dir sp) ~sp:sp ["logo.gif"]) ()]) ; (div [pcdata "blabla"])]) let main_service = Eliom_predefmod.Xhtml.register_new_service ~path: [""] ~get_params: Eliom_parameters.unit main_handler Of course, we need static directory. to be setup in the "ocsigen.conf" file

natty epiphany3 gtk2 gtk2

Natty GTK2 and GTK3 My Ubuntu Natty default shipped GTK2 and Epiphany (browser) 2.x. I wanted to switch to Epiphany 3.x but it comes along with several GTK3 stuff. This is how I did it Enable Oneiric reposotiry Although it's only alpha at this moment, I enabled them in my "sources.list" I did not enable any pinning. Dont forget to apt-get update . Install wanted softwares and dependences After installing Epiphany, Evince and Evolution (yes...), It worked well but the aspect of GTK3 windows was different because of my current GTK2 theme was not ported to GTK3 yet. As far as I searched, Radiance and Ambiance were ported so I switched to them on my XFCE Theme manager and all went well. Radiance and Ambiance are part of the light-themes package (on Ubuntu). GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' does not contain a key named 'last-folder-uri' I encoutered that error: Epiphany: When I open the preference menu (the download l

creating a bootable USB centOS from a Fedora

ISO to USB tool I started from a minimal ISO taken from the centOS website (or mirror). Then I used the livecd-iso-to-disk tool from the livecd-tools package this way: sudo livecd-iso-to-disk /media/500G/ISO/Fedora-16/Fedora-16-i686-Live-LXDE.iso /dev/sdb1 Did not work out of the box I mainly had 2 problems, but I think only 1 is related to the ISO building. The other one is more about something I did not investigate further. First problem The USB booted and wet through the Anaconda installer but: When the installer looked for the existing disks: "The installation source given by device [''] could not be found. Please check your parameters and try again". I checked the USB filesytem created with the livecd-iso-to-disk, and in the syslinux.cfg file, I only have: append initrd=initrd.img stage2=hd:UUID=5E46-DFC2:/images/install.img repo=hd::/ According to this forum post , I modified my append line to be: append initrd=initrd.img stage2=hd:UUID=5E46-DFC

ocsigen upload two files with dynamic name

The goal I want to upload two files, and put the IP address of the uploader in the filename The solution open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Xhtml let upload = Eliom_services.new_service ~path:[""] ~get_params:unit ();; let upload2 = register_new_post_service ~fallback:upload ~post_params:((file "file_horizontal")**(file "file_vertical")) (fun sp () (f_h,f_v) -> let to_display = let name_h = ("/tmp/t_f_h-"^(Unix.string_of_inet_addr (Eliom_sessions.get_remote_inet_addr sp))) and name_v = ("/tmp/t_f_v-"^(Unix.string_of_inet_addr (Eliom_sessions.get_remote_inet_addr sp))) in (try Unix.unlink name_h with _ -> ()); Unix.link (Eliom_sessions.get_tmp_filename f_h) name_h; (try Unix.unlink name_v with _ -> ()); Unix.link (Eliom_sessions.get_tmp_filename f_v) name_v; (name_h^&qu

edit email user

Editing an "email user" After adding a user , I sometimes need to edit it. Using a shell script This is how I edit it #!/bin/bash EMAIL=$1 PASS=$2 EXIM_VIRT_DIR="/etc/exim4/virtual/" DOMAINE=$(echo ${EMAIL} | awk -F"@" '{print $2}') LOCALPART=$(echo ${EMAIL} | awk -F"@" '{print $1}') U=$(echo ${EMAIL} | sed 's/\./-/g' | sed 's/@/-/g') CRYPT1_PASS=$(mkpasswd ${PASS}) echo ${EMAIL} echo ${PASS} echo ${DOMAINE} echo ${LOCALPART} echo ${CRYPT1_PASS} echo ${U} usermod --password ${CRYPT1_PASS} ${U}

sas 01 et approfondissement des workflow

Les élèves ont le droit d'utiliser Drupal 6 ou Drupal 7 selon leur convenence. Qu'est-ce qu'il a fallu créer dans votre installation de Drupal pour arriver à quelquechose qui se rapproche de ce Workflow ? Quels users? Quels roles? Quel états? Quoi d'autre? Décrivez votre expérience: Y arrivez-vous? (presque, pas du tout,) Pourquoi? Grace à quoi? Comment avez-vous géré la contrainte d'interdire le passage direct de "public" à "private" Sur quel problème avez-vous "perdu" du temps? Répondez à ces questions dans vos commentaires.

EzPublish EzTeamroom No XML data available

Installing EzTeamroom When launching the final installation command of Ezpublish: www-data@dev-01:/var/www/PDCH.ezpublish440$ php extension/ezxmlinstaller/bin/php/xmlinstaller.php --template=teamroom/installezteamroom --siteaccess=plain_site --allow-root-user Using siteaccess "plain_site" for installation from XML Checking requirements... Trying to install data from XML ... No XML data available. How I solved When you face this "No XML" Error, first go to the Administrator Web interface: Setup Extensions Check: ezxmlinstaller, ezjscore, ezie, ezevent, ezlightbox, ezteamroom Update Then re-launch the command.

tutorial date ocaml

OCaml using Calendar Some acknowledgement From the toplevel # #use "topfind";; # #require "calendar";; /usr/lib/ocaml/unix.cma: loaded /usr/lib/ocaml/str.cma: loaded /usr/lib/ocaml/calendar: added to search path /usr/lib/ocaml/calendar/calendarLib.cma: loaded Note that the library is "Calendar", but "calendarLib.cma" is loaded. So, to set a Date from a String: # let d = CalendarLib.Printer.Precise_Fcalendar.from_fstring "%F %T" "2011-08-16 16:00:01";; val d : CalendarLib.Printer.Precise_Fcalendar.t = Or to print a Date to a String: # CalendarLib.Printer.Precise_Fcalendar.to_string d;; - : string = "2011-08-16 16:00:01" # CalendarLib.Printer.Precise_Fcalendar.sprint "%Y-%m-%d %H" d;; - : string = "2011-08-16 16" # CalendarLib.Printer.Precise_Fcalendar.sprint "%Y-%m-%d %H:%M:%S" d;; - : string = "2011-08-16 16:00:01"

create an LVM volume

Goal On a machine with LVM installed I would like to create some more /tmp space Recipe Ask for information # vgs VG #PV #LV #SN Attr VSize VFree scsi0 1 3 0 wz--n- 461,10G 195,10G scsi1 1 1 0 wz--n- 931,51G 23,85G # lvdisplay ... Create the LVM according to the space left on the Volume group: #lvcreate -L 200G scsi0 -n tmp Logical volume "tmp" created # lvdisplay ... --- Logical volume --- LV Name /dev/scsi0/tmp VG Name scsi0 LV UUID ea10iW-wAnS-lUSA-clHW-X2M5-ibN3-uAUrws LV Write Access read/write LV Status available # open 0 LV Size 200,00 GB Current LE 51200 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:3 ... Format it # mkfs.ext3 /dev/scsi0/tmp Mount and use it # rm -rf /tmp/* ; # mount -t ext3

numbering the outlines

Headings then outline I write a text I set the headings I insert a "Table of contents" (TOC) Neither the TOC nor the paragraph headings dont outline the chapter number To add the outline numbering Format Bullets & Numbering Outline Choose the style of numbering OK

sas 03 et thème Drupal

Après un moment d'intégration HTML statique, les stagiaires du sas 03 se sont vu confier la tâche d'intégrér un PSD sur un Drupal 7. Quelles sont les difficultés rencontrées? Quelles sont les découvertes suite à cet exercice?

Sas 02 et HTML

Maquette De manière générale, une application Web nait techniquement en tant que maquette graphique. On reçoit un fichier "psd" (qui peut s'ouvrir avec Gimp) et la tâche consiste à "transformer" ça en HTML. Quel rapport avec le développement? Un développeur backend doit comprendre les balises qu'il va générer, savoir quel est l'impact visuel et esthétique d'un élément qu'il va introduire dans un template statique validé. Les interfaces web se veulent sensibles aux évènements de nos jours. Pour gérer ça, nous utilisons Javascript et jQuery. Personnaliser les modules jQuery existants et éventuellement en développer, telles sont les tâches d'un intégrateur. Pour cela il faut maîtrser un arbre HTML. Le mobile Avoir une déclinaison pour un terminal qui tient dans une main, ou une tablette est maintenant un must pour une structure de développement moderne. C'est aussi dans les cordes d'un intégrateur de chez nous. Sas de formation e

Encore une erreur

Après cet édito de Sobika , je me pose la question de la compétence de Ravalomanana. Il avait le pouvoir, pourquoi n'a-t-il pas simplement arrangé le dossier pour qu'on ne puisse pas l'embeter plus tard? En étant un président de la république, c'est extremement facile de demander à la chambre de commerce de valider ce dossier comme étant réglé définitivement! Mais non, il n'a pas fait les choses dans ce sens...

xubuntu early lightdm bug

My system I have a Natty system where I wanted to early install GTK3 ported packages such as Evince, LightDM,... To do so, I just temporarily enabled Oneiric repositories (without no more pinning configuration, I love my hairs) then installed Ecountered problems I got the lightDM login screen without problem. For some obscur reasons, I had to disable splashscreen at boot. That doesn't disturb me, I love seeing lines on my screen, it's an indication that things are going on. But, after entering my credentials and choosing "Xubuntu Session" or "Xfce Session", I just got a framebuffer screen with a mouse pointer. Not more. I can escape from that state with "Ctrl-Backspace". I joined the bug huntings: Cursor issues in lightdm How to Get LightDM To Work Solution for me Completely disappointed, I randomly tried to enter a "guest" session on the computer and the Xfce environment launched. I tried then to move out all my $HOME files

more on precise date on ocaml

Dealing with "Precise" Dates I already posted an article on (begining) playing with Dates on OCaml . Preparing the Toplevel As usual, we have to load and use several modules: #use "topfind";; #require "calendar";; Creating a Second To create a second, the top reachable precision: CalendarLib.Time.Second.from_int 5;; Creating a Precise Date To create a precise date, let's use the "make" function: CalendarLib.Fcalendar.Precise.make 2011 08 12 05 32 (float_of_int (CalendarLib.Time.Second.from_int 5));; CalendarLib.Fcalendar.Precise.make 2011 08 12 05 32 5.;; Create a Precise Period When wanting to add 2 days to a date, we must use "The Date + 2 days Period". To create that "Period": CalendarLib.Fcalendar.Precise.Period.make 2011 08 12 05 32 (float_of_int (CalendarLib.Time.Second.from_int 5));; CalendarLib.Fcalendar.Precise.Period.make 2011 08 12 05 32 5.;; Make an operation (add) Let's create a Date, an

sas 02 démarrage

Sas 02 Nous avons démarré la seconde session du sas de formation. Le but sera le même: former les jeunes ingénieurs malgaches aux techniques avancées de développement web. Impressions Sur ces quelques premières heures, qu'avez-vous appris, de quoi avez-vous pris conscience? Comment voyez-vous les 2 mois qui suivent?

Entreprise, formation, langues, développement personnel, madagascar

Formation Au fil du temps, l'dentification des connaissances à transmettre s'est précisé. Je peux donc affiner les axes de formation que je conduits: Langues et Développement personnel Perfectionnement communication orale et écrite (en Français, Anglais et Malgache) Sensibilisation à la veille technologique Animation d'atelier de discussion sur les actualités relative à notre métier Informatique Formations technique initiale sur HTTP, HTML, Javascript, SQL, PHP et Java. Introduction aux frameworks spécialités de la maison tels que Jelix et Symfony Introduction aux CMS spacialités de la maison comme Drupal et WordPress Recrutement Si il est question de formation initiale, c'est parceque nous recrutons. Le profil qui nous interesse principalement est celui "ingénieur", mais puisque notre structure bénéficie d'un département de formation, nous pouvons nous permettre d'étudier sérieusement les origines académiques atypique pour le métie

sas 02 et drupal

Drupal est catalogué comme CMS. Quels sont les avantages et inconvénients d'un CMS pour un développeur PHP? Quels sont plus particulièrement les avantages et inconvénients de Drupal? Comment développe-t-on avec Drupal? Que doit-on garder à l'esprit quand on est un Développeur ou Themeur Drupal? Quelles sont les différences majeures entre Drupal 6 et Drupal 7? Qu'avez-vous appris sur Drupal?

A pgrep like with ocaml

pgrep "pgrep" is a tool to "grep" processes. If you want to know if a process containing a pattern exists, you use "pgrep pattern". informations The informations about a process are stored in /proc/$PID/cmdline ocaml To make a pgrep-like with Ocaml, we'll have to loop on all /pro/$PID and check if /proc/$PID/cmdline has the pattern we look for. I made it with this (crappy) piece of code, in which you fill find how, in OCaml, to: Open a File Write recursive functions Replace a string with another Deal with command line arguments open Unix ;; open List ;; open Str ;; open Sys ;; open Printf ;; open String ;; open Array ;; (* In /proc//cmdline, the field separator is '\000' *) let rec cmd_to_string accumulator cmd_channel = try let red = input_char cmd_channel in match red with | '\000' -> cmd_to_string (accumulator^(" ")) cmd_channel; | _ -> cmd_to_string (accumulator^(String.make 1 red))

Get email date of yesterday

Context I receive a daily bunch of messages from apticron telloing me the servers I need to upgrade. I want to get the list of hostnames needing updates from the las two days. Recipe Get into the Maildir folder Get to day and yesterday date Grep the Messages for it cd /home/mihamina/Mail/ export TODAY=$(date +%Y%m%d) export TODAY_STRING=$(date +"%a, %d %b %Y") export YESTERDAY=$(($(date +%Y%m%d)-1)) export YESTERDAY_STRING=$(date +"%a, %d %b %Y" --date=$YESTERDAY) (for MESS in $(grep -E "^Date: (${TODAY_STRING}|${YESTERDAY_STRING})" * \ | awk 'BEGIN{FS=":"}{print $1}'); do grep -E "^Subject: " $MESS | awk 'BEGIN{FS=" on "}{print $2}'; done) | sort | uniq

Les informations sur Facebook et internet en general

C'est quoi ton email? ton téléphone? Sur Facebook, plusieurs fois, on m'a demandé via message privé mes coordonnées. Plusieurs fois, je réponds: "regarde mon profil", les informations que tu recherches sont publiques. Plusieurs fois on me traite de "méchant". Ce que je ne comprends pas, moi c'est que le temps que je réponde à la demande de coordonnées, la personne qui demande aurait pour trouver l'information bien avant! En moins de 30 secondes! Et evidemment, c'est moi le méchant et pas l'autre qui est est idiot. Pourquoi c'est comme ça? Pour moi, la raison est simple: 90% des membres de Facebook et autres réseaux sur internet mettent n'importe quoi comme coordonnées. En fait c'est un n'importe quoi généralisé: Orthographe d'illétré Renseignements bordéliques Faux noms Pourquoi s'incrire sur Facebook quan on fait ça? Les gens mettent sur internet leur amour pour le désordre. Par exemple, quand on upload un

Ocsigen form select

The goal How to make a Select input with Ocsigen The solution open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Xhtml open Mysql open Postgresql let coucou_handler _ selection () = Lwt.return (html (head (title (pcdata "Results")) []) (body [p [ pcdata ("You sent: " ^ selection)]])) let coucou_service = Eliom_predefmod.Xhtml.register_new_service ~path: ["coucou"] ~get_params: (Eliom_parameters.string "selection") coucou_handler let coucou_form enter_selection = [XHTML.M.fieldset [Eliom_predefmod.Xhtml.string_select ~name:enter_selection (Eliom_predefmod.Xhtml.Option ([], "one", Some (pcdata "um"), false)) [Eliom_predefmod.Xhtml.Option ([], "two", Some (pcdata "dois"), false); Eliom_predefmod.Xhtml.Option ([], "three", Some (pcdata "três"), true)];

sudo redirect to a file

When wanting to append some string to a file using sudo [mihamina@dell-f17 ~]$ pdsh  'echo "sshd:LOCAL,41.190.237.66,41.188.46.121" | sudo tee  /etc/hosts.allow' hosting: sshd:LOCAL,41.190.237.66,41.188.46.121 filer: sshd:LOCAL,41.190.237.66,41.188.46.121 recette53: sshd:LOCAL,41.190.237.66,41.188.46.121 prod53: sshd:LOCAL,41.190.237.66,41.188.46.121 recette52: sshd:LOCAL,41.190.237.66,41.188.46.121 prod52: sshd:LOCAL,41.190.237.66,41.188.46.121 And it gives: [mihamina@dell-f17 ~]$ pdsh  'sudo grep sshd /etc/hosts.allow' recette53: sshd:LOCAL,41.190.237.66,41.188.46.121 prod53: sshd:LOCAL,41.190.237.66,41.188.46.121 filer: sshd:LOCAL,41.190.237.66,41.188.46.121 hosting: sshd:LOCAL,41.190.237.66,41.188.46.121 recette52: sshd:LOCAL,41.190.237.66,41.188.46.121 prod52: sshd:LOCAL,41.190.237.66,41.188.46.121

git debian xinetd

Goal Install a git server on Debian. We will only install a simple GIT daemon, without authentification. If you need authentification you will have to use an external mechanism: Apache + LDAP/MySQL and access the repositories with the "http://" schema SSH + the system authentication tool and access the repositories with the "ssh://" schema The git daemon wont be standalone, we'll use xinetd. Xinetd configuration in /etc/xinetd.d/git-daemon : # default: on # description: The git server offers access to git repositories service git { disable = no type = UNLISTED port = 9418 socket_type = stream wait = no user = git server = /usr/bin/git-daemon server_args = --inetd --export-all --verbose --enable=receive-pack --reuseaddr --base-path=/home/git/ log_on_failure += USERID } /home/git From the git-daemon setting above,

Finalement, on recommence

Projet World Après un moment de reflexion, ce projet n'est pas adapté à nos besoins: Apprendre la POO Générer des tables MySQL Apprendre SQL via MySQL On l'oublie, et on reprend. L'Histoire nous a montré que c'est déjà arrivé (de créer puis recréer), nous faisons partie de l'Histoire... Environnement numérique de travail "ENT", c'est notre nouveau projet. Nous nous sommes engagé à le finir en 15 jours. dans l'ENT il y a des acteurs du contenu de la gestion de ce contenu par ces acteurs A vous de décrire votre progression ainsi que celle du projet.

apt-pinning with origin...

apt-pinning with origin criteria When wanting to set preferences over the origin repository, this is an example from 2 sources: EeeUsers Argon Package: * Pin: origin www.debian-multimedia.org Pin-Priority: 600 Package: * Pin: origin www.ibiblio.org Pin-Priority: 610 Package: * Pin: origin www.argon.org Pin-Priority: 620

libvirt virt-install use block device

Goal I want to use /dev/sda10 as File System of my guest. Recipe Just replace the qcow file path with the device and remove the size parameter: sudo virt-install --connect qemu:///system -n xpsp2 -r 512 -f /dev/sda10 -c windowsxpsp2.iso --vnc --noautoconsole --os-type windows --os-variant winxp

ssh on wan port after install

Context I installed an openWRT system, I want to connect to SSH on it. After a fresh install only telnet is available. One could always use telnet through the wan interface, but it's not a good choice Dropbear Dropbear is the lightweight SSH server for the situation. It's installed by default, we just have to configure it Allow TCP port 22 from wan (/etc/config/firewall) The default behaviour is to REJECT any INPUT from wan: config zone option name  wan option input REJECT  option output ACCEPT  option forward REJECT  option masq 1  option mtu_fix 1 That is the POLICY (default behaviour). We are going to add a specific "rule" to allow TCP/22 config rule  option src wan  option proto tcp  option dest_port 22  option target ACCEPT  option family ipv4 Don't forget to setup a password for root, and we're done!

gitweb debian apache

Goal Install gitweb on a Debian system Packages Needed packages are git , gitweb and git-core . We are going to put the repositories in /home/git/ Apache Setup The Apache virtual host configuration needed: (VirtualHost *:80) ServerAdmin mihamina@rktmb.org ServerName git.rktmb.org DocumentRoot /usr/share/gitweb ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ (Directory /usr/share/gitweb) Options Indexes FollowSymlinks ExecCGI DirectoryIndex /cgi-bin/gitweb.cgi AllowOverride All (/Directory) ErrorLog /var/log/apache2/error-git-rktmb-org.log LogLevel warn CustomLog /var/log/apache2/access-git-rktmb-org.log combined (/VirtualHost) GitWeb setup Just change the line: $projectroot = "/home/git"; The other lines are all OK. Testing Restart apache. Now go to the ServerName you put in the Apache configuration.

git undo commit

Goal I accidentally added commited. How can i undo? Recipe To Leaves working tree as it was before: git reset --soft HEAD^ To get 2 commits back git reset --soft HEAD^^ and so on... Then git commit -a -m -c ORIG_HEAD Other option If wanting to do a hard reset, just replace "soft" by "hard".

Software RAID

Already existing documentation There is a lot documentation on Internet teachnig how to make software RAID arrays. What I forgot The only thing I did not read from them is how to save the created array for the next reboot. It's just about: scanning the array with "sudo mdadm --detail --scan" appending the relevant result line to mdam.conf

ocaml sqlite3 date

Use case I have a SQLite3 database, with Date, Integers and Float fields. I use it to make a poor-man accountig of my ppp0 interface traffic. Data I want to play with are in the format: $ sqlite3 accouting-copy "SELECT * FROM ifconfig" 1|2011-08-12 09:37:47|0.0 |0.0 2|2011-08-12 09:43:01|18629153.0|8124895.0 3|2011-08-12 09:43:03|18636044.0|8125679.0 4|2011-08-12 09:44:32|18694283.0|8159197.0 5|2011-08-12 09:50:01|19203494.0|8270963.0 6|2011-08-12 09:55:01|19265098.0|8311962.0 Where: Field #1: integer, incremental Field #2: date, SQLite "DATETIME('NOW')" Field #3 and #4: Float, "RX" and "TX" counters parsed from "ifconfig ppp0". Sometimes, these counters reset: If the modem hangs and I must perform a "ifdown ppp0; ifup ppp0". That is why I need computation. I want to account the traffic: Between to Dates: To know how much I had for a given month From a given Date to Now(): To approximately know my rem

email address to system user

Email address to user My goal is to build a bash script to which I give "mihamina@rktmb.org" and "password" as argument, and then it creates a system user named "mihamina-rktmb-org". The discribed method requires you to install the package "whois", containing "mkpasswd". Dont ask me why. At the same time, the script will insert an alias entry into an alias flat file. For "mihamina@rktmb.org", it will insert mihamina: mihamina-rktmb-org in "/etc/exim4/virtual/rktmb.org". The BASH script #!/bin/bash EMAIL=$1 PASS=$2 EXIM_VIRT_DIR="/etc/exim4/virtual/" DOMAINE=$(echo ${EMAIL} | awk -F"@" '{print $2}') LOCALPART=$(echo ${EMAIL} | awk -F"@" '{print $1}') U=$(echo ${EMAIL} | sed 's/\./-/g' | sed 's/@/-/g') CRYPT1_PASS=$(mkpasswd ${PASS}) echo ${EMAIL} echo ${PASS} echo ${DOMAINE} echo ${LOCALPART} echo ${CRYPT1_PASS} echo ${U} useradd \ --home-dir /home

Apple et l'education

Contexte Sur businessmobile.fr j'ai vu une reaction qui m'a irrité. Je la cite: J'approuve qu'Apple réglemente et contrôle l'ensemble des applications destinées à l'iphone et à l'iPOD Touch. S'il ne faisait pas l'on se retrouverait avec un ensemble de programmes merdiques et/ou pornographiques, voire des jeux débiles comme on en trouve en quantité sur différentes consoles de jeux. Pour ma part je suis d'accord,compte tenu que l'on trouve encore beaucoup d'adultes incapables de contrôler les achats de leur progéniture. Ma reaction Si les gens ne sont pas capables d'éduquer correctement leurs enfants, alors c'est à ces parents qu'il faut s'en prendre. Pourquoi acheter un iPhone à des enfants qui ne sont pas capables de reflechir?

Output a simple Image

Use case I want to output only an Image with Ocsigen, with the "image" content-type send by the server. I have the path of the image I want to output. Realisation open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Xhtml open Eliom_predefmod.Files let photo_service = Eliom_services.new_service ~path:["photo"] ~get_params:Eliom_parameters.unit () let photo_handler = Eliom_predefmod.Any.register photo_service (fun sp () () -> Eliom_predefmod.Files.send ~sp:sp "rakotomandimby-logo.png") And that's all.

Just serve an image

Use Case I have one image URL, I want to serve a different image by IP client Recipe open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Any open Eliom_predefmod.Files open Eliom_predefmod.Xhtml let logo = Eliom_services.new_service ["logo"] Eliom_parameters.unit ();; let logo_handler = Eliom_predefmod.Any.register logo (fun sp () () -> Eliom_predefmod.Files.send ~sp:sp "/home/mihamina/public_html/GCI/rakotomandimby-logo.png");; I just have to build a function that returns a different PATH if I want to change the served image

cherche stagiaire

Là, tout de suite et pour une période de trois mois, je recherche un stagiaire à superviser pour mettre en place la consolidation de notre système de base de données. Le candidat viendra avec sa machine que nous allons reinstaller complètement, et le stage se déroule à Antananarivo. Voir la page Contact pour postuler.

ocsigen class and id

Goal Set "class" and "id" attributes on elements Recipe open Lwt open XHTML.M open Eliom_services open Eliom_parameters open Eliom_sessions open Eliom_predefmod.Xhtml let main_handler sp () () = Lwt.return (html (head (title (pcdata "ttt") [] )) (body [ (div [pcdata "blabla"]) ; (div ~a:[(a_class ["ak"]); (a_id "ik")] [pcdata "blabla"])])) let main_service = Eliom_predefmod.Xhtml.register_new_service ~path: [""] ~get_params: Eliom_parameters.unit main_handler

grep et expressions regulieres

But Affichier un fichier de configuration sans les commentaires. Les commentaires sont délimités par un "#" en début de ligne. Des fois, les "#" sont doublés et sont précédés d'un ou plusieurs espaces ou tabulations (mais restent des commentaires valides) Avec "grep" Sous Linux, pour faire ça, on peut utiliser "grep". Pour atteindre mon but, j'utilise cette ligne: grep -v -E "#" /etc/dovecot/dovecot.conf | grep -v -E "^$" L'exemple portait sur un fichier de configuration de Dovecot. Avec "awk" En une ligne: awk '($0 !~ /#/) && ($0 !~ /^$/){print $0}' /etc/dovecot/dovecot-with-comments.conf

nostalgie

Honteux copié-collé de http://manag.r.free.fr Je plaide coupable d'avoir subjectivement uniquement cité ce qui me convient . Définition On attribue au «petit chef» tous les défauts du monde de l'entreprise: •  tatillon : il demande des comptes en permanence et veut tout vérifier •  pointilleux : il contrôle les heures d'arrivée, de départ, de pause. •  autoritaire : il impose sans expliquer et n'accepte pas la discussion •  omniprésent : il est partout à la fois, surtout là où on ne l'attend pas •  perfide : il n'hésite pas à monter les gens les uns contre les autres •  résistant au changement : il refuse toute évolution de l'organisation •  violent : il n'hésite pas à insulter ses subordonnés •  injuste : il a ses « têtes de turc » et ses « fayots » •  mesquin : il reproche une minute de retard à l'employé modèle qui n'est jamais absent •  insensible : il refuse un congé pour un enfant malade •  incapable d'écouter : il est dan

windows virus antivirus et economie

Avis de Nicolas George J'archive ici l'avis de Nicolas George sur cette question , au cas ou Google le rendrait indisponible > Jerome Lambert a écrit : > Je ne crois pas. > Que ferait p.ex. un employé de helpdesk? > Si on n'a plus  besoin de ses services, > il est à la porte de sa boite... > Même chose pour moi: le jours où l'informatique > sera à portée de tous, je ne pourrai > plus vivre des mes cours d'initiation à l'informatique. Etc, etc,. C'est un raisonnement qu'on voit souvent, mais d'un point de vue économique, il est tout à fait faux. Détruire exprès un bien (ou le construire défectueux au départ, ce qui revient au même) pour donner du travail au dépanneur va effectivement améliorer le niveau de vie du dépanneur lui-même,mais diminuer le niveau de vie d'autres  personnes. À l'échelle globale, ce qui compte, c'est la quantité totale de richesses créées, et le temps total passé à les crée

Cherche développeur Drupal pointu

Passionné de Drupal et de formation Nous cherchons quelqu'un qui maîtrise Drupal serait intéressé par le challenge de transmettre ses connaissances à une jeune équipe, à Madagascar Le but n'est pas forcément de faire carrière chez nous (bien que cela soit tout à fait envisageable), mais de passer avec l'équipe le temps qu'il faut pour qu'elle maîtrise Drupal sous tous ses espects. Le sujet du développement collaboratif autour d'un SCM (Hg ou Git) appliqué à Drupal serait aussi un sujet de formation ou nous avons une demande de transmission de connaissance et d'expérience. Jeune équipe Nous recrutons constamment (au niveau "fraîchement diplômé") et par définition les nouveaux ont besoin d'être formés. Les origines académiques sont essentiellement des écoles d'ingénieurs, mais il peut se trouver dans les recrues des profils atypiques comme des mathématiciens ou des autodidactes reconvertis. Il s'agit de trouver un tuteur expert

Mitia

La naissance Mitia J0 A une semaine Mitia S+1 A 10 jours Mitia J+10 (10 jours) A 15 jours (2 semaines) Mitia à S+2 Les videos

sas 02 et Jelix

On dit beaucoup de bien de Jelix. Son apprentissage est facilité pour nous particulièrement par le fait qu'il existe une documentation francophone complète. Qu'est-ce qu'un framework? Que peut-on dire (de plus) sur Jelix? Comment maîtriser techniquement ce framework? Quels sont les documents récents qui ont été trouvé pour introduire à l'utilisation de Jelix? Qu'avez-vous appris sur Jelix?

installing ezpublish 4.3 on debian lenny

Goal These are the steps I followed to install ezpublish 4.3 on Debian Lenny. Lenny is shipped with PHP 5.2.6, while ezpublish 4.4 requires 5.2.14+ apt-get install things apt-get install php5 php5-common php-pear php5-cli \ php5-gd php5-curl libapache2-mod-php5 \ php5-mcrypt imagemagick php5-mysql \ apache2-mpm-prefork libapache2-mod-php5 mysql-server Use PEAR to go on pear channel-discover components.ez.no pear install -a ezc/eZComponents This will install many thing in /usr/share/php/ezc/ Database Just have to create a database and when installing ezpublish through the web installer, give the credentials.

mysql case when then end

Use case I use a Dovecot IMAP & POP server, against a MySQL user database. In database, the users are stored this way: id pwd mihamina@gulfsat.mg $1$HSBxVt/clgdj0L5Fgzm61 mihamina@freedsl.mg $1$7TCTJJMG9cUvAlWuAbvE. mihamina@rktmb.org $1$H23xVt.bbgdj0L5Fgzm61 On my server I have mutiple IP adresses: A legacy IP (1.2.3.4) where "@rktmb.org" users sometimes log in only with the localpart, sometimes with the full email address A legacy IP (5.6.7.8) where "@freedsl.mg" users sometimes log in only with the localpart, sometimes with the full email address A last IP (7.8.9.0) where users log in with the full email address In usual condition, on a mail system, all users either all login with the full email address or all with the localpart. But on my alien system, they mix their habits, for legacy reasons. Therefore: The "mihamina@rktmb.org" user always logs in on the 1.2.3.4 IP but sometimes with "mihamina", sometimes wi

fedora gtk3 gtk2 theme

Context Running LXDE/F16, I have only GTK apps, but some are already ported to GTK3, some are still GTK3. My problem is I have different apparence for them (Left: GTK2, Right: GTK3) I'm looking for a GTK3 theme packaged in Fedora so that I could install it and have the same apparence. Being a former Ubuntu user they have Radiance/Ambiance themes that have the same apparence in GTK3 and GTK2 apps : Ubuntu, Fedora: the same I just sudo yum install light-gtk2-theme light-gtk3-theme and then in "Menu" -> "Preference" -> "Customize look and feel" use "Radiance". And I'm done!

ocaml random string and word generation

Goal I had to insert sample data in a database: Users username enabled Products name description price All should be random, and to "benchmark" the rendering (HTML/CSS), I must make the effort to have different text and number length. I decide to generate the sample data with OCaml. Random Int Generate a random integer between 1 and 1000 and return it as a string: let rand_price () = string_of_int ( 1 + ( Random .int 999 )) ;; Random Char Generate a random lowercase character (between 'a' and 'z'). 'a' ASCII code is 97 and the 26 following letters are the 26 following numbers: let rand_chr () = ( Char .chr ( 97 + ( Random .int 26 )));; Random vowel Generate a random character until it matches a vowel. Please add a comment if you would suggest another algorithm: let rec rand_voy () = let got = ( rand_chr ()) in match got with