mercredi 17 novembre 2010

Samsung Gallaxy S, lagfix

Le lagfix permet d'augmenter les performances du téléphone sans pour autant changer le système d'exploitation.

Cyanoged Mod 6.1 Béta disponible pour Galaxy S (version définitive devant être disponible en décembre 2010).

Le principe est simple : samsung a choisi pour ses téléphones un système de fichier tout sauf performant : RFS.
En remplaçant ce dernier, les performances sont considérablement augmentées.

Samsung Gallaxy S, premières impressions

Le choix fait, et devant changer de portable je suis récemment passé à un smartphone.
Je me suis porté vers un androïd, ayant ainsi la possibilité éventuelle d'y développer (les conditions de développement sous iPhone étant trop impossibles...), choisissant le dernier modèle à la mode : Samsung Gallaxy S.

Truc & astuces de première prise en main :
  • accents rester appuyé sur la lettre de base affiche une petite fenêtre avec les accents possibles



Quelques conseils d'applications m'ont déjà été fait :
  • Shazam(préférer le wifi) reconnaissance musicale d'un morceau à partir du métro

  • Mp3music download(préférer le wifi) téléchargement de musique (hum, pas clair pour les droits ?)

  • ringdroid Permet le découpage d'une partie d'un morceau pour en faire une sonnerie.

  • Stopwatch Chronomètre ?

  • Minuteur Est-il besoin d'expliquer ? Il n'y en a pas de base dans le téléphone.

  • Aldico Dictionnaire.

  • Métromap Plan de métro.

  • Andro radio (préfèrerait le wifi ?) Listing de webradios & écoute.

  • Color flash light Transformer son téléphone en lampe. Avec quelques choix de couleur. (désactive pour cela la mise en veille).

  • opéra le browser web, serait semble-t-il plus rapide que celui par défaut (?)

  • Places directory(besoin du GPS) Chercher les commerces à proximité.

  • Barcode scanner Pour reconnaître les flash-codes (permet entre autre de générer un contact sous forme de "code bar 2d" qui est ainsi facilement transférable.




Premières impressions :
  • Le transfert des contacts est fastidieux, le format de la carte SIM étant mal reconnu, je me retrouve à devoir modifier un paquet de données à la main, un à un

  • La connexion wifi marche super bien, l'ergonomie est super

  • Le schéma/code de dévérouillage qui remplace le code PIN étant graphique, il est très, trop facile à mémoriser, même pour quelqu'un regardant simplement un ou deux fois.





Premiers liens pour aller code sur le tél :

jeudi 11 novembre 2010

firefox shortcuts

A trick I learned at the Parisian Ubuntu party last weekend :

  • Ctrl-click on a link opens it on a new tab.



Some others I recently discovered that people around me didn't know :

  • Ctrl-Shift-T reopen last closed tab, with history, cookies, etc.

  • Ctrl-k go to search box

  • Ctrl-l or F6 or Alt-d go to URL/Location box

  • Ctrl-f open/go to the "find on this page" box


  • Spacebar go down one page

  • Shift-Spacebar go Up one page

  • Ctrl+Enter complete .com address

  • Ctrl+Enter complete .net address

  • Ctrl+Shift+Enter complete .org address



(this is not an exhaustive list of firefox shortcuts, so feel free to comment with others you may know).

jeudi 4 novembre 2010

Thunderbird : change account order

No point-and-click solution that I know, but I found a solution modifying the file :


~/.thunderbird//prefs.js


look for the line :

user_pref("mail.accountmanager.accounts", "account1,account2,account3,account4,account6,account5,account7,account8,account10");


And re-order the "accountX" as you wish to see them.


Be careful to edit this file while thunderbird is NOT running, it seems that tb writes this file back at the exit.

lundi 11 octobre 2010

copy-paste+url (ffox extention) ThiTan

Firefox extension for having a "copy-paste" that also copies the URL of the page. Very useful for citing blogs, webpages, etc. and easily keep the reference of the page ;-)

Announcement of the addon :
http://formats-ouverts.org/blog/2010/03/14/2292-thitan

Page of the addon :
https://addons.mozilla.org/fr/firefox/addon/11066/

dimanche 10 octobre 2010

(links) For my camera


AVCHD Videos

I've got a Panasonic DMC-ZX3 since a few month and I found a few informations on how to view, convert, etc. the videos it takes. They are in HD and outputed in a strange .MTS files (and some others, I'll write more on that some time later). Regular players can't read those files, and I eventually found some converting tools under linux (I'm using ubuntu)


AVCHD = sudo apt-get install libavcodec-extra-52 winff openshot
http://blog.yann.info/2010/05/16/avchd-pour-les-nuls-et-les-pauvres/





Tethering (using computer as a screen for the camera while shooting)

Meanwhile, I found this website explaining how to use your computer screen for your camera. I didn't test already, but I like the idea.


http://grahambinns.com/blog/2010/04/18/gphoto2-f-spot-win/

jeudi 7 octobre 2010

Option Dash Dash

Une propriété intéressante des outils gnu,bsd&cie. est la possiblité d'indiquer la fin du passage des options avec un "--" (dash dash).

Pratique par exemple pour faire un grep sur quelquechose qui pourrait ressembler à une option, sans que la chaine à chercher ne soit interprétée comme otion de grep. Mais ce n'est qu'un exemple.


Application, pour chercher toutes les occurences de '-l' dans le fichier 'toto.txt' :

grep -- -l toto.txt

mercredi 15 septembre 2010

Mettre un stamp sur une image

Avec convert (de Imagemagick), fonctionne bien avec la version :

$convert --version
Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP



#!/bin/bash
# stamp timbre A_marquer Img_finale

# (c) 2007-2010 by C.M.
# under the GPL License

# prendre deux fichiers d'images
# l'un étant un "sceau" et l'autre une photo
# et marquer la photo du sceau, en bas à droite (ou gauche)
# Image timbre
SCEAU="$1"
# Image à marquer
PIC="$2"
# Fichier de sortie
OUT_IMAGE="$3"
# Proportion du timbre par rapport à l'image
SCALE="/ 20"


# dimensions de l'image à marquer
width_pic=`identify -format %w "$PIC"`
height_pic=`identify -format %h "$PIC"`

# dimensions du sceau
width_sceau=`identify -format %w "$SCEAU"`
height_sceau=`identify -format %h "$SCEAU"`

# dimensions auxquelles réduire le sceau
stamp_w=$(( $width_pic $SCALE * 2))
stamp_h=$(( $height_pic $SCALE))


# dimensionner le sceau à la bonne taille
# PUIS mettre un bord transparent autour du sceau pour qu'il ne soit pas au bord
# PUIS coller le sceau sur l'image avec un dissolve
convert "${SCEAU}" -resize "${stamp_w}"x"${stamp_h}"\> \
-size "${stamp_w}"x"${stamp_h}" miff:- |\
convert - -matte -bordercolor none -border 20% miff:- |\
convert "$PIC" - -matte -gravity South-East \
-set "option:compose:outside-overlay" "false" \
-compose Over \
-compose dissolve -set "option:compose:args" 60 \
-composite "$OUT_IMAGE"




TODO :
  • ajouter un texte en option qui serait placé sous le sceau

  • changer la proportion en fonction de la taille de l'image ? (mais quel seuil??)
  • dimanche 5 septembre 2010

    Nautilus Main Toolbar made compact

    Since I've got my Asus eeepc 1000h, I've been looking from time to time for a way to reduce spare space on the different apps. I hence went for ubuntu-notebook-remix and it's customizations, but not everything was included. Noticeably, Nautilus, the default file browser for gnome has a "main toolbar" very space-greedy, and without simple customization ways proposed.


    I found this page pointing to some package to customize the toolbar. Look at the screenshots on this page to see the effect. If the link is down, look for the package to install (code is bellow).

    "nautilus elementary"

    Those commands were copy-pasted from the above link for re-usability :

    To install "nautilus-elementary" from it's PPA :

    sudo add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa
    sudo apt-get update && sudo apt-get upgrade
    nautilus -q #restarts nautilus



    To compile nautilus

    sudo apt-get install bzr
    sudo apt-get build-dep nautilus
    bzr branch lp:nautilus-elementary
    cd nautilus-elementary/
    ./configure --prefix=/usr && make
    sudo make install

    And restart nautilus :

    nautilus -q




    That's it. Then customize everything to suit your needs via the Tweaks tab you can find via Edit > Preferences menu in Nautilus. To customize the toolbar, simply right click on it.

    jeudi 26 août 2010

    HackerSpaces parisiens

    Les Hacker Space sont des lieux de rencontre et de partage de matériel permettant de mutualiser l'expérience en montages électronique&autres, philosophie & éthique de l'informatique et des "nouvelles technologies" et domaines adjacents.

    On en trouve quelques-uns à Paris et en région parisienne :

    http://www.phack.fr/

    INSEE sources...

    Déjà eu envie de se refaire les stats de l'INSEE à la pogne ?
    Non ? moi non plus, mais on trouve quand même leurs fichiers en ligne pour exploitation éventuelle :-P


    Fichier INDIVIDU, MENAGE et KISH


    Il y aurait surement des utilisations intéressantes à en faire.


    Pour ce qui est de leur analyse, c'est du dBase, je cite ci dessous l'article de Bodman publié ici (lien).


    Base de donnée de l’INSEE
    janvier 24, 2010

    Un peu de Datamining aujourd’hui, quelque chose de très court, mais qui sera sans doute utile à certain.

    Cela concerne la lecture de fichier dBase, car sachons le l’INSEE met à disposition un certain nombre de données au format dBase.

    Le premier réflexe face à ce genre de fichier serait de l’ouvrir avec un tableur et d’en sortir directement les valeurs nécessaires. Malheureusement, deux problèmes se posent, la lenteur du programme face à des fichiers de très grande taille, et la limite des tableurs en nombre de lignes.

    Pourtant, il existe une méthode bien plus rapide (et bien plus fun !), l’utilisation d’un script, pour lire ces fichiers volumineux comme on l’entend.

    Pour cela j’ai choisi le langage PHP. Cela faisait longtemps que je n’avais pas joué avec et puis en plus il dispose déjà de fonctions adaptées à la lecture de fichier dbase.

    Voici donc un petit script qui va extraire les catégories socioprofessionnelles (niveau 1) pour un échantillon de 130 000 valeurs :

    $CODE[1] = "Agriculteurs exploitants";
    $CODE[2] = "Artisans, commerçants et chefs d'entreprise";
    $CODE[3] = "Cadres et professions intellectuelles supérieures";
    $CODE[4] = "Professions Intermédiaires";
    $CODE[5] = "Employés";
    $CODE[6] = "Ouvriers";
    $CODE[7] = "Retraités";
    $CODE[8] = "Autres personnes sans activité professionnelle";

    function percent($v,$t) {
    return round((( $v / $t ) * 100),2);
    }


    $db = dbase_open('epcvhf10_in109604.dbf', 0);
    if ($db) {
    echo("lecture des données possible\n");
    $record_numbers = dbase_numrecords($db);
    for ($i = 1; $i <= $record_numbers; $i++) {
    $row = dbase_get_record_with_names($db, $i);
    $cs = trim($row['CS']);
    $occupation = trim($row['OCCUPA']);
    $age = trim($row['AGE']);
    if ( ($occupation == 5 ) or ( $occupation == 6 ) ) $cs = 7;
    if ( $age > 14 )
    if ($cs != 99 && $cs != '' )
    {
    $vn1 = substr($cs, 0 , 1 );
    if (!isset($n1[$vn1])) $n1[$vn1] = 0;
    $n1[$vn1[0]]++;
    $population++;
    }
    }
    dbase_close($db);
    foreach ( $n1 as $clef => $nombre )
    {
    echo percent($nombre ,$population) . " : " . $CODE[$clef] . "\n";
    }

    Une autre fonction interessant dbase_get_header_info($db), permet de récupérer les champs disponibles dans la base.

    vendredi 20 août 2010

    Dummynet interfaces

    The dummy modules in Linux allow you to have multiple "fake" network interfaces on your computer.

    It's useful to test distributed programs locally.

    Test if dummy is loaded :

    lsmod | grep dummy



    insmod dummy



    Create a first dummy interface :

    ifconfig dummy0 10.0.0.1


    Create another one :

    ifconfig dummy0:1 10.0.0.2


    Destroy a dummy interface :

    ifconfig dummyX:Y down

    mardi 22 juin 2010

    snippets latex beamer (by Tom P.)


    \mode
    % Par opposition au mode article qui permet de faire des notes de lectures à
    partir d'une présentation



    \usepackage{comment}
    % Purpose:
    % selectively in/exclude pieces of text: the user can define new
    % comment versions, and each is controlled separately.
    % Special comments can be defined where the user specifies the
    % action that is to be taken with each comment line.



    \usepackage{colortbl}
    % The colortbl package:
    % Add colour to LaTeX tables. Requires array and color packages.
    % Process colortbl.ins to produce the package file colortbl.sty.
    % Process colortbl.dtx to get the documentation (this requires
    % longtable hhline and dcolumn from the standard `tools'
    % distribution.)



    \selectcolormodel{gray}
    % Mettre les slides en nuances de gris
    \usepackage{pgfpages}
    % package nécessaire pour mettre plusieurs slides par pages
    \pgfpagesuselayout{8 on 1}[a4paper,border shrink=5mm]
    % Combien de slides par page
    \pgfpageslogicalpageoptions{1}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{2}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{3}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{4}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{5}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{6}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{7}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    \pgfpageslogicalpageoptions{8}{border
    code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
    % Mettre des cadres autour des slides et un petit coin noir



    \PrerenderUnicode{é}
    \PrerenderUnicode{à}
    \PrerenderUnicode{œ}
    % Pour avoir ces caractères unicode dans les titres des slides sans refaire
    une passe latex supplémentaire



    \bsc
    %babel propose la commande \bsc pour placer un bout de texte en petites
    %capitales. Cela peut être pratique pour les acronymes, siglaisons et les noms
    %propres.



    % Macro de A. Kassi (alain.kessi@psi.ch)
    \makeatletter
    \def\hlinewd#1{%
    \noalign{\ifnum0=`}\fi\hrule \@height #1 %
    \futurelet\reserved@a\@xhline
    }
    \makeatother
    % modifie l'épaisseur d'un trait dans un tableau
    %Exemple :
    %\begin{tabular}{|l|r|} \hline
    % premier & 1 \\ \hline
    % second & 2 \\ \hlinewd{5pt}
    % total & 3 \\ \hline
    %\end{tabular}
    %%%% fin exemple %%%%




    Enjoy :)

    Tom

    mercredi 9 juin 2010

    Aspect Programming

    FROM : http://www.aspectprogramming.com/aosd


    What is Aspect-Oriented Software Development?

    Aspect-Oriented Software Development (AOSD), sometimes just called Aspect-Oriented Programming (AOP), is a new approach to software design that addresses modularity problems that are not handled well by other approaches, including Structured Programming and Object-Oriented Programming (OOP). AOSD complements, but doesn't replace those approaches.

    mardi 25 mai 2010

    Perl One-liner

    Un des atouts de perl est la facilité avec laquelle il est possible d'écrire des scripts très compacts.

    Un des défauts de perl est que rapidement quand le script devient un peu long.

    Un bon compromis : faire des scripts très courts :-)


    La page suivante présente un certain nombre d'exemple d'utilisation de perl sans passer par un script indépendant dans un fichier, et en utilisant plutôt une simple ligne ("One Liner") de code directement sur la ligne de commande :

    http://sial.org/howto/perl/one-liner/

    lundi 17 mai 2010

    PDF merge & reduce size

    Merge PDF with pdftk


    pdftk 00-page1.pdf 01-page2.pdf 03-page3.pdf cat output OUT.pdf 


    Reduce the size of the PDF


    gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

    (source : http://www.mnt-tech.fr/blog/gnulinux/comment-reduire-la-taille-dun-fichier-pdf-en-ligne-de-commande-sous-linux/ )

    lundi 26 avril 2010

    OpenOffice / oocalc : protect specific cells

    The problem :

    I've got a calc sheet for calculating some grades.
    Hence, after setting all the formulas (you may want to have a look at the SUMPRODUCT(notes*percent) function ;-) ), I want to actually enter the grades I gave.

    What I want to do is not to mess around with the cell containing formulas while I am entering data.

    How to (un)-lock specific cells



    1. Select the cell you want to still modify.

    2. right-click: Format-Cells -> "Cell Protection" tab => uncheck "protected".

    3. Tools -> Protect Document -> sheet

    4. Uncheck "select locked cells" and check "select unlocked cells".



    Now only the cells selected in step 1) should be the only ones you can select and modify !

    vendredi 23 avril 2010

    LaTeX et .bib (fichiers de bibliographie)

    Le code LaTeX à utiliser


    Dans l'entête :




    % \usepackage{natbib} % pour changer l'affichage des citations
    % \usepackage[fixlanguage]{babelbib} % biblio FR
    % \selectbiblanguage{french} % biblio FR


    Là où l'on souhaite intégrer la bibliographie



    Dans le document (note que comme d'hab en LaTeX tu n'as pas besoin de
    mettre l'exention du fichier, en l'occurence tu auras typiquement
    "fichier.bib" à la place de "bibtexfile"


    % \bibliographystyle{unsrt} % biblio style classique
    % \bibliographystyle{babplain-lf} % Biblio FR
    % \bibliography{bibtexfile} % Chemin vers la base de citations


    Un peu de doc (entre autre) :
    http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/



    Logiciels pour gérer la biblio



    Il y en a de nombreux dont un en java qui marche pas trop mal mais dont le nom m'échappe.

    J'utilise pybliographer / pybliographic , qui a le mérite de permettre l'édition native des .bib directement.

    mercredi 24 mars 2010

    Around an Arduino

    Jeudi dernier au salon Solution Linux (ex Linux Expo) à Paris, je suis
    tombé sur le stand de H:D (Hackable Devices) [1,2] , qui visent à
    promouvoir
    le hardware libre.

    Entre un freerunner (sous openmoko), quelques autres kits de
    développement de niveau plus ou moins bas, une petite plateforme avec
    un chip, une vingtaine d'entrées-sorties, et une connectique USB ont
    attiré mon attention en particulier.

    Il s'agissait d'Arduino. Apparemment c'est une plateforme libre à base
    d'ATMega328, je cite [2] :


    "Arduino Duemilanove
    Duemilanove ATMega328 serie

    The Arduino Duemilanove ("2009") is a microcontroller board based on
    the ATmega168 or ATmega328. It has 14 digital input/output pins (of
    which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal
    oscillator, a USB connection, a power jack, an ICSP header, and a
    reset button."

    En cherchant un peu plus sur le web on trouve en particulier des infos
    sur comment installer les outils de développement [3].


    Par contre, je cherche encore des infos sur comment réaliser les
    circuits que l'on peut mettre en sortie (bon, ok, ça tape plus dans
    l'électronique, mais il n'empêche). Par exemple si je veux y mettre un
    moteur quelconque, une matrice de led, ou bien même, plus intéressant,
    un interrupteur qui pourrait me permettre d'allumer l'alimentation
    d'un disque dur externe. Ce ne sont que quelques idées qui pourraient
    me permettre d'expérimenter avec cette plateforme, mais je ne sais pas
    encore comment les réaliser. Toute information est donc la bienvenue.


    Cherchant ce type d'informations, l'on vient de me conseiller d'aller
    également voir du côté des adaptateurs USB-port parallèle, qui sont en
    soit plus simple à programmer. Mais en fin de compte je trouve ça
    moins marrant, et surtout ça ne règle aucunement le problème de
    l'électronique à mettre derrière.


    J'ai trouvé quelques projets utilisant des arduino sur hackaday [4].


    Pour le prix, ça à l'air de tourner dans les 25 à 30 euros, donc assez
    raisonnalble [2, 5, 6]

    Références :


    [1] http://hackable-devices.com/

    [2]
    http://hackable-devices.org/products/product/ArduinoDuemilanove-atmega328/

    [3] http://www.arduino.cc/playground/Learning/Linux


    [4] http://hackaday.com/page/2/?s=arduino

    [5] http://microcontrollershop.com/product_info.php?products_id=2193
    [6] http://www.lextronic.fr/P4133-platine-arduino-usb-board.html

    lundi 22 février 2010

    NetBSD & versions d'Unison

    La version courante d'Unison sur Ubuntu était la 2.27.57, alors que celle de l'arborescence de pkgsrc pour Netbsd était la 2.32.
    Les deux version ne sont pas compatibles.

    En explorant les archives du CVS de pkgsrc (ici : http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/net/unison/?only_with_tag=pkgsrc-2009Q3
    et là : http://pkgsrc.se/branch=pkgsrc-2009Q3/net/unison ) + quelques pointeurs sur freenode:#netbsd

    Voici la suite de commandes que j'ai


    pkg_delete unison-2.32.52

    cd /opt/pkgsrc/net/unison
    cvs up -rpkgsrc-2009Q3 -dP

    /usr/bin/make reinstall

    cd directory && cvs up -rpkgsrc-2009Q3 -dP


    Et fantastiquement, cela fonctionne maintenant à merveille :-)

    Bash scripts :

    Dans un script bash, qui commence donc avec :

    #!/bin/bash

    • set -u : empèche d'utiliser des variables non définies préalablement => évite les erreurs
    • set -x : affichage plus verbeux
    • set -e : arrête l'exécution à la première erreur

    Merci Julien S.

    jeudi 11 février 2010

    Tor et firefox (+polipo)

    Sous ubuntu, avec firefox :

    Il est conseillé d'utiliser Tor, avec le proxy "polipo", et "tor button" (addon firefox)


    http://www.torproject.org/docs/tor-doc-unix.html.en#polipo

    mardi 2 février 2010

    svn properties svn:keywords

    Since I'm sometimes looking for this page to find

    SVN Book : Properties (Chapter 7. Advanced Topics)


    $ svn propset svn:keywords "Date Author" contrib.tex
    property 'svn:keywords' set on 'contrib.tex'
    $



    Some vocabulary :

    1. scm = source code manager

    2. vcs = version control system

    3. dvcs = distributed version control system




    Like for example : rcs, cvs, svn, mercurial, darcs, git, ...
    wikipedia:List_of_revision_control_software

    jeudi 14 janvier 2010

    Asus EEE 1000H : how to access the bios ?

    To access the bios on my Asus EEE 1000H, the key is : F2.


    Note that there also is a menu proposing to boot on the different storage devices detected : ESC.

    mercredi 13 janvier 2010

    A way to make a usbkey bootable (saved)




    SAVED FROM :




    How-to: Installing Ubuntu Linux on a usb pendrive


    This tutorial will show how-to install Ubuntu on a usb stick. Even though this tutorial uses Ubuntu as its base distribution, you could virtually use any type of Linux liveCD distribution.


    Being able to run Linux out of a usb bar is a great way to enjoy the live CD experience (being able to use Linux on any computer you might get by) and the big advantage of being easier to carry around than a CD.


    1. Requirements




    In order to reproduce this tutorial, you will need a few items such as:



    • a ubuntu liveCD

    • a usb bar of at least 1G

    • a running Linux operating system


    Now that you have all this, it is time to prepare you USB bar do host the Ubuntu liveCD files.


    2. Setting up the USB disk


    2.1. Finding the device




    In the first place, you need to plug your usb drive and check under which device it is associated. To find out the device, run:


    $ sudo fdisk -l


    On my system, the device appears as being /dev/sdb, I will therefore use /dev/sdb as a reference for this tutorial, please replace it accordingly to your system (might be sda, sdc ...).

    Once you found your device, you are going to create the partitions.


    Using the wrong device name might destroy your system partition, please double check


    2.2. Making the partitions


    Make sure every of your already mounted partition are unmounted:


    $sudo umount /dev/sdb1


    and then launch fdisk, a tool to edit partition under linux:


    sudo fdisk /dev/sdb


    We are going delete all the partition and then create 2 new partition: one fat partition of 750M which will host the files from the live CD iso, and the rest on another partition.


    At fdisk prompt type d x where x is the partition number (you can simply type d if you only have one partition), then:




    • n to create a new partition

    • p to make it primary

    • 1 so it is the first primary partition

    • Accept the default or type 1 to start from the first cylinder


    • +750M to make it 750 Meg big

    • a to toggle the partition active for boot

    • 1 to choose the 1 partition

    • t to change the partition type

    • 6 to set it to FAT16



    Now we have out first partition set up, let's create the second one:



    • n to create yet again a new partition

    • p to make it primary

    • 2 to be the second partition

    • Accept the default by typing Enter


    • Accept the default to make your partition as big as possible

    • Finally, type w to write the change to your usb pendrive


    Partitions are now created, let's format them.


    2.3. Formatting the partitions


    The first partition is going to be formated as a FAT filesystem of size 16 and we are going to attribute it the label "liveusb".


    $ sudo mkfs.vfat -F 16 -n liveusb /dev/sdb1


    The second partition is going to be of type ext2 with a blocksize of 4096 bytes and the label casper-rw. Mind that it has to be labeled as casper-rw otherwise the tutorial won't work!.



    $ sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2


    At this stage, our usb pendrive is ready to host the liveCD image. Now, let's copy the files to the usb bar.





    How-to: Installing Ubuntu Linux on a usb pendrive -- page 2


    3. Installing Ubuntu on the USB stick


    3.1. Mounting Ubuntu liveCd image


    In the first place we need to mount our ubuntu iso. Depending if you have the .iso file or the CD, there is 2 different ways of mounting it.


    3.1.1. Mounting from the CD


    People using Ubuntu or any other user-friendly distro, might just have to insert the cd and it will be mounted automatically. If this is not the case:



    $ sudo mount /media/cdrom


    should mount it.


    3.1.2. Mounting from an .iso image file


    We will need to create a temporary directory, let say /tmp/ubuntu-livecd and then mount our iso (I will be using a feisty fawn iso).


    $ mkdir /tmp/ubuntu-livecd

    $ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd


    Once the cd image is ready, it is time to mount the newly created usb bar partitions:



    3.2. Mounting the usb bar partitions


    Same here, you might be able to get both your partition by simply replugging the usb pendrive, partition might appears as: /media/liveusb and /media/casper-rw. If this is not the case, then you will need to mount them manually:


    $ mkdir /tmp/liveusb

    $ sudo mount /dev/sdb1 /tmp/liveusb


    All the partitions we need are now mounted, let's copy the files.


    3.3. Copying the files to the usb bar



    Let positionned yourself on the CD image directory (in my case: /tmp/ubuntu-livecd , but it might be /media/cdrom , and copy at the root of your usb first partition:



    • the directories: 'casper', 'disctree', 'dists', 'install', 'pics', 'pool', 'preseed', '.disk'

    • The content of directory 'isolinux'

    • and files 'md5sum.txt', 'README.diskdefines', 'ubuntu.ico'

    • as well as files: 'casper/vmlinuz', 'casper/initrd.gz' and 'install/mt86plus'


    $ cd /tmp/ubuntu-livecd

    $ sudo cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz install/mt86plus /tmp/liveusb/


    It might complain about symbolic links not being able to create, you can ignore this.



    Now let's go to the first partition of your usb disk and rename isolinux.cfg to syslinux.cfg:


    $ cd /tmp/liveusb

    $ sudo mv isolinux.cfg syslinux.cfg


    change /tmp/liveusb according to your settings


    Edit syslinux.cfg so it looks like:



    DEFAULT persistent
    GFXBOOT bootlogo
    GFXBOOT-BACKGROUND 0xB6875A
    APPEND file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL persistent
    menu label ^Start Ubuntu in persistent mode
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL live
    menu label ^Start or install Ubuntu
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL xforcevesa
    menu label Start Ubuntu in safe ^graphics mode
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper xforcevesa initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL check
    menu label ^Check CD for defects
    kernel vmlinuz
    append boot=casper integrity-check initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL memtest
    menu label ^Memory test
    kernel mt86plus
    append -
    LABEL hd
    menu label ^Boot from first hard disk
    localboot 0x80
    append -
    DISPLAY isolinux.txt
    TIMEOUT 300
    PROMPT 1
    F1 f1.txt
    F2 f2.txt
    F3 f3.txt
    F4 f4.txt
    F5 f5.txt
    F6 f6.txt
    F7 f7.txt
    F8 f8.txt
    F9 f9.txt
    F0 f10.txt

    Woof, finally we have our usb disk almost usuable. We have a last thing to do: make the usb bootable.


    3.4. Making the usb bar bootable.


    in order to make our usb disk bootable, we need to install syslinux and mtools:


    $ sudo apt-get install syslinux mtools


    And finally unmount /dev/sdb1 and make it bootable:


    $ cd


    $ sudo umount /tmp/liveusb

    $ sudo syslinux -f /dev/sdb1


    Here we are :D , reboot, set your BIOS to boot from the usb bar and enjoy Ubuntu linux from a pendrive


    4. Troubleshooting


    If you are having trouble booting on the usb bar, this might be due to your MBR being corrupted. In order to fix it up, you can use lilo (I installed lilo on my box only for thid purpose).


    $ lilo -M /dev/sdb


    will fix the MBR on device /dev/sdb





    (copy) How to install Ubuntu on a Usb key




    SAVED FROM :




    How-to: Installing Ubuntu Linux on a usb pendrive


    This tutorial will show how-to install Ubuntu on a usb stick. Even though this tutorial uses Ubuntu as its base distribution, you could virtually use any type of Linux liveCD distribution.


    Being able to run Linux out of a usb bar is a great way to enjoy the live CD experience (being able to use Linux on any computer you might get by) and the big advantage of being easier to carry around than a CD.


    1. Requirements




    In order to reproduce this tutorial, you will need a few items such as:



    • a ubuntu liveCD

    • a usb bar of at least 1G

    • a running Linux operating system


    Now that you have all this, it is time to prepare you USB bar do host the Ubuntu liveCD files.


    2. Setting up the USB disk


    2.1. Finding the device




    In the first place, you need to plug your usb drive and check under which device it is associated. To find out the device, run:


    $ sudo fdisk -l


    On my system, the device appears as being /dev/sdb, I will therefore use /dev/sdb as a reference for this tutorial, please replace it accordingly to your system (might be sda, sdc ...).

    Once you found your device, you are going to create the partitions.


    Using the wrong device name might destroy your system partition, please double check


    2.2. Making the partitions


    Make sure every of your already mounted partition are unmounted:


    $sudo umount /dev/sdb1


    and then launch fdisk, a tool to edit partition under linux:


    sudo fdisk /dev/sdb


    We are going delete all the partition and then create 2 new partition: one fat partition of 750M which will host the files from the live CD iso, and the rest on another partition.


    At fdisk prompt type d x where x is the partition number (you can simply type d if you only have one partition), then:




    • n to create a new partition

    • p to make it primary

    • 1 so it is the first primary partition

    • Accept the default or type 1 to start from the first cylinder


    • +750M to make it 750 Meg big

    • a to toggle the partition active for boot

    • 1 to choose the 1 partition

    • t to change the partition type

    • 6 to set it to FAT16



    Now we have out first partition set up, let's create the second one:



    • n to create yet again a new partition

    • p to make it primary

    • 2 to be the second partition

    • Accept the default by typing Enter


    • Accept the default to make your partition as big as possible

    • Finally, type w to write the change to your usb pendrive


    Partitions are now created, let's format them.


    2.3. Formatting the partitions


    The first partition is going to be formated as a FAT filesystem of size 16 and we are going to attribute it the label "liveusb".


    $ sudo mkfs.vfat -F 16 -n liveusb /dev/sdb1


    The second partition is going to be of type ext2 with a blocksize of 4096 bytes and the label casper-rw. Mind that it has to be labeled as casper-rw otherwise the tutorial won't work!.



    $ sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2


    At this stage, our usb pendrive is ready to host the liveCD image. Now, let's copy the files to the usb bar.





    How-to: Installing Ubuntu Linux on a usb pendrive -- page 2


    3. Installing Ubuntu on the USB stick


    3.1. Mounting Ubuntu liveCd image


    In the first place we need to mount our ubuntu iso. Depending if you have the .iso file or the CD, there is 2 different ways of mounting it.


    3.1.1. Mounting from the CD


    People using Ubuntu or any other user-friendly distro, might just have to insert the cd and it will be mounted automatically. If this is not the case:



    $ sudo mount /media/cdrom


    should mount it.


    3.1.2. Mounting from an .iso image file


    We will need to create a temporary directory, let say /tmp/ubuntu-livecd and then mount our iso (I will be using a feisty fawn iso).


    $ mkdir /tmp/ubuntu-livecd

    $ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd


    Once the cd image is ready, it is time to mount the newly created usb bar partitions:



    3.2. Mounting the usb bar partitions


    Same here, you might be able to get both your partition by simply replugging the usb pendrive, partition might appears as: /media/liveusb and /media/casper-rw. If this is not the case, then you will need to mount them manually:


    $ mkdir /tmp/liveusb

    $ sudo mount /dev/sdb1 /tmp/liveusb


    All the partitions we need are now mounted, let's copy the files.


    3.3. Copying the files to the usb bar



    Let positionned yourself on the CD image directory (in my case: /tmp/ubuntu-livecd , but it might be /media/cdrom , and copy at the root of your usb first partition:



    • the directories: 'casper', 'disctree', 'dists', 'install', 'pics', 'pool', 'preseed', '.disk'

    • The content of directory 'isolinux'

    • and files 'md5sum.txt', 'README.diskdefines', 'ubuntu.ico'

    • as well as files: 'casper/vmlinuz', 'casper/initrd.gz' and 'install/mt86plus'


    $ cd /tmp/ubuntu-livecd

    $ sudo cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz install/mt86plus /tmp/liveusb/


    It might complain about symbolic links not being able to create, you can ignore this.



    Now let's go to the first partition of your usb disk and rename isolinux.cfg to syslinux.cfg:


    $ cd /tmp/liveusb

    $ sudo mv isolinux.cfg syslinux.cfg


    change /tmp/liveusb according to your settings


    Edit syslinux.cfg so it looks like:



    DEFAULT persistent
    GFXBOOT bootlogo
    GFXBOOT-BACKGROUND 0xB6875A
    APPEND file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL persistent
    menu label ^Start Ubuntu in persistent mode
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL live
    menu label ^Start or install Ubuntu
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL xforcevesa
    menu label Start Ubuntu in safe ^graphics mode
    kernel vmlinuz
    append file=preseed/ubuntu.seed boot=casper xforcevesa initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL check
    menu label ^Check CD for defects
    kernel vmlinuz
    append boot=casper integrity-check initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
    LABEL memtest
    menu label ^Memory test
    kernel mt86plus
    append -
    LABEL hd
    menu label ^Boot from first hard disk
    localboot 0x80
    append -
    DISPLAY isolinux.txt
    TIMEOUT 300
    PROMPT 1
    F1 f1.txt
    F2 f2.txt
    F3 f3.txt
    F4 f4.txt
    F5 f5.txt
    F6 f6.txt
    F7 f7.txt
    F8 f8.txt
    F9 f9.txt
    F0 f10.txt

    Woof, finally we have our usb disk almost usuable. We have a last thing to do: make the usb bootable.


    3.4. Making the usb bar bootable.


    in order to make our usb disk bootable, we need to install syslinux and mtools:


    $ sudo apt-get install syslinux mtools


    And finally unmount /dev/sdb1 and make it bootable:


    $ cd


    $ sudo umount /tmp/liveusb

    $ sudo syslinux -f /dev/sdb1


    Here we are :D , reboot, set your BIOS to boot from the usb bar and enjoy Ubuntu linux from a pendrive


    4. Troubleshooting


    If you are having trouble booting on the usb bar, this might be due to your MBR being corrupted. In order to fix it up, you can use lilo (I installed lilo on my box only for thid purpose).


    $ lilo -M /dev/sdb


    will fix the MBR on device /dev/sdb