Jon !

Blog personnel de Jon

blog moved

laissez un commentaire »

Rédigé par Jonathan

janvier 2, 2010 à 4:52

Publié dans 1

How to work in a Linux VM on a Mac (or Unix familly) ?

avec 3 commentaires

Last week, I spend most of my time on a openSUSE VM (I use parallels for information) in order to do some distro specific job on ooo-build (OpenOffice). It was not the best experience I had on Linux, keyboard layout sucks, especially on copy/paste (CMD-C CMD-V do not have relevant replacement solution on Linux) and also the copy/paste generally sucks as I am addicted to JumpCut (clipboard buffering). Then I re-thought about it and found better ways to handle work on a VM and avoid being home sick !! Let me share with you some tips :

iTerm (ssh -X) + Parallels (openSUSE VM) + X11 (OpenOffice from the VM)

iTerm (ssh -X) + Parallels (openSUSE VM) + X11 (OpenOffice from the VM)

  1. Use remotely !
    That’s maybe the main tip, as all others tips are detailed application of these tip. If some of you use to server admin, just treat you virtual machine as just another server.
  2. Do not use a term in the VM use ssh instead .
    That’s a start. Why use a terminal in you VM instead of the terminal you are used to ?
  3. Use Xforwarding as much as possible, Macs come with X11.
    ssh -X can save you sometime. For example, once connected to my VM, ssh -X user@myvm, I can run soffice with display on the Mac side.
  4. Create shorcuts for ssh connection in ~/.ssh/config
    Here is a extract from my ~/.ssh/config :


    Host *
      ControlMaster auto
      ControlPath ~/.ssh/master-%r@%h:%p
    Host suse
      HostName 10.211.55.7
      User someUser

    You can use it whenever ssh is involed : ssh suse  or  scp myfile suse:~/someDir
    You can also mix that with public key identification instead of the ControlMaster.

  5. Be lazy, create an alias in ~/bash_profile
    ~/bash_profile is source at the start of a term session, if the file is not present, create it.
    alias suse=’ssh suse -X’;export suse
  6. You need something more persistant than a ssh session ? Use screen
    screen (man screen), is a terminal emulation allowing you to create session and then detach from it, reatach later on.
    basic usage is :
    screen -S ascreenname
    key binding : ctrl-a ctrl-d   # (detach)
    screen -r -d ascreename    # (retach)

    that’s really usefull when you want to create a persistant session or plan to suspend you virtual machine.
  7. You need to access regularly your file from the Mac in your VM ? (vis et versa) Use sshFs
    More information about Ssh FileSytem  : http://en.wikipedia.org/wiki/SSHFS
  8. Use your favorite text editor.
    Mine is BBedit, then I can do things from command line like
    bbedit sftp://suse/
    I am pretty sure you favorite text editor can do those trick as well. Else check TextWrangler.
  9. [that's some amount of awesomeness, maybe update your blog? ;) ]

  10. Always use your favorite text editor.
    I was talking with Thorsten about strange but awesome behaviors of MacOS applications lately, I just learn that MacOS apps using the Cocoa Framework is « able to glean the current display context when run from the shell ».

    By using this capability, and a custom script, we can use BBedit directly from the virtual machine.

    1. Let add some lines to the Mac ~/.ssh/config:

      Host suseroot
        HostName 10.211.55.7
        User root

      That’s way more friendly if bbedit can edit file on the VM as root.
    2. Let add some lines to the VM ~/.ssh/config:

      Host suseroot
        HostName 10.211.55.2
        User myMacUser

      You should also add a config file in /root/.ssh/config if you want to use it from the root account on the VM.
    3. Last step, let create a executable file /usr/bin/bbedit (chmod a+x /usr/bin/bbedit) with this content:

      #!/bin/bash
      d=`dirname "$1"`
      if [[ ! ${d:0:1} == "/" ]]; then d=$PWD/$d; fi;

      ssh mac 'bbedit -w sftp://suseroot/'$d/`basename "$1"`

    4. Now you can use bbedit as an editor on the VM directly, example : bbedit someFile.
      You can even use bbedit (/usr/bin/bbedit) as the standard EDITOR for your virtual machine, thanks to the -w option, example :

      export EDITOR=/usr/bin/bbedit
      crontab -e

    That’s all (now I really think that’s all), If you see something else, feel free to post some comments. ;-)

Rédigé par Jonathan

juin 15, 2009 à 3:22

Publié dans en

How to install the SDK and compile the C++ examples on MacOS Intel

laissez un commentaire »

This post is a MacOS oriented Hello-world based of this wiki page http://wiki.services.openoffice.org/wiki/SDKInstallation. You can have it in French also http://wiki.services.openoffice.org/wiki/FR/Documentation/Installation_du_SDK.

DocumentLoader

Good news, to start extending OpenOffice using UNO , like create components or extensions, you don’t necessary need to go trough a full build of the source code (I will talk later about the process) which take once start 6h30 on my MacBook Pro. Today, let’s be lazy.

  1. Requirements
  2. Get the SDK
    http://openoffice.cict.fr/stable/3.1.0/OOo-SDK_3.1.0_MacOSXIntel_install_en-US.dmg and you can drag and drop anywhere, that does not matter.
  3. Test the SDK
    Open a terminal (Terminal.app or Iterm.app), look for the OpenOffice.org3.1_SDK folder :

    cd <....>/OpenOffice.org3.1_SDK
    #-- And set the environment. Follow the instruction, nothing special here, just some settings.
    ./setsdkenv_unix
    #-- You will need to execute this command each time you want to work with the SDK.
    #-- Now go to examples :
    cd examples/cpp/DocumentLoader
    #-- and build
    make
    #-- A few set of instruction will be displayed at the end of the build, Let's follow them. First start OpenOffice
    soffice "-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" &
    #-- and execute :
    make DocumentLoader.run

    If everything went fine, you should see a new document, with the content of OpenOffice.org3.1_SDK/examples/cpp/DocumentLoader/test.odt.

Just enjoy, you can now extend OpenOffice with the SDK. For more information,  continue your reading on this page : http://wiki.services.openoffice.org/wiki/SDKInstallation.

Rédigé par Jonathan

juin 3, 2009 à 1:10

Publié dans en, go-oo

Rencontre avec la JE de science PO Rennes !

avec 5 commentaires

IEP rennes

IEP Rennes

J’ai eu l’occasion de faire connaissance en tant que représentant de Centrale Nantes Etudes avec la JE de science PO Rennes, nouvellement créée et que l’on parraine. Elle se positionne sur le marché du conseil aux entreprises (Marketing, Communication, Audit …) côte à côte avec les JE de Sup de CO de la région, et en exclusivité sur deux autres marchés, celui du conseil aux organisations à but non-lucratif et aux administrations, ce qui est extrêmement prometteur. C’est à voir ici http://www.sprjuniorconseil.com

Sinon notre rencontre a été très chaleureuse, j’ai pu participer à leur cocktail de fin d’année sur Rennes, et deux d’entre eux sont venus nous voir à Nantes pour l’ascension :

SPR JC & CNE

SPR JC & CNE

Voilà, enfin bon c’était hyper Sympâ !

Rédigé par Jonathan

mai 24, 2009 à 10:11

Publié dans CNE

How to hide your desktop in MacOS X !

laissez un commentaire »

Hiding your desktop allow you get your entropy sensible place ever clean like that :

a clean desktop (geektools activated)

a clean desktop (geektools activated)

To do so, simply open the terminal and type :
defaults write com.apple.finder CreateDesktop -bool false

Then restart finder (right clic on finder, quit, …).

Rédigé par Jonathan

mai 11, 2009 à 11:22

Publié dans Mac Os, en

How to create a new admin-gen theme in symfony 1.2

avec 2 commentaires

As I got yesterday a deep issue in symfony 1.2, I decided to blog about it in english as I hope I will save a lot of time to somebody else. My issue was : « how to create a theme for my admin-gen ? ».

Most of admin-gen user know this piece of code in generator.yml

generator:
  class: sfPropelGenerator
    param:
      model_class:           BlogArticle
      theme:                 admin
      non_verbose_templates: true
      with_show:             false
      singular:              ~
      plural:                ~
      route_prefix:          article
      with_propel_route:     1

let’s talk in deep about it and especially about the theme param. Just an info, don’t try with_show, it’s not supported in symfony 1.2 ^^ !

First of all, back to the basis, what is init-admin, what is generate-admin ?

propel:init-admin

propel:init-admin

Result :

apps/frontend/modules/individu/actions:
actions.class.php
apps/frontend/modules/individu/config:
generator.yml
apps/frontend/modules/individu/templates:
propel:generate-admin

propel:generate-admin

Result :

apps/frontend/modules/entreprise/actions:
actions.class.php
apps/frontend/modules/entreprise/config:
generator.yml
apps/frontend/modules/entreprise/lib:
entrepriseGeneratorConfiguration.class.php      entrepriseGeneratorHelper.class.php
apps/frontend/modules/entreprise/templates:

To be honest, the only difference I see between init-admin and generate-admin is generate-admin is more complete :

  • It creates a routing rules.
  • It creates some helpers.

Anyways, they both works the same way as they will inherit from cache/frontend/dev/modules/autoIndividu and cache/frontend/dev/modules/autoEntreprise for the modules apps/frontend/modules/individu and apps/frontend/modules/entreprise.

OK, let’s go. My first advice :

symfony cc is not enough, it only cleans configuration and basic cache, but not the generated code. Then rm -r cache/* is the best way to handle a clean of the cache.

My second advice is :

changing randomly the theme param value will not get far cause no error is thrown if the theme is missing, as reported in the ticket #6287! Then the correct default value are :

  • default is you are using a propel:init-admin.
  • admin is you are using a propel:generate-admin

Now let’s create a new theme from a existing one.

The documentation says :

Customizing the Theme

There are other partials inherited from the framework that can be overridden in the module templates/ folder to match your custom requirements.

The generator templates are cut into small parts that can be overridden independently, and the actions can also be changed one by one.

Which means you can override parts of the template contained in cache/frontend/dev/modules/autoIndividu/template in apps/frontend/modules/individu/template.

However, if you want to override those for several modules in the same way, you should probably create a reusable theme. A theme is a sub-set of templates and actions that can be used by an administration module if specified in the theme value at the beginning of generator.yml. With the default theme, symfony uses the files defined in $sf_symfony_lib_dir/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/.

That’s true, but only for a module generated with propel:generate-admin (which btw gets as default theme the value admin). Even if it’s works be aware that have to do a full copy of the theme (no override of the default theme).

Here we do :


# move to root of your project
cd root_of_my_symfony_project
# get the generator's data for symfony 1.2.6
svn export http://svn.symfony-project.com/tags/RELEASE_1_2_6/lib/plugins/sfPropelPlugin/data/generator data/generator
#you can delete what you don't need
rm -r data/generator/sfPropelForm*

Now you get pretty much everything you need for a theme available in a propel:init-admin generated module, or a propel:generate-admin generated module:

  • If you want to make a theme for a init-admin :
    cp -R generator/sfPropelAdmin/default generator/sfPropelAdmin/mytheme
  • If you want to make a theme for a generate-admin :
    cp -R generator/sfPropelModule/admin generator/sfPropelModule/mytheme

To activate your theme :

generator:
  class: sfPropelGenerator
    param:
      model_class:           BlogArticle
      theme:                 mytheme
      non_verbose_templates: true
      with_show:             false
      singular:              ~
      plural:                ~
      route_prefix:          article
      with_propel_route:     1

Enjoy the advanced admin-gen customization and feel free to ping me in comments if you need more info or if you see something, you are much welcome ;-)

Rédigé par Jonathan

mai 2, 2009 à 4:10

Publié dans en, symfony

taggé sous ,

Semaine de taré : Fin

avec 3 commentaires

Pas de blog post depuis 10 jours : C’est à dire que depuis 10 jours c’est encore plus le stress que d’habitude. Déjà nos chers EI3s partent en stage, c’est un peu kernel panic. Puis un projet à finir, puis mon stage à trouver, mais en gros ce qui m’a plus tué, c’est le jet-lag de ce week-end. Enfin bon, je ne suis pas tout seul dans ce cas, rien que @Chebitchov, @divarel et @nvaroqua ont tous passé une semaine chargée.

divarvel à la JE de nuit

Divarvel qui va bienôt faire dodo à la JE

Je suis tellement crevé que je ne vais pas finir cet article. [J'aurai mieux dormis à la JE]

Rédigé par Jonathan

avril 3, 2009 à 5:22

Publié dans fr

Trop de mails, trop de boites et cela rame.

avec 3 commentaires

Mon compte Gmail

Gmail, toujours en "bêta"

Le problème à la base est simple, j’ai deux boites mails, l’une à l’école : @eleves.ec-nantes.fr et l’autre avec google : @gmail.com que je consulte en IMAP.

Le compte de l’école est limité à 300 Mo de stockage, mais ce n’est pas le cas de gmail avec 7300 Mo de limite de stockage ce qui fait que j’ai 14000 conversations stockées. Hors Mail (client Mail pour Mac) n’est pas très doué pour afficher tout ça dans une mailbox, et donc ça rame.

J’ai tenté thunderbird, ou autres, mais c’est strictement pareil, je ne peux pas demander à un client desktop d’afficher le dossier All Mail sans que cela rame. Donc l’idée d’utiliser principalement l’interface web de Gmail, mais il faut absolument que je trouve un moyen de transférer le compte école, et donc j’ai trouvé grâce au programme imapsync.

Déjà on installe le truc sur le Mac:

sudo port install imapsync
#petit problème d'activation dans PERL :
sudo port -f activate p5-digest-md5
#puis on recommence
sudo port install imapsync

Puis après 5 secondes à jouer avec, j’ai cette ligne de commande

imapsync --host1 imaps.nomade.ec-nantes.fr --user1 USER1 --port1 993 --ssl1  --host2 imap.gmail.com --user2 USER2@gmail.com --port2 993 --ssl2  --password1 PASS1 --password2 PASS2 --folder INBOX --delete

Il ne reste plus qu’à automatiser ça, et cela me fait qu’une seule boîte mail à consulter.

Update 1 : J’ai oublié le --expunge1 qui permet de mieux supprimer les messages de la boite 1. Donc :
imapsync --host1 imaps.nomade.ec-nantes.fr --user1 USER1 --port1 993 --ssl1 --host2 imap.gmail.com --user2 USER2@gmail.com --port2 993 --ssl2 --password1 PASS1 --password2 PASS2 --folder INBOX --delete --expunge1

Rédigé par Jonathan

mars 25, 2009 à 8:51

Publié dans Non classé

taggé sous , ,

Mise à jour iPhone 0S : 3.0 Beta

laissez un commentaire »

En 3 jours je suis passé d’un iPhone OS 2.2.0 Jailbreaké, à un iPhone OS 2.2.1, puis à un 3.0 beta.

Mise à jour de l'iPhone de mon frère.

Mise à jour de l'iPhone à l'arrache !

Déjà l’iPhone OS c’est quoi ? C’est le système d’exploitation de nos iPhones. Pour être plus précis, c’est une version légère de MacOS 10.4, avec quelques trucs en plus, comme le framework Cocoa Touch, pour tout ce qui est inteface utilisateur, Core Location, pour les services GPS, puis d’autres API.

Et cet OS se mets à jour gratuitement pour tout les iPhones depuis la première génération, et apporte son lot de nouveauté et d’optimisation. Suite à l’événement de ce mardi, à Cupertino, en tant que iPhone développeur, j’ai pu mettre à jour mon iPhone à la dernière version de cet OS, la 3.0 beta, qui va être disponible pour tout le monde cet été.

Qu’est ce qu’apporte cette mise à jour ? Beaucoup à mon goût :

  • Spotlight sur l’iPhone
  • StreetView dans googlemap
  • Un meilleure gestion des SMS/MMS
  • Le copié/collé (@divarvel, ok c’est bien à avoir)
  • Bientôt, le tethering USB ^_^ ! Un vrai modem 3G pour mon Mac !
Spotlight sur iPhone

Spotlight sur iPhone

Un bel exemple de spolight sur iPhone. Ici on peut voir les applications qui portent le nom Youtube, et les clips qui ont en commentaire Youtube. Pour info Spotlight cherche dans les :

  • Contacts.
  • Media (contenu de l’iPod).
  • Calendrier.
  • Applications.
  • Bookmarks.
Mon home sur iPhone

Mon home sur iPhone

Ici en gros ce que j’utilise le plus.

Quels iPhone j’ai mis à jour ? Le mien, Jeudi matin, et celui de mon frère, Jeudi soir dans la voiture. Ce qui nous fait un retour d’expériences assez diverses, mais en gros :

  • Cet OS est bugé. C’est bien une Beta, et mon frère, ainsi que moi l’avons bien constaté. Benji a eu quelques soucis diverses, et un crash, moi c’est Payback qui ne veut plus démarrer.
  • Mais les applications développée pour 2.x marche toujours sur 3.0, c’est quand même super cool.
  • La nouvelle gestion des SMS est super.
  • Le mode landscape dans toutes les applications 1er partie (messages, mail, …) est très agréable.
  • Le copier/coller est bien intégré.

Ce qui fait que moi, je vais le garder, c’est mon coté utilisateur de produit Microsoft qui ressort, et peut-être que mon frère va repasser au 2.2.1.

Mon objectif maintenant, c’est d’activer le tethering USB.

Rédigé par Jonathan

mars 21, 2009 à 12:13

Publié dans fr

Last.fm is so amazing ! Juno reactor aussi !

avec 4 commentaires

Listening to Juno Reactor ?

"Listening to Juno Reactor ?"

VOILÀ, je remercie publiquement Last.FM pour son API ouverte qui permet à des geeks extérieurs de construire des apps comme par exemple ce tag cloud des artistes que je devrais tester : http://anthony.liekens.net/pub/scripts/last.fm

1200 Micrograms Armand van Helden Astral Projection Basement Jaxx Bent Bonobo Boys Noize Cut Copy Dirty South Eric Prydz Faithless Fedde le Grand Fluke Flunk Goldfrapp Groove Armada Hallucinogen Hooverphonic Infected Mushroom Vs Violent Vision Infected Mushroom vs. Liranran Jakatta Juno Reactor & Don Davis Kavinsky Lamb Leftfield Lemon Jelly Mandalay Michael Gray Moby Moloko Morcheeba Mr. Oizo Mylo Orbital Peter Gelderblom Portishead Rob Dougan Shpongle Sneaker Pimps Steve Angello Supermode Surkin The Chemical Brothers The Knife Thievery Corporation Traci Lords Télépopmusik UNKLE Yonderboi Zero 7

Ou cette carte de la musique qui m’a permit de découvrir Juno Reactor (ma drogue), qui se trouve juste à coté de Infected Mushroom !

J'écoute ici, ici, et ici !

Rédigé par Jonathan

mars 18, 2009 à 3:01

Publié dans fr