wget et curl avec mac osx

echo 'alias wget="curl -O"' >> ~/.bash_profile

on peut utiliser alors wget pour telecharger le lien du fichier web.

Curl is better than wget for the following reasons:

  • Uses libcurl a cross platform library
  • curl sends more stuff to stdout and reads more from stdin
  • curl supports ftp, ftps, http, https, scp sftp, tftp, telnet, dict, ldap and ldaps while wget
  • supports only http, https and ftp
  • curl has ssl support
  • libcurl supports more http authentication methods
  • Curl is bidirectional while wget offers http post support only
  • Curl has more development activities.

Petit pc(unite centrale) usb à 17euros

http://www.raspberrypi.org/

PLS playlist sample

PLS playlist sample

File1=C:\My Music\Pink Floyd\1979—The_Wall_CD1\1.In_The_Flesh.mp3
Title1=Pink Floyd – In The Flesh
Length1=199
File2=C:\My Music\Pink Floyd\1979—The_Wall_CD1\10.One_Of_My_Turns.mp3
Title2=Pink Floyd – One Of My Turns
Length2=217
NumberOfEntries=2
Version=2

Explanation of entries:

”: Signifies that this is a PLS playlist. This is case sensitive.

File#=”: Location of the file in any of the formats described above. This is also case sensitive. Also the # sign after « File » signifies what file number it is. The first file in the playlist is « File1 », the second is « File2 » and so on.

Title#=”: Title to display. This is usually the title read from the file name or ID3 tags. Like the other fields, this is case sensitive. This also can be the name of a stream. Like « File# » the pound sign (#) is replaced by the entry number that is in the PLS playlist.

Length#=”: Length in seconds, this is also case sensitive. On the last entry there is a negative one, this is usually seen on streams, it tells the program to ignore the time entry. Like « File# » the pound sign (#) is replaced by the entry number that is in the PLS playlist.

NumberOfEntries=#”: The total number of entries in the playlist. This should match the last number on the « File# », « Title# », and « Length# » fields. Also case sensitive.

Version=2”: This required entry near the bottom tells the player what format the PLS is in. Older versions of the PLS playlist format did not include this. Like everything else, it is case sensitive.

Configuration du RAID1 en ligne de commande

Configuration du RAID1

Création de 2 partitions RAID1 de 1To

Pour chaque disque

# fdisk /dev/sdX

Créer une partition de type Linux raid autodetect (id = fd dans fdisk)

Quitter fdisk par ‘w’

Créer les arrays pour les 2 groupes de disques

# mdam --verbose --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sdX /dev/sdX

Modifier /etc/mdadm/mdadm.conf

Utiliser la commande suivante

# mdadm –detail --scan

et ajouter les lignes suivantes au fichier de configuration

ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90
UUID=156b6fad:4c766c16:5fb02083:99a3fc4b
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90
UUID=5c38d7b4:b1832d52:5fb02083:99a3fc4b

Formater les arrays

# mkfs.ext4 -m1 /dev/md0
# mkfs.ext4 -m1 /dev/md1

Créer les répertoires /mnt/raid1 et /mnt/raid2

Modifier /etc/fstab et ajouter les lignes suivantes

/dev/md0 /mnt/raid1 ext4 defaults 0 0
/dev/md1 /mnt/raid2 ext4 defaults 0 0

Utilisation courante

Liste les informations d’un disque

# mdadm -E /dev/sdX

Cette commande scan tous les disques et assemble ceux qui corresponde au uuid définit

# mdadm -Av /dev/md0 --uuid=84788b68:1bb79088:9a73ebcc:2ab430da /dev/sd*

Affichage des statistiques des arrays, synchronisation, mode dégradé

# cat /proc/mdstat
# watch -n1 'cat /proc/mdstat'

Automatic Restart & Changing a Remote Computer’s Startup Disk for mac

Automatic Restart
You can also use the systemsetup tool to set the computer to start up after a power failure or system freeze, by specifying a number of seconds:
systemsetup -setwaitforstartupafterpowerfailure seconds

Changing a Remote Computer’s Startup Disk
You can change a remote computer’s startup disk using SSH.
To determine available startup volumes:
Log in to the remote computer using SSH, and enter:
systemsetup -liststartupdisks
To change the startup disk:
Log in to the remote computer using SSH, and enter:
CodeLinesystemsetup -setstartupdisks /Volumes/SnowLeopardServerHD/System/ Library/CoreServices