Archives par étiquette : Astuces

Installation d’une debian avec LVM sur un serveur OVH depuis le mode rescue-pro

Après avoir rebooté en mode rescue pro (avec la clé publique c’est plus facile), il faut nettoyer les partitions dans parted (commande rm) puis créer une partition de BiosBoot pour grub (si vous avez un disque en GPT)

root@rescue:~# parted
GNU Parted 3.1.52-1c659-dirty
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA ST32000641AS (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart
Partition name?  []? primary
File system type?  [ext2]? ext4
Start? 1
End? 100M
(parted) p
Model: ATA ST32000641AS (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  99.6MB  98.6MB               primary

(parted)

Puis la « flagguer » correctement


(parted) set 1 bios_grub on
(parted) p
Model: ATA ST32000641AS (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  99.6MB  98.6MB               primary  bios_grub

(parted)

Ensuite on créer une partition avec tout le reste :


(parted) mkpart
Partition name?  []? pv
File system type?  [ext2]? ext4
Start? 100M
End? -1
(parted) p
Model: ATA ST32000641AS (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  99.6MB  98.6MB               primary  bios_grub
2      99.6MB  2000GB  2000GB               pv

(parted)

Puis on positionne le type LVM sur cette deuxième partition :

(parted) set 2 lvm
New state?  [on]/off? on
(parted) p
Model: ATA ST32000641AS (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
1      1049kB  99.6MB  98.6MB               primary  bios_grub
2      99.6MB  2000GB  2000GB               pv       lvm

(parted)

(parted) quit
Information: You may need to update /etc/fstab.

root@rescue:~# pvcreate /dev/sda2
Writing physical volume data to disk "/dev/sda2"
Physical volume "/dev/sda2" successfully created
root@rescue:~#

root@rescue:/# vgcreate rootvg /dev/sda2
Volume group "rootvg" successfully created
root@rescue:/#

root@rescue:/# lvcreate -n slashlv -L10G rootvg
Logical volume "slashlv" created
root@rescue:/# lvcreate -n varlv -L2G rootvg
Logical volume "varlv" created
root@rescue:/# lvcreate -n tmplv -L2G rootvg
Logical volume "tmplv" created
root@rescue:/# lvcreate -n varliblv -L10G rootvg
Logical volume "varliblv" created
root@rescue:/#

root@rescue:/# mkfs.ext4 /dev/rootvg/slashlv
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: mdone

root@rescue:/# mkfs.ext4 /dev/rootvg/varlv
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

root@rescue:/# mkfs.ext4 /dev/rootvg/tmplv
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

root@rescue:/# mkfs.ext4 /dev/rootvg/varliblv
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

root@rescue:/#

root@rescue:/# mount /dev/rootvg/slashlv /mnt/
root@rescue:/# mkdir /mnt/var
root@rescue:/# mount /dev/rootvg/varlv /mnt/var
root@rescue:/# mkdir /mnt/var/lib
root@rescue:/# mount /dev/rootvg/varliblv /mnt/var/lib/
root@rescue:/# mkdir /mnt/tmp
root@rescue:/# mount /dev/rootvg/tmplv /mnt/tmp

root@rescue:~# mkdir /mnt/proc
root@rescue:~# mkdir /mnt/sys
root@rescue:~# mkdir /mnt/dev

Télécharger et recopier debootstrap dans /mnt/tmp (il faut un endroit où on a le droit d’écrire)


jylenhof@portable-jylenhof:~$ scp debootstrap_1.0.53_all.deb root@jedimaster.lenhof.eu.org:/mnt/tmp/
Warning: the RSA host key for 'jedimaster.lenhof.eu.org' differs from the key for the IP address '91.121.74.224'
Offending key for IP in /home/jylenhof/.ssh/known_hosts:16
Matching host key in /home/jylenhof/.ssh/known_hosts:18
Are you sure you want to continue connecting (yes/no)? yes
root@jedimaster.lenhof.eu.org's password:
debootstrap_1.0.53_all.deb                    100%   59KB  58.8KB/s   00:00jylenhof@portable-jylenhof:~$

root@rescue:~# cd /mnt/tmp/
root@rescue:/mnt/tmp# ls
debootstrap_1.0.53_all.deb  lost+found
root@rescue:/mnt/tmp# ar x debootstrap_1.0.53_all.deb
root@rescue:/mnt/tmp# ls
control.tar.gz    debian-binary            lost+found
data.tar.gz    debootstrap_1.0.53_all.deb
root@rescue:/mnt/tmp# tar xvzf data.tar.gz
./
./usr/
./usr/share/
./usr/share/man/
./usr/share/man/man8/
./usr/share/man/man8/debootstrap.8.gz
./usr/share/doc/
./usr/share/doc/debootstrap/
./usr/share/doc/debootstrap/README
./usr/share/doc/debootstrap/copyright
./usr/share/doc/debootstrap/changelog.gz
./usr/share/debootstrap/
./usr/share/debootstrap/devices.tar.gz
./usr/share/debootstrap/functions
./usr/share/debootstrap/scripts/
./usr/share/debootstrap/scripts/potato
./usr/share/debootstrap/scripts/sid
./usr/share/debootstrap/scripts/breezy
./usr/share/debootstrap/scripts/hoary.buildd
./usr/share/debootstrap/scripts/woody
./usr/share/debootstrap/scripts/sarge.fakechroot
./usr/share/debootstrap/scripts/warty
./usr/share/debootstrap/scripts/warty.buildd
./usr/share/debootstrap/scripts/hoary
./usr/share/debootstrap/scripts/feisty
./usr/share/debootstrap/scripts/gutsy
./usr/share/debootstrap/scripts/sarge
./usr/share/debootstrap/scripts/sarge.buildd
./usr/share/debootstrap/scripts/edgy
./usr/share/debootstrap/scripts/woody.buildd
./usr/share/debootstrap/scripts/dapper
./usr/sbin/
./usr/sbin/debootstrap
./usr/share/debootstrap/scripts/quantal
./usr/share/debootstrap/scripts/raring
./usr/share/debootstrap/scripts/precise
./usr/share/debootstrap/scripts/oldstable
./usr/share/debootstrap/scripts/jaunty
./usr/share/debootstrap/scripts/natty
./usr/share/debootstrap/scripts/karmic
./usr/share/debootstrap/scripts/oneiric
./usr/share/debootstrap/scripts/hardy
./usr/share/debootstrap/scripts/squeeze
./usr/share/debootstrap/scripts/intrepid
./usr/share/debootstrap/scripts/etch-m68k
./usr/share/debootstrap/scripts/etch
./usr/share/debootstrap/scripts/unstable
./usr/share/debootstrap/scripts/saucy
./usr/share/debootstrap/scripts/testing
./usr/share/debootstrap/scripts/maverick
./usr/share/debootstrap/scripts/lucid
./usr/share/debootstrap/scripts/lenny
./usr/share/debootstrap/scripts/wheezy
./usr/share/debootstrap/scripts/stable
./usr/share/debootstrap/scripts/jessie
root@rescue:/mnt/tmp# ./usr/sbin/debootstrap --arch amd64 wheezy /mnt/ http://ftp.us.debian.org/debian

....

root@rescue:~# mount --bind /proc /mnt/proc
root@rescue:~# mount --bind /sys /mnt/sys
root@rescue:/mnt# mount --bind /dev /mnt/dev
root@rescue:/mnt#

LANG=C.UTF-8 chroot /mnt/ /bin/bash

 

apt-get install locales lvm2 bind9-host

dpkg-reconfigure locales

Choisir en_US.UTF-8 & fr_FR.UTF-8 et choisir l’un des deux en langue principal

dpkg-reconfigure tzdata

vi /etc/hostname

vi /etc/network/interfaces

vi /etc/resolv.conf

vi /etc/hosts

vi /etc/fstab

Modification /etc/apt/sources.list (ajouter notamment ce qui est security)


# Debian packages for stable
deb http://ftp2.fr.debian.org/debian/ stable main contrib
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
deb-src http://ftp2.fr.debian.org/debian/ stable main contrib

# Security updates for stable
deb http://security.debian.org/ stable/updates main contrib
deb-src http://security.debian.org/ stable/updates main contrib

deb http://ftp2.fr.debian.org/debian/ wheezy-updates main
deb-src http://ftp2.fr.debian.org/debian/ wheezy-updates main

deb http://ftp2.fr.debian.org/debian/ wheezy-backports main
deb-src http://ftp2.fr.debian.org/debian/ wheezy-backports main


apt-get update

apt-get dist-upgrade

tasksel install standard ssh

apt-get install grub2 linux-image-amd64 initramfs-tools openssh-server
Share

Rooter son smartphone Auchan du type Lazer X40i

Télécharger sur le site http://androidsu.com/superuser/ les packages arm Superuser-3.1.3-arm-signed.zip

Dézipper sur votre PC le fichier :

root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements# unzip Superuser-3.1.3-arm-signed.zip
Archive:  Superuser-3.1.3-arm-signed.zip
signed by SignApk
  inflating: META-INF/MANIFEST.MF   
  inflating: META-INF/CERT.SF       
  inflating: META-INF/CERT.RSA      
  inflating: META-INF/com/google/android/update-binary 
  inflating: META-INF/com/google/android/updater-script 
  inflating: system/app/Superuser.apk 
  inflating: system/bin/su          
root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements#

Poussez les fichiers sur votre smartphone :

root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements# adb root
adbd is already running as root
root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements# adb push system/bin/su /system/bin
4861 KB/s (380532 bytes in 0.076s)
root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements# adb push system/app/Superuser.apk /system/app
5742 KB/s (1468798 bytes in 0.249s)
root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements#

Passer en mode shell « root » sur votre téléphone :

root@mony-W250EGQ-W270EGQ:/home/mony/Téléchargements# adb shell
root@android:/ # chmod 7655 /system/bin/su                                    
root@android:/ # chmod 644 /system/app/Superuser.apk                          
root@android:/ # chown root.shell /system/bin/su
root@android:/ # chown root.shell /system/app/Superuser.apk
root@android:/ #

Redémarrer le téléphone…

Share

Installer Google Play sur un smartphone Auchan du type Lazer X40i

Avant de brancher le téléphone lister les périphériques USB connectés à votre PC.

Exemple sur ma machine :

jylenhof@portable-jylenhof:~$ lsusb
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 046d:c03e Logitech, Inc. Premium Optical Wheel Mouse (M-BT58)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0408:2fb1 Quanta Computer, Inc.
jylenhof@portable-jylenhof:~$

Branchez votre smartphone sur votre ordinateur, normalement une ligne supplémentaire devrait apparaître (ici en rouge italique gras) :

jylenhof@portable-jylenhof:~$ lsusb
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 046d:c03e Logitech, Inc. Premium Optical Wheel Mouse (M-BT58)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0408:2fb1 Quanta Computer, Inc.
Bus 002 Device 010: ID 0a5c:e681 Broadcom Corp.
jylenhof@portable-jylenhof:~$

Vérifiez que le package « android-tools-adb » est installé sur votre PC Linux, sinon installez le.

Passons maintenant en root sur votre PC (vous pourriez avoir à taper votre password) :

jylenhof@portable-jylenhof:~$ sudo su –
root@portable-jylenhof:~#

Lancez alors la commande « adb devices » pour lister les appareils reconnus par ADB…

root@portable-jylenhof:~# adb devices
List of devices attached

root@portable-jylenhof:~#

Le téléphone n’est pas vu. Pour qu’il soit vu il faut ajouter un fichier /root/.android/adb_usb.ini

root@portable-jylenhof:~# cd .android/
root@portable-jylenhof:~/.android# ls
adbkey  adbkey.pub
root@portable-jylenhof:~/.android# vi adb_usb.ini

Le fichier doit contenir la ligne suivante :

0x0a5c

 

Le téléphone est vu désormais :

root@portable-jylenhof:~/.android# adb kill-server

 

root@portable-jylenhof:~# adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0123456789ABCDE    device

root@portable-jylenhof:~#

Télécharger le fichier gapps-ics-20120429-signed.zip du site http://goo.im/gapps/gapps-ics-20120317-signed.zip

Le dézipper… dans un répertoire temporaire créé pour l’occasion :

root@portable-jylenhof:/home/jylenhof/Téléchargements# mkdir toto
root@portable-jylenhof:/home/jylenhof/Téléchargements# cd toto/
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto# unzip ../gapps-ics-20120429-signed.zip

Archive:  ../gapps-ics-20120429-signed.zip
signed by SignApk
inflating: META-INF/MANIFEST.MF
inflating: META-INF/CERT.SF
inflating: META-INF/CERT.RSA
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
inflating: install-optional.sh
inflating: optional/face/addon.d/71-gapps-faceunlock.sh
inflating: optional/face/app/FaceLock.apk
inflating: optional/face/lib/libfacelock_jni.so
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/left_eye-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/nose_base-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-r0-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-rn7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.3/right_eye-y0-yi45-p0-pi45-rp7-ri20.2d_n2/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-r0-ri30.4a/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-rn30-ri30.5/full_model.bin
inflating: optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.3/head-y0-yi45-p0-pi45-rp30-ri30.5/full_model.bin
inflating: optional/face/vendor/pittpatt/models/recognition/face.face.y0-y0-22-b-N/full_model.bin
inflating: optional/noneon/lib/libfacelock_jni.so
inflating: optional/noneon/lib/libflint_engine_jni_api.so
inflating: optional/noneon/lib/libfrsdk.so
inflating: optional/noneon/lib/libgcomm_jni.so
inflating: optional/noneon/lib/libpicowrapper.so
inflating: optional/noneon/lib/libspeexwrapper.so
inflating: optional/noneon/lib/libvideochat_jni.so
inflating: optional/noneon/lib/libvideochat_stabilize.so
inflating: optional/noneon/lib/libvoicesearch.so
inflating: system/addon.d/70-gapps.sh
inflating: system/app/ChromeBookmarksSyncAdapter.apk
inflating: system/app/GalleryGoogle.apk
inflating: system/app/GenieWidget.apk
inflating: system/app/GoogleBackupTransport.apk
inflating: system/app/GoogleCalendarSyncAdapter.apk
inflating: system/app/GoogleContactsSyncAdapter.apk
inflating: system/app/GoogleFeedback.apk
inflating: system/app/GoogleLoginService.apk
inflating: system/app/GooglePartnerSetup.apk
inflating: system/app/GoogleQuickSearchBox.apk
inflating: system/app/GoogleServicesFramework.apk
inflating: system/app/GoogleTTS.apk
inflating: system/app/MarketUpdater.apk
inflating: system/app/MediaUploader.apk
inflating: system/app/NetworkLocation.apk
inflating: system/app/OneTimeInitializer.apk
inflating: system/app/Phonesky.apk
inflating: system/app/SetupWizard.apk
inflating: system/app/Talk.apk
inflating: system/app/VoiceSearch.apk
inflating: system/etc/g.prop
inflating: system/etc/permissions/com.google.android.maps.xml
inflating: system/etc/permissions/com.google.android.media.effects.xml
inflating: system/etc/permissions/com.google.widevine.software.drm.xml
inflating: system/etc/permissions/features.xml
inflating: system/framework/com.google.android.maps.jar
inflating: system/framework/com.google.android.media.effects.jar
inflating: system/framework/com.google.widevine.software.drm.jar
inflating: system/lib/libfilterpack_facedetect.so
inflating: system/lib/libflint_engine_jni_api.so
inflating: system/lib/libfrsdk.so
inflating: system/lib/libgcomm_jni.so
inflating: system/lib/libpicowrapper.so
inflating: system/lib/libspeexwrapper.so
inflating: system/lib/libvideochat_jni.so
inflating: system/lib/libvideochat_stabilize.so
inflating: system/lib/libvoicesearch.so
inflating: system/tts/lang_pico/de-DE_gl0_sg.bin
inflating: system/tts/lang_pico/de-DE_ta.bin
inflating: system/tts/lang_pico/es-ES_ta.bin
inflating: system/tts/lang_pico/es-ES_zl0_sg.bin
inflating: system/tts/lang_pico/fr-FR_nk0_sg.bin
inflating: system/tts/lang_pico/fr-FR_ta.bin
inflating: system/tts/lang_pico/it-IT_cm0_sg.bin
inflating: system/tts/lang_pico/it-IT_ta.bin
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto#

Les apk installables sont alors visibles :

root@portable-jylenhof:/home/jylenhof/Téléchargements/toto/system/app# ls
ChromeBookmarksSyncAdapter.apk  GoogleServicesFramework.apk
GalleryGoogle.apk               GoogleTTS.apk
GenieWidget.apk                 MarketUpdater.apk
GoogleBackupTransport.apk       MediaUploader.apk
GoogleCalendarSyncAdapter.apk   NetworkLocation.apk
GoogleContactsSyncAdapter.apk   OneTimeInitializer.apk
GoogleFeedback.apk              Phonesky.apk
GoogleLoginService.apk          SetupWizard.apk
GooglePartnerSetup.apk          Talk.apk
GoogleQuickSearchBox.apk        VoiceSearch.apk
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto/system/app#

Poussez les packages sur le téléphone portable :

root@portable-jylenhof:/home/jylenhof/Téléchargements/toto# adb push system/app/ /data/local/tmp/
push: system/app/GoogleFeedback.apk -> /data/local/tmp/GoogleFeedback.apk
push: system/app/VoiceSearch.apk -> /data/local/tmp/VoiceSearch.apk
push: system/app/GalleryGoogle.apk -> /data/local/tmp/GalleryGoogle.apk
push: system/app/MediaUploader.apk -> /data/local/tmp/MediaUploader.apk
push: system/app/GenieWidget.apk -> /data/local/tmp/GenieWidget.apk
push: system/app/SetupWizard.apk -> /data/local/tmp/SetupWizard.apk
push: system/app/ChromeBookmarksSyncAdapter.apk -> /data/local/tmp/ChromeBookmarksSyncAdapter.apk
push: system/app/GoogleQuickSearchBox.apk -> /data/local/tmp/GoogleQuickSearchBox.apk
push: system/app/GoogleTTS.apk -> /data/local/tmp/GoogleTTS.apk
push: system/app/OneTimeInitializer.apk -> /data/local/tmp/OneTimeInitializer.apk
push: system/app/NetworkLocation.apk -> /data/local/tmp/NetworkLocation.apk
push: system/app/GoogleLoginService.apk -> /data/local/tmp/GoogleLoginService.apk
push: system/app/Talk.apk -> /data/local/tmp/Talk.apk
push: system/app/GoogleCalendarSyncAdapter.apk -> /data/local/tmp/GoogleCalendarSyncAdapter.apk
push: system/app/GoogleContactsSyncAdapter.apk -> /data/local/tmp/GoogleContactsSyncAdapter.apk
push: system/app/Phonesky.apk -> /data/local/tmp/Phonesky.apk
push: system/app/GoogleServicesFramework.apk -> /data/local/tmp/GoogleServicesFramework.apk
push: system/app/GoogleBackupTransport.apk -> /data/local/tmp/GoogleBackupTransport.apk
push: system/app/GooglePartnerSetup.apk -> /data/local/tmp/GooglePartnerSetup.apk
push: system/app/MarketUpdater.apk -> /data/local/tmp/MarketUpdater.apk
20 files pushed. 0 files skipped.
3285 KB/s (23496313 bytes in 6.983s)
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto#

Et il suffit juste d’une commande pour passer root sur le téléphone (et oui sans rootage nécessaire)

root@portable-jylenhof:/home/jylenhof/Téléchargements/toto# adb root
restarting adbd as root
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto# adb shell

root@android:/ #

Pour le vérifier il suffit de faire un « id » :
root@android:/ # id
uid=0(root) gid=0(root)
root@android:/ # ls /
acct
cache
config
d
data
default.prop
dev
etc
init
init.common.rc
init.goldfish.rc
init.log.rc
init.rc
init.rheastone.rc
init.rheastone_base.rc
init.usb.rc
mnt
proc
root
sbin
sdcard
sys
system
ueventd.goldfish.rc
ueventd.rc
ueventd.rheastone.rc
vendor

Maintenant déplaçons les fichiers apk au bon endroit :
root@android:/ # mount -o remount,rw /system                                  
root@android:/ # busybox cp /data/local/tmp/*.apk /system/app

root@android:/system/app # exit
root@portable-jylenhof:/home/jylenhof/Téléchargements/toto#

Et ensuite rebootez votre téléphone… il devrait installer de lui même les Google Apps

 

Share

Télécharger un morceau d’une émission de France2 disponible sur pluzz.fr

Il suffit d’utiliser le petit programme python disponible ici :

http://code.google.com/p/tvdownloader/wiki/pluzzdl

Et si comme moi vous n’avez besoin que d’une partie et de transcoder la vidéo obtenue en un autre format, vous pouvez par exemple utiliser openshot

Share

Recopier ses mails entre deux serveurs IMAP

Modification du 07/08/2014 : Ajout des informations sur la partie stunnel…

Une petite entrée pour un problème bien précis :  migrer ses mails d’un serveur IMAP à un autre serveur IMAP.

J’avais commencé par réaliser cette migration à la main dans thunderbird en déclarant les deux serveurs et en copiant les données de l’un vers l’autre…. C’est très très long, il faut créer soit même les répertoires sur le serveur cible et lancer une copie par dossier, pas pratique du tout quand on a plein de dossiers différents comme moi…. bref au bout de 30mn, clairement j’ai cherché une autre solution.

Et la solution s’appelle imapcopy, disponible de base sur une debian par un apt-get 😉

Le seul hic, c’est qu’il ne gère pas le IMAP sécurisé ou IMAPS…

Et donc pour s’en sortir il suffit de lancer un tunnel ssl entre le serveur distant et localement…. Deux stunnels plus loin

stunnel -c -p /etc/ssl/certs/padawanlenhofeuorg.pem -d 1143 -r www.lenhof.eu.org:993
stunnel -c -p /etc/ssl/certs/padawanlenhofeuorg.pem -d 2143 -r imap.gmail.com:993

il suffit ensuite de créer un fichier ImapCopy du type :

#############################################################
# imapcopy config
# all lines beginning with # are comments and will be ignored
#############################################################

##############
# Sourceserver
##############
SourceServer localhost
SourcePort 1143

###################
# Destinationserver
###################
DestServer localhost
DestPort 2143

##############################################################
# Timezone conversion
# The imap rfc is not clear on what kind of time offsets
# can be used. +XXXX -XXXX will be supported on all servers
# You can add as many entries as needed in the form
# converttimezone SRC DST
# to convert zones that your target server rejects
##############################################################
converttimezone « UTC » « +0000 »
converttimezone « UT »  « +0000 »

#############################
# List of users and passwords
#############################
#       SourceUser    SourcePassword   DestinationUser DestinationPassword
Copy    « jylenhof »         « passwordsupersecret »       « jean-yves@lenhof.eu.org »           « autrepasswordsupersecret »

 

Il faut modifier les ports 1143 et 2143 par les ports que vous avez utilisé au niveau de vos deux stunnel qui tournent….

Mettre vos users & password

Et ensuite lancer imapcopy (depuis le répertoire où vous avez créé votre fichier de configuration) et aller boire un café ou deux…  voir le thermos complet

Share