Vue lecture

traffic surprise

Me lançant dans un fougueux ménage de mes ftps, me voila errant sur ma page perso free.
Par pur curiosité je m'en vais regarder les stats. oO !!!
une centaine de visiteur journalier en moyenne. Mais c'est énorme !!
Bon je ne sais pas si ce sont des robots, des abonnés au flux rss, ou des erreurs, mais c'est fun.
Bon le premier "visiteur" il semblerait que cela soit shaarli.fr (que je ne connaissais pas d'ailleurs)
Bref bonne surprise pour moi :)

Aller à peluche
  •  

Heu... comment dire...

Je ne viens plus souvent par ici, mais je songe a "rebooter".
Trop le bordel mon shaarli et surtout je suis pas vraiment rigoureux dans mon "taggage".
A voir...
Et puis free quoi...
  •  

Mount remote ftp directory host locally into linux filesystem

1. Installation

First install curlftpfs package. On Debian or Ubuntu it would simple as:

apt-get install curlftpfs

2. Mount ftp directory

What needs to be done next is to create a mount point:

# mkdir /mnt/my_ftp

next use curlftpfs to mount your remote ftp site. Suppose my access credentials are as follows:

   username: ftp-user
   password: ftp-pass
   host/IP: my-ftp-location.local

the actual curlftpfs mount command would be:

# curlftpfs ftp-user:
ftp-pass@my-ftp-location.local /mnt/my_ftp/

Caution:

ftp uses unencrypted passwords so anyone can intercept your password without much effort. Therefore use curlftpfs in combination with SSL certificates if your are not mounting some local LAN ftp server.

On Debian you can mount ftp using curlftpfs as a root and this allows only root user to access ftp mount. No other users are allowed since by default only users that mounts has and access to mount directory. When mounting ftp as a non-root user you may get a following error message:

fuse: failed to open /dev/fuse: Permission denied

Rather that changing permissions of /dev/fuse you can allow other users to access ftp mount directory with an curlftpfs's option allow_other. The command will look similar to the one below:

# curlftpfs -o allow_other ftp-user:
ftp-pass@my-ftp-location.local /mnt/my_ftp/

3. Mount ftp with curlftpfs using /etc/fstab

Since we do not want put any passwords to /etc/fstab file we will first create a /root/.netrc file with a ftp username and password using this format:

machine my-ftp-location.local
login ftp-user
password ftp-pass

Now change permissions of this file to 600:

# chmod 600 /root/.netrc

Check uid and gid of your non-root user. This user will have a access to ftp mount directory:

$ id

In the next step add a following line to your /etc/fstab file ( change credentials for your ftp user ):

curlftpfs#my-ftp-location.local /mnt/my_ftp fuse allow_other,uid=1000,gid=1000,umask=0022 0 0

Now mount ftp with:

mount -a
  •  

Effectuer vos sauvegardes avec Duply

Effectuer vos sauvegardes avec Duply

written on Monday, September 17, 2012

Duply est un frontal pour l’outil Duplicity, il permet d’effectuer des backups incrémental vers des serveurs de type FTP, SFTP, IMAP, Amazon S3, etc …, les sauvegardes peuvent être cryptées.

Création d’un profil

duply nom_profil create

Cette commande crée un profil dans le répertoire /root/.duply/nom_profil/

Paramétrage du profil

Nous allons modifier le profil qui comprendra 3 fichiers de configuration:

   conf: Configuration du profil
   exclude: Fichiers à exclure lors de la sauvegarde
   pre: Tâche à exécuter avant de débuter la sauvegarde

Contenu du fichier conf

GPG_PW='clef_a_definir'
TARGET='ftp://ftp.cendreo.com/duply'
TARGET_USER='user'
TARGET_PASS='userpass'
SOURCE='/'
MAX_FULL_BACKUPS=2

Contenu du fichier exclude

/bin
/boot
/dev
/lib
/lost+found
/media
/mnt
/opt
/proc
/sbin
/srv
/sys
/tmp
/usr
/var
/data/nobackup
/lib64
/run

Contenu du fichier pre

Le fichier pre est un lien symbolique sur un exécutable que l’on désire exécuter avant de lancer le backup. Nous utilisons ici le script jsl-mysqlbackup.sh qui permet d’effectuer les backups MySQL.

Planification des sauvegardes

avec la commande crontab -e nous allons ajouter les lignes suivantes pour effectuer une sauvegarde incrémentale en semaine et une complète le Samedi.

0 3 * * 0-5 duply mon_profil backup_purge_status --force
0 3 * * 6 duply nom_profil pre_full_purge-full_status --force

Vérification des sauvegardes

root@w1:~/.duply/mon_profil# duply mon_profil status
Start duply v1.5.2.3, time is 2012-09-17 19:38:40.
Using profile '/root/.duply/mon_profil'.
Using installed duplicity version 0.6.08b, gpg 1.4.10 (Home: ~/.gnupg)
Test - Encryption with passphrase (OK)
Test - Decryption with passphrase(OK)
Test - Compare Original w/ Decryption (OK)
Cleanup - Delete '/tmp/duply.18426.1347503520_*'(OK)

--- Start running command STATUS at 19:38:41.055 ---
NcFTP version is 3.2.4
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Sep 15 03:11:08 2012
Collection Status
-----------------
Connecting with backend: FTPBackend
Archive dir: /root/.cache/duplicity/duply_mon_profil

Found 1 secondary backup chain.
Secondary chain 1 of 1:
-------------------------
Chain start time: Sat Sep  8 03:10:59 2012
Chain end time: Fri Sep 14 03:11:06 2012
Number of contained backup sets: 7
Total number of contained volumes: 1904
Type of backup set:                            Time:      Num volumes:
Full         Sat Sep  8 03:10:59 2012              1768
Incremental         Sun Sep  9 03:10:49 2012                46
Incremental         Mon Sep 10 03:12:05 2012                21
Incremental         Tue Sep 11 03:11:11 2012                26
Incremental         Wed Sep 12 03:11:04 2012                14
Incremental         Thu Sep 13 03:11:04 2012                14
Incremental         Fri Sep 14 03:11:06 2012                15
-------------------------


Found primary backup chain with matching signature chain:
-------------------------
Chain start time: Sat Sep 15 03:11:08 2012
Chain end time: Mon Sep 17 03:12:16 2012
Number of contained backup sets: 3
Total number of contained volumes: 1866
Type of backup set:                            Time:      Num volumes:
Full         Sat Sep 15 03:11:08 2012              1795
Incremental         Sun Sep 16 03:11:06 2012                47
Incremental         Mon Sep 17 03:12:16 2012                24
-------------------------
No orphaned or incomplete backup sets found.
--- Finished state OK at 19:38:43.006 - Runtime 00:00:01.950 ---

Restauration # Restaure le dernier backup

duply mon_profil restore /destination_dir

# Restaure le backup effectué il y'a 4 jours

duply mon_profil restore /destination_dir 4D

# Restaure le dernier fichier rep/fichier

duply mon_profil fetch rep/fichier /destination_dir

# Restaure le fichier rep/fichier d'il y'a 4 jours

duply mon_profil fetch rep/fichier /destination_dir 4D

Note 1: Concernant la commande fetch, si vous désirez restaurer un fichier, le fichier de destination doit être également indiqué sinon le répertoire (si il est vide) sera remplacé par le fichier à restaurer. Note 2: Concernant la commande fetch, dans le cas d’un répertoire, le répertoire de destination doit être vide, sinon la restauration sera interrompu.

Ce billet est taggé avec Anti-Virus, Linux and planet-libre
  •  

Linux - Commandes - Mémento [Netensis - TechniNotes]

Archives - tar, 7z
tar

Création d'une archive :

   sans compression :

   tar -cvf CHEMIN_ARCHIVE.tar FICHIERS_ET_OU_REPERTOIRES_A_STOCKER

   avec compression gzip :

   tar -cvzf CHEMIN_ARCHIVE.tar.gz FICHIERS_ET_OU_REPERTOIRES_A_STOCKER

Lister le contenu d'une archive :

tar -tvf CHEMIN_ARCHIVE.tar
tar -tvf CHEMIN_ARCHIVE.tar.gz

Décompresser le contenu d'une archive (dans le répertoire courant) :

   archive sans compression :

   tar -xvf CHEMIN_ARCHIVE.tar

   archive avec compression gzip :

   tar -xvzf CHEMIN_ARCHIVE.tar.gz

7z

   Archive 7-Zip avec compression maximale (-mx=9 : niveau de compression de 0 = aucun à 9 = maximum, le standard est 5), contenu et entêtes chiffrés par mot de passe (-mhe=on -p) :

   7z a -ms=on -mx=9 -mhe=on -p ARCHIVE FICHIERS_ET_OU_REPERTOIRES
   
   # Exemple
   7z a -ms=on -mx=9 -mhe=on -p ~/backup/confidentiel.7z ~/Documents ~/.evolution

   Archive au format zip au lieu de 7z :

   7z a -tzip ARCHIVE.zip FICHIERS_ET_OU_REPERTOIRES
   
   # Exemple
   7z a -tzip ~/backup/images.zip ~/Images

   Chiffrer/déchiffrer du texte avec 7z (AES 256 Bits) :

   # Chiffrage
   echo -n "Texte" | 7z a -si -mx=9 -ms=on -mhe=on -pMOT_DE_PASSE ARCHIVE.7z
   
   # Déchiffrage sur la sortie standard, la redirection de stderr est obligatoire
   7z e -so -pMOT_DE_PASSE ARCHIVE.7z 2>/dev/null

tar et 7z combinés

7-Zip n'est pas adapté seul à la sauvegarde de tous les attributs des fichiers Linux. On peut combiner tar et 7-Zip (pour remplacer la compression gzip).

Création d'une archive "tar.7z" :

# "-si" compresse l'entrée standard (stdin)
tar -c FICHIERS_ET_OU_REPERTOIRES 2>/dev/null | 7z a -si OPTIONS_7Z ARCHIVE.tar.7z

Décompression d'une archive "tar.7z" :

7z x -so ARCHIVE.tar.7z | tar xf -
  •  

SSH Troubleshooting - Metawerx Java Wiki

Failed to add the host to the list of known hosts (/home/USERNAME/.ssh/known_hosts)
Connection works, but the following warning is issued

Failed to add the host to the list of known hosts (/home/USERNAME/.ssh/known_hosts)

This error occurs when:

   The user's HOME folder has incorrect permissions
   The user's HOME/.ssh folder or HOME/.ssh/known_hosts file has incorrect permissions (such as when the folder has been copied into location by root, or permissions have been manually set incorrectly)

To fix, execute these commands (as root) to reset the permissions to their correct values (replace USERNAME with the appropriate username)

cd ~
chown USERNAME /home/username
chown USERNAME -R /home/username/.ssh
chmod 700 /home/USERNAME/.ssh
chmod 600 /home/USERNAME/.ssh/*
  •  

locale configuration

edit: ça ne fonctionne plus... je ne sais pas pourquoi. mais après un  sudo dpkg-reconfigure locales  et un reboot ça a fonctionné.

Pour avoir les accents sur mon raspberry pi, avec raspbmc j'ai du faire cette manip:

add it in /etc/profile
export LANG=fr_FR.utf-8
export LC_ALL=fr_FR.utf-8
export LC_CTYPE=fr_FR.utf-8
export LANGUAGE=fr_FR

reboot.

run locale.
voilá!
  •  

Raspberry Pi: How to install PyLoad downloadmanager » Jan Karres

Installer pyload sur son raspberry

Raspberry Pi: How to install PyLoad downloadmanager
Geschrieben von Elias Porcio in Raspberry Pi/ 7 Kommentare
19 Jun

I have already published some instructions on how to set up Raspbian. Now follows the most used program on my Raspberry Pi. It is called pyLoad and is a, in Python written, downloadmanager with webinterface. How to get it on the Raspberry Pi will be explained hereinafter. We will istall the version of pyLoad without graphical user interface but with webinterface.

Requires Raspbian or a similar Debian-distribut

Step 1

In order to be able to install all packages in step 2 we have to extend the sources.list. We can do so with the editor nano. Just insert the line after the nano command into the end of the file. You can save by pressing CTRL + X (which ends the programm), whereupon you are asked if you want to save before closing.

sudo nano /etc/apt/sources.list

deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

At last we update apt.

sudo apt-get update

Step 2

First we need some Packages, so we can install PyLoad. We are mainly talking about Python (already Preinstalled) with some extensions and programs, that are used to unpack downloaded files.

sudo apt-get -y install liblept3
sudo apt-get -y install python python-crypto python-pycurl python-imaging tesseract-ocr python-qt4 spidermonkey-bin zip unzip
sudo apt-get -y build-dep rar unrar-nonfree

Step 3

Afterwards we download the latest .DEB-file of Python of the version cli. As I wrote this tutorial, the version 0.4.9 was up to date. You can get the latest download link at http://pyload.org/download

wget http://download.pyload.org/pyload-cli-v0.4.9-all.deb

Step 4

Now we install PyLoad using dpkg and delete the DEB-file afterwards.

sudo dpkg -i pyload-cli-v0.4.9-all.deb
rm pyload-cli-v0.4.9-all.deb

Step 5

Next, we launch PyLoad for the first time. Some questions to the set up will be asked.

cd /usr/share/pyload
./pyLoadCore.py

Step 6 (optional)

We can start PyLoad as Deamon, so we do not always have to leave the terminal open to run the downloadmanager.

pyLoadCore --daemon

Step 7 (optional; start on boot)

If we want to make PyLoad start together with the Raspberry Pi, we will create a crontab entry for the start of the Deamon. We insert the following line into the end of the file and save using CTRL + X and the confirmation, that we want to save.

crontab -e

@reboot pyLoadCore --daemon

Done! The PyLoad downloadmanager has been installed and is now set up. If you have activated the webinterface during the installation, you will be able to open IP:8000 (IP has to be replaced by the IP of the Raspberry Pi) in your browser and you can start downloading!
  •  

Running cron jobs on Raspberry Pi in Raspbmc | wexoo.net

Comment activer cron jobs sous raspbmc

Running cron jobs on Raspberry Pi in Raspbmc
Posted on April 6, 2013 by wexoo

Here’s another little tutorial especially for people new to raspberry pi or linux in general (such as myself). Cron jobs are used to execute specific actions at pre-configured times. These actions can be executing scripts, writing data to a file, etc. (would be glad to hear of stuff you do with cron jobs in the comment section ;) )

In my specific case I needed a script to map my changing external ip address at home to the domain I specified for my raspberry to have access to it when I’m away. Big thanks for all the help to my good friend Thomas for domain hosting and tipps on how to get this to work! Now let’s get to it!

   Activate cron jobs in Raspbmc
   Per default running cron jobs is deactivated in Raspbmc and there are two ways to activate them.
   - In the Raspbmc GUI under Programs Raspbmc Settings -> System Configuration -> Service Management -> Cronjob Scheduler
   - Via SSH/FTP by modifying sys.service.cron value to “true” the settings file under /home/<your_username>/.xbmc/userdata/addon_data/script.raspbmc.settings/settings.xml – for more infos on changing settings via SSH / FTP, check my
  •  
❌