22 AOÛ 10

Debian Lenny from scratch

Activer SSH pour s'identifier depuis une console externe

apt-get install ssh
/etc/init.d/ssh start

Lancer SSH au boot

Faire attention au runlevel courant (commande runlevel)

Pour un runlevel 2
cd /etc/rc2.d
ln -s ../init.d/ssh S20ssh

Activer les couleurs dans le terminal et sécuriser quelques commandes (rm, cp, mv)

Editer le fichier ~/.bashc,
et enlever les commentaires devant les lignes.

#export PS1='h:w$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'

#
# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

Installer Apache2 / PHP5 / MySQL

En premier installer apache et ses copains

aptitude install apache2 apache2.2-common 
apache2-mpm-prefork apache2-utils libexpat1 ssl-cert phpmyadmin

Modifier le fichier de config d'apache et rajouter a la fin.
Pour phpMyAdmin passer le server[0]['auth_type'] = 'http'. 

ServerName myserver

Rebooter apache

/etc/init.d/apache2 restart

ou

apache2ctl graceful

Installer PHP5

aptitude install libapache2-mod-php5 php5 php5-common php5-cgi

puis

aptitude install 
php5-curl 
php5-dev 
php5-gd 
php5-gpib 
php5-imagick 
php5-mcrypt 
php5-memcache 
php5-mhash 
php5-mysql 
php5-pspell 
php5-snmp 
php5-sqlite 
php5-xmlrpc 
php5-xsl 
php5-xsl 
php5-imap 
php5-json 
php5-suhosin 
php5-tidy 
php5-ffmpeg

Pour MySQL

apt-get install mysql-server mysql-client

Le Terminal vous demande de taper le mot de passe root et de le confirmer.

Installer proFTPd

Installation du support MySQL pour avoir des virtual user

apt-get install proftpd-mod-mysql

et pour être sur

apt-get install proftpd

/etc/proftpd/modules.conf

[...]
# Install proftpd-mod-mysql or proftpd-mod-pgsql to use this
LoadModule mod_sql.c
[...]
# Install proftpd-mod-mysql to use this
LoadModule mod_sql_mysql.c
[...]

/etc/proftpd/proftpd.conf

[...]
#
#QuotaEngine off
#
[...]
#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
Include /etc/proftpd/sql.conf
[...]

/etc/proftpd/sql.conf

#
# Proftpd sample configuration for SQL-based authentication.
#
# (This is not to be used if you prefer a PAM-based SQL authentication)
#

DefaultRoot			~
SQLBackend			mysql
# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes		Plaintext Crypt
SQLAuthenticate		users

# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo  ftp@localhost proftpd password

# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo     users userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db                 
SQLGroupInfo    group groupname gid members

# set min UID and GID - otherwise these are 999 each
SQLMinID        500

# create a user's home directory on demand if it doesn't exist
CreateHome on

# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" users

# Update modified everytime user uploads or deletes a file
SQLLog  STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" users

RootLogin off
RequireValidShell off

# Gestion des logs
# SQLLogFile /var/log/proftpd/mysql.log
SQLLog RETR,STOR,DELE,MKD,QUIT insertfileinfo
SQLNamedQuery insertfileinfo INSERT "'%a', '%m', '%f', %b, '%u', now(), '%T'" history
CREATE DATABASE ftp;
GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO 'proftpd'@'localhost' 
IDENTIFIED BY 'password'; GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO 'proftpd'@'localhost.localdomain'
IDENTIFIED BY 'password'; FLUSH PRIVILEGES; CREATE TABLE IF NOT EXISTS `history` ( `ip` varchar(20) NOT NULL, `cmd` varchar(8) NOT NULL, `file` mediumtext NOT NULL, `bytes` bigint(20) NOT NULL, `user` varchar(90) NOT NULL, `date` datetime NOT NULL, `during` bigint(20) NOT NULL, KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL auto_increment, `userid` varchar(32) NOT NULL default '', `passwd` varchar(32) NOT NULL default '', `uid` smallint(6) NOT NULL default '5500', `gid` smallint(6) NOT NULL default '5500', `homedir` varchar(255) NOT NULL default '', `shell` varchar(16) NOT NULL default '/sbin/nologin', `count` int(11) NOT NULL default '0', `accessed` datetime NOT NULL default '0000-00-00 00:00:00', `modified` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `userid` (`userid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ProFTP user table' INSERT INTO `users` (`id`, `userid`, `passwd`, `uid`, `gid`, `homedir`, `shell`, `count`, `accessed`, `modified`) VALUES (1, 'exampleuser', 'H2bsBYfhWWSgE', 1000, 1000, '/home/ben/ftp', '/sbin/nologin', 0, '', '');

Il est important que les UID/GID notés dans la base "users" soient des valeurs qui existent dans /etc/passwd et /etc/group pour que proFTPd puissent créer des elements et les partager avec le "vrai" user UNIX (celui a qui correspond le UID).

Dans le cadre d'un serveur de stockage uniquement alors il faut mieux utiliser une table "groups".
Suivre ce tutorial pour le détail

20 AOÛ 10

Youtube - 10 astuces a savoir sur les URLs

De l'anglais facile à comprendre.

 

Youtube – You know that site with videos and all. Yeah! It turns out that its quite popular and you happen to visit and use it quite often. Instead of just searching and playing here are some top Youtube URL tricks that you should know about:

 

1. View high quality videos
Youtube gives you the option to switch to high quality videos for some of the videos, however you can check if a video is available in high quality format by appending ‘&fmt=18′(stereo, 480 x 270 resolution) or ‘&fmt=22′(stereo, 1280 x 720 resolution) for even higher quality.


2. Embed Higher Quality Videos
While the above trick works for playback, if however you want to embed hig quality videos you need to append “&ap=%2526fmt%3D18″ and “&ap=%2526fmt%3D22″ to the embed url.


3. Cut the chase and link to the interesting part
Linking to a video where the real action starts at 3 minutes 22 seconds, wondered if you could make it start at 03:22? You are in luck. All you have to do is add #t=03m22s (#t=XXmYYs for XX mins and YY seconds) to the end of the URL.


4. Hide the search box
The search box appears when you hover over an embedded video. To hide the search box add ‘&showsearch=0′ to the embed url.


5. Embed only a part of Video
Just append ‘&start=30′ to skip first 30s of the video. In general you can modify the value after start= to the number of seconds you want to skip the video for.


6. Autoplay an embedded video
Normally when you embed a Youtube video and load the page, the player is loaded and it sits there waiting for you to hit the play button. You can make the video play automatically by adding ‘&autoplay=1′ to the url part of the embed code.


7. Loop an embedded video
Append ‘&loop=1′ to make the video start again without user intervention after it reaches the end.


8. Disable Related Videos
Publishing your content in the form of Youtube video? Don’t want people to see other people’s content that may be related but may as well be in competition to you? Just add ‘&rel=0′ to the end of the url part of the embed code and you just turned off the related video suggestions!


9. Bypass Youtube Regional Filtering
Some videos are only available in certain parts of the world. Your IP Address is used to determine your location and then allow or deny access to the video. Change the url from http://www.youtube.com/watch?v= to http://www.youtube.com/v/


10. Download Video
Although not inherently a youtube trick but useful all the same for downloading videos. Just change youtube to kickyoutube in the url of the video and it will take you to kickyoutube.com with all the options for downloading the video you were watching.

 

Source : www.makeuseof.com

20 AOÛ 10

Life @ 1000 fps

19 AOÛ 10

Phantom Camera

19 AOÛ 10

Old time

19 AOÛ 10

Par la fenêtre

19 AOÛ 10

Bamboo light

13 AVR 10

Remplacer crontab par iCal sous OS X

Tout ceux qui ont déjà touché à un serveur sous Linux savent comment lancer un script avec cron... sur Mac OS X, avant 10.4 c'était aussi simple, maintenant, disons qu'il faut avoir la foi !

Pourtant, tous les outils nécessaires sont déjà inclus dans Mac OS X en standard et sans avoir à taper une ligne de code... mais le command-line style masque la simplification de cette solution.

Le principe sous Mac OS X reste identique : le script en lui même est lancé via Automator, le déclenchement est lancé par iCal.

Utiliser Automator pour créer un executable-alarme
qui sera lancé avec iCal, c'est aussi simple que ça.

Première étape, lancer Automator qui se trouve dans le dossier /Application et commencer un nouveau processus Personnalisé.

Construisez votre processus en glissant les éléments de la gauche vers la droite. Dans cet exemple, le script commence par prononcer "Backup in progess" avec la voix d'Alex. La commande rsync est executée sous le shell /bin/sh, un mail est envoyé avec la sortie de rsync (les éléments transférés), pour finir le texte "Backup ended" est prononcé.

Une fois le script testé, pour le trasnférer à iCal : Fichier > Enregistrer comme module...

Donnez lui le nom qu'il vous plaira, en validant iCal s'ouvre avec la fenêtre d'édition de votre évenement.

Ensuite il ne vous reste plus qu'a définir les règles de répetitions, ici un cas absurde pour un script de backup : répétitions tous les 2 jours, éxecuter le script 50 fois

Encore un bon exemple de la simplicité des solutions offertes par Mac OS X. Cette solution a fonctionné pendant 2 ans sur un Mac Mini (première génération) et a permit de backuper 3 serveurs toutes les nuits pendant cette période. Depuis début 2009 nous avons changé le processus de backup, nous répliquons les données directement dans le datacenter, beaucoup plus rapide en cas de reconstruction des serveurs !

10 FÉV 10

Happy Time

02 JAN 10

2 janvier au matin

29 OCT 09

TitlShift sur iPhone & Desktop

Un ami m'a parlé d'une petite application sur iPhone qui permet de rajouter quelques effets à des photos, rien de très compliqué, mais suffisant pour donner du style à une photo qui n'en avait pas forcément.

TitlShift : derrière ce nom étrange se cache une application web, desktop et iPhone... ce qui implique que vous avez la même application sur votre iPhone, sur une page web et sur votre ordinateur (fonctionne avec Adobe AIR).

Ce petit logiciel propose quelques effets à appliquer à vos photos : flou (radial ou linéaire), saturation, contraste, luminosité et vignettage (zones sombres dans les coins).

Commençons par installer cette application sur son ordinateur pour en profiter "offline".
NOTE : Si vous ne voulez pas installer cette application, essayer la version web directement en ligne,

En premier lieu, il faut installer Adobe AIR, disponible chez Adobe. AIR est un framework (un ensemble de fonctions qui permettent de faire fonctionner un logiciel) distribué par Adobe qui permet de faire tourner des applications web comme un logiciel classique (comme ceux déjà installés sur votre ordinateur). C'est un peu comme le plug-in flash, si vous lancer un fichier .SWF le player flash va se lancer, ici c'est un peu la même chose, mais l'objectif est de faire fonctionner des applications sur votre ordinateur sans votre navigateur (ce n'est donc pas un plug-in à proprement parlé). Ce framework est assez jeune et ne connait pas encore un engouement spectaculaire, mais il existe quelques projets qui laissent rêver sur les possibilités qui s'offrent aux web developers.

 

Une fois AIR installé, récupérez l'installeur sur artandmobile.com, et lancer le fichier téléchargé.

Suivez les instructions...

Une fois l'application installée, elle se lance comme un logiciel ordinaire (on oublis que c'est du AIR derrière).

Tout commence par la sélection d'une image sur laquelle vous allez travailler.
Pour l'exemple c'est un photo de la Dune du Pyla prise l'été dernier.

Plus la photo est grosse, plus l'application à du mal à rendre les effets en temps réel, et même sur une machine moderne ça rame ! Normal AIR n'a pas vocation à faire fonctionner des remake de photoshop, mais plutôt des micros-applications simples basées sur des fonctions réseaux.
Voilà donc le résultat final.

Et ici l'image source (moins sexy)