Tuesday, December 14, 2010

Gagnez en autonomie grâce aux disques RAM (ramdrive/ramdisk) - Blog d'infobidouilleur - Matt

Gagnez en autonomie grâce aux disques RAM (ramdrive/ramdisk) - Blog d'infobidouilleur - Matt

L'essentiel:

Ouvrez un terminal, et tapez la commande suivante :

diskutil erasevolume HFS+ "RAMdisk" `hdiutil attach -nomount ram://taille`

La valeur de taille est en nombre de blocs de 512 octets. Il faut donc multiplier la taille désirée en Mo par 2048. Le volume RAMdisk apparaitra alors sur votre bureau, sous la forme d'un volume amovible.
Pour supprimer le disque virtuel, utilisez la commande suivante :

hdiutil detach `mount | grep RAMdisk | cut -d ' ' -f 1`

Vous pouvez aussi l'éjecter depuis le Finder



Par Matt le dimanche 26 octobre 2008, 23:51 - Soft - Lien permanent


Il m'arrive de faire de longs voyages en train (9-10h...) quand je rentre chez mes parents, et j'utilise alors mon Macbook pour regarder des films. Le problème sur une telle durée c'est que même avec deux batteries, c'est parfois un peu juste, surtout quand il faut pousser la luminosité à fond pour ne pas être trop gêné par les reflets. Les solutions pour gagner un peu d'autonomie sont donc toujours bonnes à prendre ! Depuis quelques temps, je m'interrogeais sur l'utilité d'un ramdisk pour cet usage.

En effet, le disque dur est l'un des composants les plus gourmands sur un ordinateur portable. En usage classique (surf, bureautique...), le disque dur se met régulièrement en veille, et se relance à chaque fois que nécessaire. Mais en lecture de vidéo, l'utilisation du disque dur est plus fréquente, l'empêchant de se mettre en veille. L'idée est donc de créer un ramdisk, c'est-à-dire un disque virtuel alloué en RAM, et d'y copier le fichier vidéo avant la lecture. Ainsi, le disque dur est bien moins sollicité et peut donc se mettre en veille plus souvent.

En pratique, sur la lecture d'un fichier d'1h45 avec VLC sous Mac OS X, la consommation est ainsi passée de 29.4 Wh à 27.1 Wh, soit un gain d'autonomie de plus de 8%. C'est toujours ça de gagné, sur l'autonomie en lecture vidéo avec deux batteries, ça représente un gain de plus d'une demi heure.

Alors, comment faire me direz vous ? Voici différentes solutions, sous OS X et sous Windows.

  • Solution 1 (OS X) : avec diskutil et hdiutil

Ouvrez un terminal, et tapez la commande suivante :

diskutil erasevolume HFS+ "RAMdisk" `hdiutil attach -nomount ram://taille`

La valeur de taille est en nombre de blocs de 512 octets. Il faut donc multiplier la taille désirée en Mo par 2048. Le volume RAMdisk apparaitra alors sur votre bureau, sous la forme d'un volume amovible.
Pour supprimer le disque virtuel, utilisez la commande suivante :

hdiutil detach `mount | grep RAMdisk | cut -d ' ' -f 1`

Vous pouvez aussi l'éjecter depuis le Finder. Merci marcel's et MacJL du forum de Macbidouille pour cette solution plus simple... moi et ma manie d'utiliser la ligne de commande au lieu du clicodrôme ^^

  • Solution 2 (OS X) : Esperance DV

Si le terminal vous fait peur, vous pouvez utiliser Esperance DV, un petit freeware qui vous permettra de créer et supprimer un ramdisk (jusqu'à 2 Go) depuis le panneau de contrôle. Il a également l'avantage de permettre la sauvegarde et la restauration du volume sous forme d'image disque. Il souffre d'un petit bug, mais qui ne gêne pas son fonctionnement : il n'affiche pas correctement les quantités de RAM supérieures à 2 Go.

  • Solution 3 (Windows) : RRamDisk

Sous Windows, les solutions de création de ramdisks sont nombreuses, mais les solutions gratuites sont souvent très limitées en capacité (64 Mo en général, en se basant sur le drivers ramdisk fournit par Microsoft). RRamDisk est une exception : ce petit freeware vous permet de créer un ramdisk dans la limite de votre quantité de mémoire. Vous trouverez plus d'informations sur MyDigitalLife.

SuperSpeed Ramdisk Plus est une solution payante. Dans le cadre d'une simple utilisation comme tampon pour de la lecture vidéo, c'est même un peu surdimensionné. Son intérêt est surtout de permettre de créer des ramdisks persistants (sauvegardés automatiquement à l'arrêt de l'ordinateur, puis restaurés au démarrage), de supporter le swap de Windows, mais aussi d'allouer le ramdisk dans une zone mémoire non reconnue par le système. Utile donc pour récupérer le Go non reconnu par les versions 32 bits de Windows sur une machine dotée de 4 Go de RAM.

Sunday, December 12, 2010

Modifier les icônes d'applications de votre iPhone sans jailbreak - iPhone 4, iPad, iPod Touch : le blog iPhon.fr

Modifier les icônes d'applications de votre iPhone sans jailbreak - iPhone 4, iPad, iPod Touch : le blog iPhon.fr


Par jcsatanas le dimanche 12 décembre 2010, 15:10 - Trucs et astuces iPhone et iPod Touch -Lien permanent


Au chapitre des trucs et astuces iPhone, vous serez peut-être content d'apprendre qu'il est tout à fait possible d'installer des icônes personnalisées pour vos applications sans devoir passer par la case jailbreak.

Il vous faudra tout d'abord installer le logiciel "iPhone Explorer" pour Mac ou PC si vous ne l'avez pas encore.

Ensuite, il faut savoir que chaque "ipériphérique" a sa norme en terme de pixels et de nom :

  • "Icon.png" en 57 X 57 pour l'iPhone 3G/3GS et l'iPod Touch
  • "Icon@2x.png" en 114 X 114 pour l'iPhone 4 et l'iPod Touch 4G
  • "Icon-iPad.png" en 72 X 72 pour l'iPad

Une fois installé iPhone explorer, lancez-le pour accéder au dossier de l'application souhaitée en suivant ce chemin :

nomdeliphone>apps>nomdelapp>nomdelapp.app

1ère étape, il faut sauvegarder les fichiers originaux, ceci afin de pouvoir revenir en arrière plus tard.

Dans le dossier nomdelapplication.app, sélectionnez le fichier "icon.png" et faites un glisser-déposer vers un dossier que vous aurez créé pour l'occasion.


2ème étape, de la même manière que vous aurez sauvegardé les icônes originales, glissez-déposez les nouvelles icônes correctement renommées dans le dossier nomdelapp.app.

Fermez iPhone Explorer puis redémarrez votre iDevice afin que les modifications soient pris en compte.

Avant :


Après :


Et voilà, une belle icône facilement mise en place.

Alors, des envies créatrices parmi nos lecteurs ?

Note : l'application iFon.fr officielle avec les icônes à la bonne résolution arrive bientôt, donc ne le faites pas pour ça ;-), c'était juste pour illustrer le billet !

Note 2 : bien entendu, en utilisant une application pour aller modifier les fichiers de vos iPhone, vous prenez le risque de faire des modifications aux résultats imprévus donc ne le faites que si vous êtes sur de vous, en ayant sauvegardé vos fichiers et en ayant fait bien entendu une sauvegarde complète de votre machine avant ! Bref, vous l'avez compris, c'est à vos risques et périls


Suivez iPhon.fr sur Twitter, sur Facebook, via RSS, sur le site mobile de iPhon.fr ou avec l'application dédiée iFon.fr

Wednesday, November 24, 2010

Move folders that are expected in specific locations - Mac OS X Hints

Move folders that are expected in specific locations - Mac OS X Hints


Move folders that are expected in specific locations
Oct 29, '10 07:30:00AM • Contributed by: michelcolman
Quite a few badly written apps like to create folders in specific locations, and expect them to be there and nowhere else. For example, my ~/Documents folder contains items such as 'Microsoft User Data', 'Steam Content', 'TomTom', etc. Some even create folders in your home directory or worse, at the root level of the hard disk!

Sometimes you can set a different location in the preferences of the application, but sometimes there's just no way. If you move the folder, the application will become hopelessly confused and/or create a new copy where it expects it. You can make these folders invisible, but then you can't easily access them anymore.

To move the folder wherever you want to move it to (for example, into a separate 'User Data' folder), create a symbolic link where the app expects it, and then hide the link.

Unfortunately 'chflags hidden' does not work on symbolic links for some reason, so you have to use SetFile which is installed as part of Developer Tools or can be found in various other locations. Just try it, and if it doesn't work, do an advanced search on MacOSXHints for articles with 'SetFile' in the title. (You might also be able to use the '.hidden' file although that is considered to be deprecated).

So anyway, once you have SetFile, do the following:
In the Finder, drag the offending folder to its new location
Open Terminal, and type ln -s with the trailing space but without pressing Enter or Return
Drag the folder from the new location into the Terminal window.
Drag the old location (the folder where the offending folder used to be located, for example Documents) to the terminal window. The command in Terminal should now look something like ln -s /Users/me/User Data/TomTom /Users/me/Documents.
Make sure the Terminal window is frontmost, and press return to execute the command. You will see the link appearing at the old location in the Finder. It looks just like an alias.
In the terminal, type SetFile -P -a V (with the trailing space) and drag the link (the one with the little arrow that looks like an alias) from the Finder to the Terminal window.
Press enter.
The link is now invisible. To the application, it seems as though the folder is still there in its old location.

Tuesday, November 16, 2010

Fixing Unknown error 0xE800000A in iOS Sync - Mac OS X Hints

Fixing Unknown error 0xE800000A in iOS Sync - Mac OS X Hints

The upgrade to iTunes 10.1 killed syncing my iPad. An 'Unknown error 0xE800000A' dialog was displayed. Searching Apple support, where the problem has occurred before without a fix beyond rebooting the device, and searching for the error on the web also didn't give a solution that worked.

Checking in the Console showed that iTunes couldn't write to a plist file in /var/db/lockdown; the file already existed and belonged to _usbmuxd. A quick Terminal session with:

cd /var/db/lockdown

sudo rm the file name

using the file name of the problem plist followed by a restart cured the problem.

Saturday, November 13, 2010

10.6: Reconnect Time Machine backup after drive swap - Mac OS X Hints

Résumé des instructions:
- Disable time machine
- Install /usr/sbin/fsaclctl out of the Leopard install disk that came with my Macbook Pro, from /Volumes/Mac OS X Install DVD/System/Installation/Packages/BSD.pkg , using whatever pkg extractor you desire (I used Pacifist) to make it work (extract only the single file, not the whole thing!).
- Find UUID of new partition (Disk Utility)
- See UUID of old partition
$ cd "/Volumes/Time Machine Backups/Backups.backupdb/*************’s MacBook Pro/Latest"
$ sudo xattr -p com.apple.backupd.SnapshotVolumeUUID "Macintosh HD"

- Change it to new partition UUID
$ sudo fsaclctl -p "/Volumes/Time Machine Backups/" -d
$ sudo xattr -w com.apple.backupd.SnapshotVolumeUUID XXXX "Macintosh HD"
$ sudo fsaclctl -p "/Volumes/Time Machine Backups/" -e

- Make sure new partition has the same name (Macintosh HD) as the old one

10.5: Reconnect Time Machine backup after drive swap - Mac OS X Hints

This hint is inspired by and uses tricks introduced by the hint Repair Time Machine after logic board changes, and is used for a similar purpose. In this case, I used this hint to re-connect Time Machine after migrating a partition from one hard disk to another one. I know it works with an image copy of your partition.

DISCLAIMER: Do this at your own risk! Have a backup of at least your most important files on a separate medium! Do not attempt this if you are uncertain about any of the consequences or circumstances here! There are no guarantees that the following will work for you!

Start from a different disk if you want to copy the system partition (use the System DVD if necessary). In Disk Utility, select the target disk (which must have been partitioned so your Mac can actually boot from it!), click Restore, drag the target partition to the Target field, and the old partition to the Source field. Don't forget to select Erase Destination, or it will in fact just make a file copy. Progress will then be shown as copying blocks instead of copying files.

The copy will be almost identical to the original -- only the drive ID (UUID) will be different, and that is why Time Machine would try to make a complete backup if we didn't do something to prevent it. I have not tested whether a mere file copy of a partition can be re-connected successfully so that only incremental backups are made. It does seem to work with an image copy, though.

After the image is done, remove the old drive/partition, or otherwise disable it, so that you're not confused by its presence -- all commands that follow will refer only to the new partition, and a change will be made only to a folder in the Time Machine backup.

Important: First, disable Time Machine.

Next, open Disk Utility, select your new partition and press Command-I to display the partition's information. You will need the Universal Unique Identifier value; select it with the mouse, copy it, and paste it somewhere for use later. Then open Terminal and go to the last Time Machine snapshot:

$ cd /Volumes/my_backup/Backups.backupdb/my_mac/Latest
Replace /Volumes/my_backup with the full path to your (new) Time Machine drive/partition, and replace my_mac with the name of your Mac as shown on the Time Machine drive. This directory will hold one (or more) folders, each named after one of your drives or partitions. For safekeeping, display the old partition's UUID before you do anything else -- this is the one that Time Machine has attached to your backups:
$ sudo xattr -p com.apple.backupd.SnapshotVolumeUUID my_partition
Replace my_partition with the name of the partition that you'll be swapping the UUIDs on. The command will print out a UUID, just like the one displayed in Disk Utility above. If the UUIDs are identical (which they won't be, yet), Time Machine will make an incremental backup; If they don't match, it will back up the entire partition again.

So if you are really, really certain that your new partition is in fact just a copy of your original partition, and you want Time Machine continuity, you can reconnect the last backup of your old partition to your new partition by overwriting exactly that UUID with the one of the new partition.

First temporarily disable ACL protection for the backup drive:
$ sudo fsaclctl -p /Volumes/my_backup -d
Whatever you do, do not forget the matching command below to re-enable it again!

Next, and this is the critical step, overwrite the UUID with the UUID you have copied from Disk Utility above (the UUID is represented by the X's in this example):

$ sudo xattr -w com.apple.backupd.SnapshotVolumeUUID XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX my_partition

Now re-enable ACL protection for the backup drive:
$ sudo fsaclctl -p /Volumes/my_backup -e
Now you can re-enable Time Machine, and it should recognize your new partition as the same as your old one, and only make an incremental backup. When the motherboard of your Mac has changed, proceed as described in the original Repair Time Machine after logic board changes hint.

[robg adds: I haven't tested all of this hint, only the bit about reading the UUIDs off the backup drive, which worked as described.]

NOTE FOR 10.6 Snow Leopard
fsaclctl does not exist in Snow Leopard. Solution: Install /usr/sbin/fsaclctl out of the Leopard install disk that came with my Macbook Pro, from /Volumes/Mac OS X Install DVD/System/Installation/Packages/BSD.pkg , using whatever pkg extractor you desire (I used Pacifist) to make it work (extract only the single file, not the whole thing!).

Show Hidden Files | Mac Tricks And Tips

Show Hidden Files | Mac Tricks And Tips:

Defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Monday, November 8, 2010

How to fix a Time Machine hangup - Mac OS X Hints

How to fix a Time Machine hangup - Mac OS X Hints

Time Machine, while it does have a very usable interface, is inclined to get stuck sometimes.

Occasionally Time Machine seems to be stuck, but isn't really. When you first do a backup, or when you haven't backed up to a particular disk for ages (perhaps if you have been away on a trip), it can spend several hours 'preparing'. You can tell it is preparing because when you open the Time Machine preferences there is the little barber pole saying 'Preparing.'

The essence of the solution is to open up the backup media and find the file ending in '.inProgress' and then deleting that file. This will be on the backup volume inside the Backups.backupdb folder, and then in the subfolder for the machine and volume which was being backed up at the time of the hangup. These folders may be inside of a Sparse Disk Image if the backup goes to a Time Capsule or other network based backup volume. After rebooting the Mac Time Machine can then startup normally and perform its operations.

For more details and some screenshots see my blog.

[crarko adds: I haven't tested this one. It's worth it to read the blog entry and pay attention to the caveats and the screen shots contained therein. I've been fortunate to not have any problems with Time Machine, but I've had clients who experienced the hangup using a Time Capsule or an Xserve based backup.]

Monday, July 5, 2010

Time machine: "clean" restore

Step by step guide to restore from Time Machine on a clean install:

Before formatting:
- One last time machine backup
- Copy virtual machine to external HD

After formatting
- Clean install + updates (may need airport cd)
- System preferences, Finder sidebar, dock stacks
- (Alt) click on time machine to "browse other time machine disks"
- Copy Documents, Music, Pictures, Movies, and Downloads
- Open itunes and connect iphone (everything should be ok)
- Install Chrome, open once to create application support folders, then replace user/application support/google/chrome
- Same for Chromium
- Install VMWare then copy Virtual Machine to Documents
- Install Menumeters
- Install istatpro (widget)
- Install utorrent
- Install filezilla (host: hd1.freebox.fr, user: freebox, no password)
- Install VLC
- Address book: delete folder user/library/application support/address book and replace it with the one from time machine
- Address book: setup sync with google, sync and eliminate duplicates (several times)
- Calendar: delete folder user/library/calendars and replace it with the one from time machine
- Install iwork then open it to enter serial (check serial in dedicated folder) then software update
- Install ilife (Note: needs restart)
- Network: Poly. Proxy (http and secure): cache.polytechnique.fr port:8080
- Passwords: replace users/library/keychains
- Reconnect Time Machine (check grobbymac.blogspot.com)

Others?
- dropbox
- Trashme
- facetime
- Subsyncx
- VisualHub
- Xerox printer driver (lab)
- NTFS 3G
- Perian
- Install Firefox then copy profile folder (user/application support/firefox) and rename it to match name created by new firefox install (everything should be back, including extensions)
- Same for Thunderbird
- Install skype and copy user/library/application support/skype
- (Install itouch server (logitech))
- Install total finder
- Install splashtop streamer

Time machine dossiers vides empty folders

Just got the same problem i had a while ago, but i can't find the solution i had previously worked out...
when i try to restore a folder from time machine, all i get is an empty folder, ie the files aren't copied. this happens when i try to restore it from time machine, but also when i try to copy it from the time machine disk
the comments i read on the issue seem to point to a user permission problem, but repairing disk permissions using the Disk Utility (applications/utilities) didn't solve the problem
currently trying a repair disk on the time machine disk...