Latest tweets:
  • ははははははwww http://bit.ly/aChFkU 3 days ago
  • wanna take a nap so bad... 4 days ago
  • Il peut arreter de s'amuser a regler le volume de son Mac, l'autre tanche a l'autre bout du labo ? Thx 4 days ago
  • More updates...
 

2009年11月21日

The Hitchhiker’s Guide to Twitter: For friends to understand, become interested, and tweet seriously

Filed under: IT, No-life, Toile — Rollabunna @ 9:27 pm

Warning: No making huge bling-bling money with Twitter in this post.

Please note that this work is based on my personal experience. I do not pretend to synthesize a complete and exhaustive analysis about Twitter, neither do I know the perfect tools or ways of using it. If I come up with something new, I may update this post or write new ones about the subject.

Let’s get to the topic. With so many people in my living environment not getting the point about Twitter, I thought some explanations could be useful. You can RT this post if you like, or share it with friends who are in the same “what the frak?” situation you were maybe in when you began tweeting.

Everything I state in this post has a good chance to look obvious to most people who already tweet a lot. They may not learn much from it.

I think that a more community oriented approach is likely to explain things better than the usual bling-bling business oriented approach you can find on many How to begin Twitter tutorials. Nonetheless, I will explain the common business approach as well, just so that you can understand some patterns. Also, though I review the three basic sacred commands in a further section, this Guide is not meant to teach you how to use the interface or actually tweet. Twitter’s documentation exists for that purpose.

In this beginner’s manual –so to speak-, I’ll assume that you have already registered on Twitter, and are at least familiar to the concepts of following, followers, and Home timeline.

A giant chatbloarg

I’ll explain here what I think Twitter actually is.

I’ve been using Twitter for more than a year now, but I only started tweeting seriously some two months ago, when my labmates started kicking into the Home timeline. Seriously means tweeting more than just once a day; in my case it’s an average of ten-fifteen times a day.

I qualify Twitter as a giant chatbloarg – it’s a random term I made up for a tool that is located between a chat, a blog, and a message board system. Which accurately defines Twitter in my sense. Here is why:

  • I use it as a non-synchronized chat with my friends
  • I use it as a microblog –Twitter’s original purpose- for my uninteresting personal opinions and sometimes tweet impulsively when I’m pissed
  • I use it in replacement of a message board with my labmates, discussing on topics ranging from IT to totally random

The term looks kind of messy, and Twitter is indeed some blurry mix of these three tools. “bloarg” would suggest some kind of vomiting, which is what people usually do on Twitter: they vomit lines and lines about their lives or their passion. Way more than they do on Facebook, which is the point I want to get to. It’s also kind of close to the feeling you get from nasty yet funny aliens in Douglas Adams’ Hitch Hiker Guide to the Galaxy, which as you can see I’ve named this post after.

I don’t think the term microblogging service fits in anymore. After all, software and tools are what people make use of them.

Using Twitter can be very interesting for many reasons people don’t see at first, here’s my five point summary:

  • It’s simple and empathizing: you need only use one tool, not three
  • It’s good for your ego (difficult to deny)
  • It’s an easy way to keep and monitor an audience
  • It’s a powerful tool for analyzing trends and markets
  • It can be very profitable

I won’t enter much more detail, but you can use it in tons of ways, for example in replacement for an RSS feeds aggregator.

Starting with a micro-community

This is the community way of starting to tweet, as opposed to the business way I’ll describe later.

As I recounted above, I only started tweeting seriously when my labmates started tweeting for real as well. I am in no way telling you this is the absolute method to get the motivation to tweet. I am only remembering how I really started tweeting.

I think 5 or 6 of those community people are enough to start feeling involved, but they need to share the two following common points:

  1. They must be part of the same community, i.e coworkers, labmates, classmates, Internet community mates, friends that mutually share bonds or at least know each other
  2. They must tweet seriously, that means more than twice a day for a good starting point; people that just copypaste their Facebook statuses once every three days are not going to motivate you to tweet, let alone watch your Home timeline regularly

You can also make this community aware of itself -which will motivate them more- by creating a list following every member involved. Lists are a really nice Twitter feature.

In short, it’s that kind of shared blog ability that I liked. I then expanded my timeline to a second micro-community, made mostly of Internet buddies I know from the websites and communities I built long ago.

You can see many sites and blogs pop like mushrooms, where the main author usually has his own Twitter account, and many of his readers following him on it. It’s usually very easy for bloggers or “famous community people” to get and stay motivated about Twitter. They have their own micro-community from the start.

Differences with Facebook

A question heard so many times. I won’t try to answer in terms of concept or social media babbling. Nobody would understand the point nor care. What I can tell from my short experience is:

You can’t annoy people as much with Facebook statuses than you’d do with tweets. If you do so, FB friends are just going to have you deleted from their news feed. I personally don’t like when people share 50 videos a day as if they were on Friendfeed (or say, Twitter), as if you had time to watch all of them.

Of course, if you’re too annoying on Twitter, people will just stop following you. But they’re generally more tolerant than if you were to do that on Facebook.

Then, maybe it’s only me and my FB friends, but people there aren’t very keen on writing about work or geeky subjects; Twitter comes in very handy to share and discuss about your preferred topics, or serious stuff. Moreover, you can get to know and follow very interesting people you didn’t even know existed, by learning about them in retweets from your friends.

That’s about the only differences it makes for me, yet they are big. FB also has its own advantages compared to Twitter.

Starting it “the business way”

This one is difficult to sum up. I wrote longer than intended, but it could be nice if you get a general understanding of what actually surrounds you in Twitter.

When I say business, I do not necessarily mean money. Let me state an example. Let’s assume you start a website, and you want it to become popular. Even if you don’t care about generating revenue, you still want it to be popular.

You’ll set up a Twitter account, and look for followers so that:

  • They see, and possibly RT your tweets or feeds, sending people to the site
  • You can –if you need revenue- monetize this amount of followers using tools such as Twittad, by setting up an advertiser’s image as your profile background, tweeting automatically some ads between your real tweets, …

This is why half of the time, your new followers are just random bots or people that caught you on some keyword, and added you just so that you notice them. If your Twitter page is public, that is. They either expect:

  1. To be followed in return (for monetizing or popularity)
  2. Just to be noticed, which is enough to raise brand awareness
  3. Neither one of the two, so long as you do not block them

The point in case 3 is that some will start following you because you tweeted some keyword that relates to them in some way. Once they follow you, they’re likely to use data from all your tweeting history and future tweets. Say, for example, harvest every keyword they can with natural language processors, in order to sharpen their general audience’s profile. It’s up to you if you’re against that or not. If you are, just be aware and block them. Or make your Twitter profile private.

As stated before, some are automated robots, and some are people like you who want their business, blog, website or whatever to become popular, even profitable.

Some followers are nastier: they act as spammers, and you’ll notice them very quickly. The only thing they tweet are generally ads, or even porn links. You can block and report them with the Report spam command when you check their profile. Luckily they won’t do any direct harm, unless you decide to follow them (which will result in having their spam shown in your Home timeline).

There is much to be written about what can be done with Twitter the business way. This is only a quick summary.

Sacred commands

I’ll define here some commands and tools I’ve been using, so that you can understand what I’m talking about. As for the commands, everyone uses them, so you’d better remember them early.

Please note that I’ll explain each command in the way I personally understand them. I tend to search for a broader meaning to each one of them.

@: relate/tag people

@mast_jp Dude, you eat too much ramen.

Probably the most important, it relates your tweet to some other Twitter account. It doesn’t necessarily mean that you’re addressing someone or directing the tweet to an account, as if you were waiting for an answer, though most people use it that way. Just that this account/person is in some way related to your tweet.

#: emphasize as keyword

Watched an episode of #Battlestar today, it rocked as usual.

Most people use it as if it were some kind of I-have-to-use-this-to-make-my-word-a-true-keyword thing. The same way an @ works, but only for terms or trends. This is true in a way that it will generate a link to a corresponding trend.

But trend followers and the trend list on Twitter itself don’t really care if you use # or not. Once trends are identified, you’re not forced to add an #, unless you want to generate a link. So I mainly use # to emphasize words. It exists to me only because you can’t use italic and bold.

RT: quote

RT @Chiboard Moe~moe~Kyun ! http://bit.ly/75eiw5 Kyurururin °3°

Recently re-featured as an integrated retweet (which I’m not a big fan of), the RT command is used to tell people that you’re quoting someone. Not necessarily sharing something, as most people think, and as Twitter engineers seem to believe it’s used for. You can indeed use it to share a tweet that you liked, but other people use it in a way of answering to people.

As for you, you eat too much DQP. RT @Rollabunna @mast_jp Dude, you eat too much ramen.

Many Japanese friends, for example, do so because they can take advantage of the character limitation. You can write much more in Kanji than in Latin alphabet, so you can use RT a lot for answering to specific tweets. Very useful.

Nice tools

On Mobile/iPhone

While many people use Twinkle or Echofon, I believe the real killer on mobiles is the Twitpic mail service. If you’re using an iPhone and suddenly have to share a pic, just take it, and mail it right away. It’s actually easier and faster than doing it with a traditional mobile Twitter app, which is usually slow to launch. Of course, it won’t allow you to monitor your timeline. In that case, I mainly use Twinkle, mostly because I’m used to it.

On Windows

Unfortunately, I’ve tried many Twitter desktop clients on Windows, and they’ve all disappointed me. So I’ll skip this part. While on Windows, I keep doing it in the browser. One dedicated window using Chrome makes it look like very light and comes in handy most of the time.

On Mac

My favorite tool is Twitterpod, which really fits in the background because of:

  • Its Command+F7 general shortcut which pops a textbox letting you tweet right away (very nice for impulsive tweets)
  • Its connectivity with the Growl interface, which notifies you of new tweets in a cool and fashionable Mac way, without being obtrusive

My labmates use Yorufukurou –literally “Night Howl”-, a Japanese client I didn’t test yet. From what I’ve seen most people  in the lab use it, which means it must be worth of interest.

2009年04月10日

My new desk \(^o^)/ 新たな席

Filed under: No-life — Rollabunna @ 5:41 pm

春になってNに聞いたら隣になっていいって言われたから,Nの横に移動しました!
ちょっと邪魔な棚を青い壁から外したり,スペースを少し広げたりしたら,こうなりました!かなり広いと思います.それから,一週間がたっただけで大分汚くなったけども,まあそれは無視して頂きますw
日当りのいい場所で,窓を開けたら涼しくなるんで結構楽ですね.
これから一生懸命研究をして行きます!

When we entered spring, I asked N. if it was ok to move next to him, and he was ok, so I did! After separating the shelf, which was quite annoying, from the blue wall, and widening the place a little, it became like this. Quite large, isn’t it? Well, after only one week, it became quite dirty and messy, but I’ll have you ignore that if you please :D
The place is kind of well exposed to the sunlight, and we can enjoy a nice breeze when we open the window, so it’s quite comfortable.
From now on I’m going to study like crazy!

2008年12月15日

How do I get my hands on Change.gov’s iPhone app?

Filed under: No-life, Toile — Rollabunna @ 11:41 am

Since this is not so self-evident that change.gov’s iPhone “app” is not an actual application but an iPhone version of Obama’s website (you can’t find it on the App store), and since few sites actually provide you with the link to go there, here it is:

Save the world! (if you think you can)

Yoroshiku.

On matters of personal life, it appears really hard to find a romantic place on Nagoya for Christmas eve.

2008年11月05日

iPhone使い過ぎ?

Filed under: Journal onirique, No-life — Rollabunna @ 3:39 am

Yesterday, or the night before to be more precise, I remember dreaming about Steve Jobs introducing the iPhone publicly. I had never seen the guy’s face before, but when I went to check out the actual iPhone introduction videos on Youtube, Apple’s CEO had exactly the same face I gave him in my sleep. Half-bald, thin, tall and wearing glasses, 40 or 50 years old. Is it just a coincidence, or have I become able to guess someone’s appearance just by hearing about them without actually having seen them before?

昨日か一昨日にsteve jobsがiphoneを紹介している夢を見ました。今までにあの人の顔を見たことなかったのに、Youtubeに行ってiPhoneの登場動画を観たときに、Appleの社長は夢で見たのと同じ顔だった。半分の禿、細身、背が高くて眼鏡をかけた。あれは、ただの偶然でしょうか、それとも、人を見たことなくてもその人のことを聞いたまま普通に顔を言い当てるようになりましたか?

2008年11月04日

First iPhone post omg

Filed under: No-life, Toile — Rollabunna @ 2:45 pm

First of all, I have to tell that from now on all my blog posts will be written in English. Several reasons for that decision:

- A bunch of my posts (if not all) will be written from my iPhone, and the French IME is like crap on the iPhone OS, so it’s not worth the trouble. I like writing good French, at least when posting articles.

- I want my Japanese friends to be able to read this blog. I could as well write in Japanese (and I will do so if I feel that my English is becoming difficult to understand at some point), but on the other hand it would become impossible for French visitors to read. So English is the right choice here. その上で英語の読む練習をさせてあげてもよろしいでしょ。

- Last but not least, recently I am only speaking Japanese (although I still dream in French for the most part of it), and I feel as if my English skills were slowly slipping away. Asides from a Spanish friend I met here at Nagoya Institute of Technology, I don’t speak English at all. I don’t get around with international exchange students much, only with Japanese people, so in the end I don’t get to practice English. Which is not good. I don’t want to trade English for Japanese, so posting in English on my blog will allow me to train my father’s native language a little.

That being said, let’s get down to business. I’ve been thinking about writing posts from my iPhone ever since I downloaded the Wordpress application for iPhone. After fixing our FreeBSD server - whose qmail queue was crammed with spam, acting as an open-relay and flooding /var to the point of no inodes being left, *sigh* - I finally upgraded the wordpress script so that the xmlrpc would become usable by that iPhone implementation of Wordpress.

And I must say I’m quite satisfied. The categories management feature is even better than the one I was using long ago with Drivel, that shitty good-for-nothing open source app for blogging. Well, since the Wordpress for iPhone app is - as the name states - dedicated to Wordpress, it’s obvious that it has to be working better than Drivel, but whatever. I like bitching on open source crap.

The next thing will be to try and upload a picture from the iPhone cam library; I’ve been reading in some comments on the App Store that one of this app’s flaws has something to do with picture formatting. Whatever, let’s see if that’s to be taken for granted or not :)

So here’s a pic of the kinda things we do during the meetings in our lab. Ok, I have to say that it was a 飲み会 meeting; in other words, it’s like that only on special occasions, and this time it was for our little iPhone contest: alcohol and the like were allowed. Let’s make that precision in case my sensei ends up reading that blog someday. The lab is a serious place. I’m not even sure if I’m allowed to post that pic here, people here being very picky about privacy. Well, I’ll ask and see. If it’s not possible I’ll just delete the pic right away.

So here’s our architectural masterpiece: Pisa tower, cocktail remix3d.

2008年05月13日

Migration FreeBSD - troll gratuit & n00bisme

Filed under: No-life — Rollabunna @ 4:15 am

Haha, même dans le titre je peux faire de l’humour. Je m’aime.

Bref.

Je pensais que ça pouvait être intéressant de suivre une migration sous FreeBSD, d’une part parce que c’est assez peu banal, d’autre part parce que le niveau de difficulté me force un peu à garder une trace écrite. Juste dans le cas où tout merderait.

Étant équipé d’un assez bon ouvrage, d’une collection recommandée par un ancien geek de #ecchi, je pars donc à l’aventure avec mon baluchon.

Première difficulté, le partitionnement. Celui de notre hébergeur est, par défaut, à chier. À savoir : / (3 Go) et /home (180 Go). Hum. Non seulement c’est à chier niveau optimisation du partitionnement pour un serveur, mais c’est en plus tout simplement dangereux. Parce que s’il y a trop de softs dans /usr, ou plus simplement trop de logs dans /var, ou encore plus simplement trop de connards qui écrivent dans /tmp, on a une racine saturée tout de suite. Le système pourrait encore - avec de la chance - démarrer avec une racine saturée, mais quid de tout ce qui a besoin de place dynamiquement ailleurs que dans /home ? Quid des sessions et autres saloperies à écrire dans /tmp par les scripts à la noix qui ne savent pas se faire un répertoire de sessions perso ? Je pourrais symlink ces répertoires et les mettre dans /home, soit, mais non pas trop en fait. C’est moyennement propre, et si le système de partitionnement existe, autant s’en servir.

Donc voilà, quand l’hébergeur met 1/5 en facilité pour l’utilisation d’un OS, il pourrait aussi éventuellement s’arranger pour NE PAS mettre des batons dans les roues aux gens qui choisissent cet OS, en leur filant la conf de base la plus pourrave possible. Et le partitionnement, c’est la conf de base de chez base chez tous les serveurs. Roberto, il va me répondre “oui mais blablabla tu sais, c’est la politique Freebou que rien ne soit conf, blablabla, tu dois avoir le contrôle de ton OS blablabla”. Oui, mais. Tout serveur un tant soit peu bien foutu a ce partitionnement de base / /usr /var /tmp /home, ou en tout cas pas une racine et un /home, avec une racine prête à péter au moindre log ou à la moindre écriture de session. Faut pas charrier non plus, ça veut dire que le mec qui veut découvrir se fait vraiment péter la rondelle s’il fait pas gaffe à TOUT. Ou même, un mec qui utilise FreeBSD mais pas en serveur, en desktop par exemple (ok c’est plutôt rare), s’il a pas la présence d’esprit de partitionner, ou l’expérience serveur qui lui dira “oublie pas de vérifier ça” ?

Et de toute façon Roberto, sur l’ancien serveur Gentoo, y’avait pas mal de trucs fuyeux dans le genre. Alors que la facilité d’utilisation est à 5/5. On filait quand même un webmin avec le machin, ce qui se traduit par “destiné aux n00bs”. La durée de vie du serveur Gentoo “as is”, sans modifier la conf hors Webmin, je l’ai estimée à un an - date à laquelle les galères avaient commencé.

Donc, la première chose que j’ai faite pour pallier à cette pré-conf de merde, c’est de reboot le serveur en mode rescue, pour pouvoir refaire le partitionnement. Un reboot en rescue alors que le serveur vient d’être livré et n’accueille pas encore les sites, c’est encourageant. Enfin, le terme en tout cas.

Après avoir un peu galéré, sysinstall ne terminant visiblement pas ses newfs lorsqu’un partitionnement part en couile (à savoir : un mount mal fichu sur un répertoire inexistant), j’ai mes belles partitions.

  • / a 3Go, ce qui suffit amplement (surtout, j’avais pas envie de payer mon reinstall)
  • /tmp a 3Go, et ça devrait être laaaargement assez
  • /usr en a 20, simplement par prudence
  • /var en a 20 aussi, pas par prudence mais par expérience : on génère énormément de logs bien lourds, notamment à cause de Planète-Sonic
  • /home a tout le reste, donc un bons tas de Go

Ensuite, je m’ouvre également un Google Doc pour noter toutes les petites feintes et les choses importantes du bouquin. Tu comprends Roberto, ce genre de truc je le fais rarement, mais là j’ai vraiment pas envie de buter sur le même problème deux fois. Les couilles sous Unix, d’expérience, c’est nettement plus à payer son pivert sur le mur que d’autres genres de couilles. D’ailleurs on pourrait graduer, en échelle de “ce qui est capable de faire le plus chier” :

  • Problème sous Windows = les racailles
  • Problème de programmation = les chats
  • Problème sous Linux = les femmes
  • Problème sous BSD = mes ex

Dans ces derniers, on notera par exemple ceci : Freebou ne faisant que “proposer des fichiers de conf”, ne les mettant pas en service, il manquait bien entendu le fichier de conf de vim. Or, si vim n’est pas configuré, il fait de la merde avec les terminaux. Ca veut donc dire :

  • Si t’as pas de .vimrc dans ton home, alors tu l’as sec, parce que ton curseur va tripper très chelou.
  • Ceci fait, si t’utilises pas en fait le fichier de conf d’exemple, alors tu l’as très sec, car je déciderai que tu ne peux utiliser backspace que sur le texte que tu viens de taper. [Edit: Après avoir regardé un peu, il s'avère que c'est le comportement basique de vi (sans m), proprement gerbant quoi.]
  • <Interlude> Oui, c’est à se choubler </Interlude>
  • Ok, il reste à trouver où on met le fichier de conf général. Faisons comme personne ne fait : pas dans /etc (Freebou oblige, soit), mais pas non plus dans /usr/local/etc. Où donc alors ? Dans /usr/local/share/vim, bien sûr !
  • Agngngngn.

Ceci étant fait, il ne m’est pas permis d’utiliser sshfs pour transférer toutes les données (sites etc) depuis l’ancien serveur. Je sais Roberto, y’a scp pour ça, qui est installé par défaut. Ouais mais scp, il connaît le maintien des modes dans le transfert, mais pas celui des informations de propriétaire. Donc voilà. Et puis c’est tellement simple sshfs. Les nuls aiment les choses simples.

L’ayant installé par un package, et non en utilisant le ports tree, j’ai eu la mauvaise idée de prendre un package destiné à FreeBSD 7.0, alors que l’hébergeur fournit FreeBSD 6.2. Par conséquent, ça link partout sur des librairies .so.7, au lieu de librairies .so.6 ou inférieur. Et du coup ! Soit je reprends pour de la 6.2, soit je MaJ en 7.0. Donc après avoir fuifuité deux ou trois libs en mettant des symlinks (oui c’est très safe !), comme ça ne fonctionne toujours pas, go upgrade 7.0. Miam.

2007年08月26日

Serveur samba en 10 minutes

Filed under: No-life — Rollabunna @ 7:28 am

Serveur samba

Le client Samba permet de profiter des shares ou “dossiers partagés” d’un réseau Windows, tout en restant soi-même sous Unix. De la même façon, le serveur Samba permet, à partir d’un système Unix, de partager des shares qui seront reconnues par des ordinateurs Windows dans le LAN.

Téléchargement :

3 possibilités :

- Mode branlos : Passer par un gestionnaire graphique de paquets comme Synaptic : rechercher “samba” et installer le multi-paquets principal “samba”

- ou Passer par aptitude en console

(sudo) apt-get update
(sudo) apt-get install samba

(sous gentoo : )

emerge net-fs/samba

- ou Attraper une tarball sur le site officiel et se compiler ça à la patte

tar -xvf mes_sources.tar.gz
cd mes_sources
./configure
make
(sudo) make install

Dans le dernier cas de figure, assurez-vous d’avoir toutes les dépendances requises par samba en sources.

Lancement :

/etc/init.d/samba start

En principe, lors de l’installation, samba est ajouté aux processus lancés selon le runlevel de votre ordi (comprenez : au démarrage). Vous pouvez le vérifier avec ceci :

locate samba | grep /etc/rc

Ce qui vous donne théoriquement une sortie ressemblant à ça :

/etc/rc0.d/K19samba
/etc/rc1.d/K19samba
/etc/rc2.d/S20samba
/etc/rc3.d/S20samba
/etc/rc4.d/S20samba
/etc/rc5.d/S20samba
/etc/rc6.d/K19samba

Si locate part en cou*lle, n’oubliez pas sudo updatedb.

Pour relancer : (on s’en sert plus loin)

/etc/init.d/samba restart

Configuration :

Avant tout, on crée un utilisateur samba, quelqu’un (un login/pass) qui pourra se logger sur les shares qu’on partagera au sein du réseau. Créez en un avec le même login et pass qu’un utilisateur Unix déjà existant sur la machine.

smbpasswd

Ensuite, on édite le fichier de config :

(sudo) vim /etc/samba/smb.conf

Je recommande les lignes suivantes :

# “Workgroup” de destination : habituellement “Mshome” ou quelque chose dans le genre, sauf si vous souhaitez faire un workgroup à part
workgroup = Mshome
# Alias de l’ordinateur sur le réseau
server string = Nom_de_mon_PC
# Nécessite d’avoir un compte Unix sur la machine serveur (la nôtre en l’occurrence)
security = user

# Exemple de répertoire à mettre en share
[nom_de_la_share]
path = /chemin/vers/le/répertoire/sur/notre/serveur
available = yes
browseable = yes
public = yes
writable = yes

N’oubliez pas de relancer le serveur samba pour appliquer la configuration.

Voilà ! En 10 minutes, un répertoire Unix a été partagé sur le réseau Windows :)

2007年06月15日

Un espace perso pratique sans utiliser ftp

Filed under: No-life — Rollabunna @ 11:41 pm

2 petits scripts que j’ai faits tout à l’heure en me faisant chier à l’école, qui permettent respectivement d’uploader des fichiers dans un répertoire web et de mettre à jour une liste mémo (sans passer par une base de données).

Dans un répertoire ouvert depuis le web, donc sans fichier index.*, et éventuellement protégé par une authentification .htaccess + .htpasswd (mieux), mettez les scripts suivants :

Upload.php :

On veut pouvoir uploader des fichiers tranquillement dans le même répertoire que le script. Lorsque l’upload réussit, le script vous invite à retourner à la racine.

<a href=”./” mce_href=”./”>Revenir</a><br /><br />

<?php

isset($_FILES['fichier'])
&& !ereg(”^(.*php[0-9]?|\..*)$”, $_FILES['fichier']['name'])
&& !$_FILES['fichier']['error']
&&
move_uploaded_file($_FILES['fichier']['tmp_name'], ‘./’.$_FILES['fichier']['name'])
&& printf(’Fichier publié dans la <a href=”./” mce_href=”./”>racine</a><br />’);

?>

<form action=”" method=”POST” enctype=”multipart/form-data”>
<input type=”file” name=”fichier” />
<input type=”submit” />

Oui, j’aime beaucoup le chaînage de fonctions bien crado façon bash script. C’est du codé en 5 minutes les doigts de pied dans l’oreille, hein ~~

- En principe vous n’avez pas à vous farcir la vérification des droits d’écriture, mais si vous avez des problèmes d’upload, essayez de changer les droits du répertoire en 777
- Vous aurez noté la petite protection contre l’upload de scripts php avec ereg : c’est minimal, pensez quand même à protéger le répertoire avec une authentification .htaccess + .htpasswd
- Important à savoir : un fichier uploadé avec le même nom qu’un fichier déjà présent dans le répertoire écrasera l’ancien

Memowrite.php :

Ici, on met à jour un petit fichier texte en ajoutant une nouvelle ligne au début de ce dernier. Pour ce genre de petit mémo, nul besoin d’une base de données sql.

<a href=”./” mce_href=”./”>Revenir</a><br /><br />

<?php

$content = “”;

if( isset($HTTP_POST_VARS['texte'])
&& !empty($HTTP_POST_VARS['texte'])
&& ($handle = fopen(”memo.txt”, ‘r+’)) )
{
$content = filesize(”memo.txt”) ? fread($handle,filesize(”memo.txt”)) : “”;
rewind($handle);
fwrite($handle, $HTTP_POST_VARS['texte'].”\n”.$content);
fclose($handle) && printf(’Texte ajouté<br />’);
}

?>

<form action=”" method=”POST”>
<input type=”text” size=”50″ name=”texte” />
<input type=”submit” />
</form>

<?php

if(filesize(”memo.txt”) + strlen($HTTP_POST_VARS['texte']) && $handle = fopen(”memo.txt”,’r'))
{
$content = fread($handle,strlen($HTTP_POST_VARS['texte']) + filesize(”memo.txt”));
echo nl2br(htmlentities($content));
fclose($handle);
}

?>

- Pour qu’il fonctionne, n’oubliez pas d’uploader un fichier memo.txt dans le même répertoire, par exemple en utilisant Upload.php
- Pour effacer son contenu, uploadez un nouveau memo.txt vide
- Les attaques de type XSS (cross-site scripting) ne marcheront pas puisqu’on a utilisé htmlentities()

2007年04月09日

St-Valentin

Filed under: No-life, Toile — Rollabunna @ 1:29 am

Clip à réserver à un public averti (si votre culture n’intègre pas bangbus ou nintendo, passez votre chemin). Y’a ceux comme Kamini qui le font dans un décalé bon enfant, et ceux qui le font dans un décalé un peu plus trash, mais toujours représentatif d’un certain état d’esprit :D

Spread internet culture through music !

Viens bébé on va tester mes nouvelles MST \o/

2006年11月03日

Grosse peur, petits tracas

Filed under: No-life, Yet to be filed — Rollabunna @ 5:17 am

Décidément, ma grosse machine aura décidé de me faire chier ces deux dernières semaines. Dernier problème survenu : mon disque archive de 40 Go en FAT32 (fs qui reste utile car inscriptible par la majorité des OS) décide de jouer à une partie de cache-cache. Enfin, pas lui, mais son contenu. Résultat : du jour au lendemain, le volume n’est plus reconnu par Linux ni Windows, et se voit considéré comme espace non alloué. Ce disque contenant tout de même des choses plus qu’importantes (travail sur les sites web, dessins d’art perso…).

Idiot mais débrouillard et surtout plus gland que jamais, je décide quand même qu’il sera plus simple de récupérer l’intégralité de mes données que de recommencer plus de trois ans de travail à zéro. Etant donné que quand on supprime un fichier (ou même tous), que l’on formate un disque, ou même que l’on fait le clown avec ses partitions, les données restent. Elles restent jusqu’à être écrasées de nouveau. L’OS efface simplement l’index du fichier (ou la table dans le cas du disque entier), il ne s’emmerde pas à “blanchir” vos secteurs. Surtout un OS feignasse comme Windows.

La plupart des outils de récupération de disque iront sonder la structure du disque pour retrouver vos fichiers à l’arrache dans les différents clusters. Il faudra les enregistrer un par un sur un autre disque, etc. Long. Voire éprouvant, si vous avez beaucoup de données précieuses à récupérer. Et, en sus des données essentielles que j’ai évoquées ci-dessus, j’avais surtout une formidable archive hentai à sauver. On est motivé ou on ne l’est pas. Ouais, mais on est aussi feignasse.

On se met donc à penser qu’il sera plus simple de réparer la table de partitions, le secteur boot du disque. Comme ça, on ne s’emmerde pas à jouer au puzzle avec des données récup à l’arrache. C’est comme redessiner la carte de son jardin (désolé pour la métaphore débile).

Voilà donc l’objectif de ce post : décerner une petite palme à Testdisk, qui permet d’effectuer ces opérations sans se prendre les bur—.

http://www.cgsecurity.org/

La feignasse a récupéré l’intégralité son disque formaté, non reconnu, non alloué (etc, ça dépendait de l’OS) sans se faire chier, en 3 secondes. Elle peut donc s’astiquer le 21e doigt sur l’un des doujins dudit disque pour se féliciter. Les oiseaux chantent, les criquets aussi.

Next Page »