martedì 26 ottobre 2010

Eliminare e ricreare un md device (RAID 1 software)

A volte capita di dover cambiare la configurazione dei device md sul software raid


Cancellare un device MD


mdadm --manage /dev/mdfoo --fail /dev/sdfoo
mdadm --manage /dev/mdfoo --remove /dev/sdfoo
mdadm --manage --stop /dev/mdfoo


Ricrearlo

mdadm --create --level=1 --raid-devices=2 /dev/md2 /dev/sda3 /dev/sdb3


Rifare il file di configurazione

echo DEVICE partitions > /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf
/sbin/mdadm --assemble --scan

giovedì 14 ottobre 2010

WD vs linux

Gli hard disk WD Green hanno una caratteristica interessante di mettere a riposo le testine dopo 8 secondi di non utilizzo.

Questo fa risparmiare energia (Green) ma non va molto d'accordo con Linux.... che fa in modo che ogni minuto l'hard disk vada i modalità di risparmio energetico 3 volte al minuto usurando la meccanica del disco e andando fuori parametro S.M.A.R.T. nel giro di soli 10 mesi circa.

Per visualizzare il parametro:
smartctl --all /dev/sda | grep Load_Cycle


Per ovviare a questo problema WD è venuta incontro con un'utility chiamada wdidle3 che permette di settare il tempo di idle dopo il quale mandare a riposo il disco.

Utilizzando l'opzione wdidle3 /D viene disabilitata la modalità di ilde del disco.


Si consumerà di più energia ma il disco non si usura. !!!




martedì 5 ottobre 2010

RICERCA FIREFOX

COME CONFIGURARE LA BARRA DI RICERCA CON FIREFOX


http://www.rakshitk.com/blog/2008/05/13/how-to-configure-firefox-address-bar-with-search-engines/


martedì 7 settembre 2010

Come cambiare i permessi di directory o files ricorsivamente

Recursively chmod directories only

June 19th, 2006

find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir 'dot') and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;



Cerchi qualcosa ? (un file che contiene una certa stringa ?)

Grep all files in a directory for a string

grep -i -r somestring ./

-i means ignore case
-r means recursive

Simple stuff, but useful nonetheless.


from
http://movabletripe.com/

venerdì 3 settembre 2010

JQuery UI Vs Tool (alias una poltrona per due)

Far convivere JQuery UI e JQuery Tool


Queste due ottime librerie apparentemente non possono essere usate contemporaneamente... in realtà il problema a quanto pare sta solo nel tabs. Quindi una soluzione che per ora sembra funzionare è quella di non includere i tab in una delle due librerie.

mercoledì 1 settembre 2010

Mdadm spedisce una mail quando un md device fallisce

Getting E-mail notifications when MD devices fail

I use the MD (multiple device) logical volume manager to mirror the boot devices on the Linux servers I support. When I first started using MD, the mdadm utility was not available to manage and monitor MD devices. Since disk failures are relatively common in large shops, I used the shell script from my SysAdmin article Monitoring and Managing Linux Software RAID to send E-mail when a device entered the failed state. While reading through the mdadm(8) manual page, I came across the "–monitor" and "–mail" options. These options can be used to monitor the operational state of the MD devices in a server, and generate E-mail notifications if a problem is detected. E-mail notification support can be enabled by running mdadm with the "–monitor" option to monitor devices, the "–daemonise" option to create a daemon process, and the "–mail" option to generate E-mail:

$ /sbin/mdadm --monitor --scan --daemonise --mail=root@localhost

Once mdadm is daemonized, an E-mail similar to the following will be sent each time a failure is detected:

From: mdadm monitoring 
To: root@localhost.localdomain
Subject: Fail event on /dev/md1:biscuit

This is an automatically generated mail message from mdadm
running on biscuit

A Fail event had been detected on md device /dev/md1.

Faithfully yours, etc.

preso da http://prefetch.net/blog/index.php/2006/08/20/getting-e-mail-notifications-when-md-devices-fail/