Rechercher dans ce blog

mercredi 7 octobre 2009

FIX TIME MACHINE AFTER CHANGING NETWORK INTERFACE

HOT-TO FIX TIME MACHINE MAC OS 10.5.8 AFTER CHANGING NETWORK INTERFACE

Changes to do with the backup drive

cd /Volumes/BACKUP_DRIVE

xattr -l *

pour lister les attributs étendus des fichiers présents.

Sur certains drives Backups.backupdb a un attribut avec la mac address et d'autres non...

Si mac address alors la changer avec la nouvelle

Tout d'abord couper l'acl

fsaclctl -p "/Volumes/BACKUP_DRIVE" -d

écrire la nouvelle adresse

xattr -w com.apple.backupd.BackupMachineAddress 00:1d:60:c1:d9:50 Backups.backupdb

Aller au dir de la machine

cd plutonX

xattr -w com.apple.backupd.BackupMachineAddress 00:1d:60:c1:d9:50 plutonX

réactiver l'acl

fsaclctl -p "/Volumes/BACKUP_DRIVE" -e

changes to do with the network infos

Je n'ai pas pu redémarrer time machine sur ma machine tant que je n'ai pas aussi fait ces changements qui consistent à "reseter" le nom bsd de l'interface à supposer que la précédente carte ethernet était "en0"

J'ai supprimé du dir

/Library/Preferences/SystemConfiguration/

les trois fichiers suivants :

NetworkInterfaces.plist

com.apple.network.identification.plist

preferences.plist

Ensuite reboot et reconfigurer le réseau.

A l'aide de OSXTools86 j'ai aussi réappliqué le fix tile machine (mais je ne pense pas que c'était nécessaire).

mardi 22 septembre 2009

microsoft excel (mac) - print as pdf - page setup dialog

Pour imprimer en un seul fichier PDF la totalité du workbook il faut bien prendre garde que dans le Page setup de chaque feuille le First Page number est à auto, car si l'on spécifie un numéro de page qui n'est pas dans la continuité des pages précédentes, la feuille est imprimée dans un fichier PDF à part.


200909221533.jpg

mardi 15 septembre 2009

applescript open ssh window in terminal with specific encoding settings

Je ne suis pas certain du tout que ce script soit tout à fait comme il faut... mais comme je n'ai pas grande idée de comment exactement fonctionne applescript j'ai bidouillé ces deux scripts en glanant ça et là des idées... sans doute y a-t-il une manière plus élégante d'écrire ça... sans doute même des fonctions et des propriétés que j'ignore, mais pour simplement ouvrir 3 fenêtres de terminal avec ssh... du moment que ça marche, c'est bon pour moi.


property commandString : "ssh user@host" -- < Edit this line as desired.


tell application "Terminal" -- Get a free window to run the commandString,

set windowCount to (count of the windows)

--activate

if ((count of windows) is 1) then

close window 1 -- attention, s'il n'y a qu'une seule fenêtre ouverte, elle sera fermée

--tell window 1

-- set miniaturized to true

--end tell

repeat with w from 1 to 3 -- je veux 3 connexions

tell window (windowCount + 1)

do script commandString

end tell

tell application "Terminal" to set current settings of first window to settings set 7

  

--settings 7 = my colors and ISO-8859-1ISO Latin-1 encoding and police 16 pt

tell front window

set zoomed to true

-- Je veux que mes 3 fenêtres soient maximizées et occupent tout l'écran

end tell

end repeat

else

repeat with w from 1 to 3

tell window (windowCount + 1)

do script commandString

end tell

tell application "Terminal" to set current settings of first window to settings set 7

tell front window

set zoomed to true

end tell

end repeat

end if

end tell


*** Autre version, avec trois fenêtres disposées 1 full screen et 2 half screen ***

pour un écran de 1680 x 1050


property commandString : "ssh meteo@mars" -- < Edit this line as desired.


tell application "Terminal" -- Get a free window to run the commandString,

set windowCount to (count of the windows)

activate

if ((count of windows) is 1) then

close window 1

--tell window 1

-- set miniaturized to true

--end tell

repeat with w from 1 to 3

tell window (windowCount + 1)

do script commandString

end tell

tell application "Terminal" to set current settings of first window to settings set 7

tell front window

if w is 1 then

set zoomed to true

else

if w is 2 then

set position to {20, 22}

set size to {825, 960}

--properties

--tell application "Terminal" to set bounds of first window to {0, 0, 820, 975}

else

set position to {850, 22}

set size to {825, 960}

--properties

--tell application "Terminal" to set bounds of first window to {0, 670, 820, 975}

end if

end if

end tell

end repeat

else

repeat with w from 1 to 3

tell window (windowCount + 1)

do script commandString

end tell

tell application "Terminal" to set current settings of first window to settings set 7

tell front window

if w is 1 then

set zoomed to true

else

if w is 2 then

set position to {20, 22}

set size to {825, 960}

--properties

--tell application "Terminal" to set bounds of first window to {0, 0, 820, 975}

else

set position to {850, 22}

set size to {825, 960}

--properties

--tell application "Terminal" to set bounds of first window to {0, 670, 820, 975}

end if

end if

end tell

end repeat

end if

end tell


lundi 14 septembre 2009

vendredi 11 septembre 2009

GRANT ALL PRIVILEGES : MYSQL

Pour donner accès aux dB à un utilisateur :

Se logger comme root dans mysql

mysql -u root mysql -p

au prompt : password

puis

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;

flush privileges;

Pour vérifier :

SELECT user, host, password FROM user;

à la place de localhost = connection uniquement en local, on peut mettre % pour pouvoir se logger à distance.