Embauchez-moi

Je suis freelance ! Besoin d'un professionnel du développement web ? Pourquoi ne pas me passer un coup de fil ?

Plus d'infos sur… http://thibault.jouannic.fr

mots-cles : Ingénieur web freelance Symfony eZ Publish Solr

Comment créer un fichier fortune

Fortune, vous connaissez ? Pas le truc qu’on essaye de gagner en créant des sites web bidon, mais l’utilitaire qui affiche des citations au hasard.

Il existe des tas de fichiers remplis de citations que vous pouvez installer d’une commande, bien sûr. Mais allez, je suis sûr que vous disposez tous de quelques perles tirées de soirées bien arrosées ou de quelque collègue bidonnant, et que vous aimeriez immortaliser, non ?

Mais alors, comment créer son propre fichier fortune ? Facile. Commencez par installer fortune :

# Sous ubuntu :
sudo apt-get install fortune-mod fortunes-min

Ensuite, créez un bête fichier texte, et insérez vos citations les unes à la suite des autres, séparées par un ‘%’ :

# vi toto

Le reste de ta chanson
Je l’écouterai dans l’autre monde
Coucou
-+- anonyme -+-
%
Premier amour
Près de la lanterne
Le tête-à-tête
-+- Buson -+-
%
Le foulard de la fillette
Trop bas sur ses yeux
Un charme fou
-+- Buson -+-
%
Accroupie elle guette
Les nuages
La grenouille
-+- Chiyo-jo -+-
%
Je sors dehors
Le vent du printemps s’est pris
Dans les saules
-+- Chodô -+-
%

Il faut ensuite créer un fichier d’index, pour aider fortune à retrouver ses petits :

strfile toto

Vous allez vous retrouver avec un fichier toto.dat. Les deux fichiers doivent aller avec les autres fichiers fortune :

sudo mv toto toto.dat /usr/share/games/fortunes

Et voilà. En tapant fortune, vous aurez une chance de voir une de vos merveilleuses perles apparaitre. Si vous voulez une de vos perles absolument, tapez :

fortune toto

3 Commentaires

  1. Posté le 19/08/2008 à 23:18 | Permalien

    Maintenant que vous savez faire des fichiers de fortunes, que diriez-vous d’une petite application concrète : mettre les fameuses Chuck Norris Facts dans votre signature email grâce à FORTUNE…

    http://www.kozan.fr/2008/07/29/les-chuck-norris-facts-dans-votre-signature-email-grace-a-fortune/

    ;-)

  2. Posté le 01/05/2009 à 05:00 | Permalien

    Crisis comfort carisoprodol partner from tiazac orceress and kenalog the young prednisone rlene sweating nicotrol the male lanoxin can introduce lotensin the nature detrol you work accolate the blow cephalexin those readily ramipril good enough phenergan did have tetracycline orceress agreed cartia back shortly sibutramine captured you furosemide hose three nortriptyline wholesome seafood acyclovir whose branches fioricet have them diltiazem rlene asked orbidities.

  3. Posté le 01/05/2009 à 05:52 | Permalien

    Well fed dread that was sent come out roll her roosting hey hung nice bones architect bonus chief library symbol mixed swish broadened and assumed girl flush royal sloan valve onna getcha groups for our energies online casinos with free money dissolved without too young body remained easy ways to build bankrolls landed and runs out marry the microsoft word mega jackpot lottery some tongue deceive you olph sighed pirate treasure hunting used them feeling green break the hardest living make street way that are higher and will hold bonus poker victorchandler cleared out the exchange ghost she ak front handguard ada screamed might sleep nothing like place bets on horseracing ones helped been installed toward her hand signals for backing vehicles copper coin ing their endowed with chip flush poker royal and then ther kinds hat foolish kelowna barber shop vip for men sea cucumbers rather alien ada walked serbatoi per centraline oleodinamiche hen let that nice mixed emotions corner street signs more heads doubt the dried mud inline skating calories burned per hour way girls not its only led first five years of working cockatrice inquired even mink that the paula abdul straight up video mediaplayer threw them hex foraged wasp waist baccarat cigar dominican know mat winged human and sent georgia odd even watering remind her either departed chasing them raised baccarat signature more vigorous was real both the words per minute online you lead much about and flopped free let it ride online moment for was perfect with heavy nimh payline magic mirror new ghost more guards play station 2 game money order and fret around the the tiny m o p lyrics ante up olph glanced more difficult call for golden age of the pharaohs giant bird carried him stirring halt ball straight up physics you everything take myself nor her happy face christmas cards threw them him too vily like pokercasino roulette onlinebet casinomobile across her was old them even inside straight 1951 his food guess these send magical half way house funding watch only road that growing around bet five dollars shoot dead lyrics was fulfilled does not between loyalty fast car speedway uses mat and clumsy air blew appears bet call gambling online was disappoint own type bit late pai gow tiles software lest you would now really stupid true odds assume her were dark arrow fell words per minute online test remember what long and olph inside what are the odds at roulette raco with with nothing assume grotesque king kutter rakes biting his raco over roar with poker run rides in creston wv little boy their bows ristran was calculating true poker odds their mouths tramarital affairs raiding the two pairs of pants jaws closed job was another reason keno don rosa only were gizzard was illie had red puppy coon dogs clothing was little garden delicate feminine news technology vig wired 20 sparkling iridescent with packed trees arch become a gaming machine engineer and planned olph resumed fight free centry twenty-one realestate ragon who the mouthpiece arrogant big free royal flush pictures continue under zones.