fév 182011
 

A mettre dans votre Bashrc.

<span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-cks</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-rn</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">size</span> fname; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">for</span> unit <span style="color: #000000; font-weight: bold;">in</span> k M G T P E Z Y; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$size</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">1024</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;      <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${size}</span><span style="color: #007800;">${unit}</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #007800;">${fname}</span>&quot;</span>;      <span style="color: #7a0874; font-weight: bold;">break</span>;      <span style="color: #000000; font-weight: bold;">fi</span>;      <span style="color: #007800;">size</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>size<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;     <span style="color: #000000; font-weight: bold;">done</span>; <span style="color: #000000; font-weight: bold;">done</span>

Ceci n’a pas la puissance de NCDU mais est bien utile pour le répertoire courant.

 

Pour connaitre la taille d’une table ou d’une de vos bases MySQL en ligne de commande. J’avais pas

Alors pour la taille de toutes les bases :

SELECT table_schema <span style="color: #ff0000;">&quot;Databases&quot;</span>, <span style="color: #c20cb9; font-weight: bold;">sum</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> data_length + index_length<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #ff0000;">&quot;Size of DB in MB&quot;</span> FROM information_schema. TABLES GROUP BY table_schema;

Pour la taille d’une base :

SELECT table_schema <span style="color: #ff0000;">&quot;Database&quot;</span>, <span style="color: #c20cb9; font-weight: bold;">sum</span><span style="color: #7a0874; font-weight: bold;">&#40;</span> data_length + index_length<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #ff0000;">&quot;Size of DB in MB&quot;</span> FROM information_schema. TABLES WHERE table_schema = <span style="color: #ff0000;">&quot;DBNAME&quot;</span> GROUP BY table_schema;

La taille de toutes les tables d’une base :

SELECT table_name AS <span style="color: #ff0000;">&quot;Tables&quot;</span>, round<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>data_length + index_length<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot;Size in MB&quot;</span> FROM information_schema. TABLES WHERE table_schema = <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DB_NAME</span>&quot;</span>;

et la taille d’une table d’une base :

SELECT table_name AS <span style="color: #ff0000;">&quot;Table&quot;</span>, round<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>data_length + index_length<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot;Size in MB&quot;</span> FROM information_schema. TABLES WHERE table_schema = <span style="color: #ff0000;">&quot;DBNAMEE&quot;</span> AND table_name = <span style="color: #ff0000;">&quot;TABLENAME&quot;</span>;
 

La sécurité étant un sujet im.por.tant voici quelque tips et consignes concernant GNU Screen pour vous éviter des problème avec de cohabitation sur des comptes user partagés.

Nommer vos screen !

<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-S</span> toto.sql

Protéger vos screen avec un password !

Ctrl+A :password <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #7a0874; font-weight: bold;">return</span><span style="color: #000000; font-weight: bold;">&gt;</span>

Dé-protéger vos screen avec un password !

Ctrl+A :password none

Vous oubliez votre mot de passe ? Vous killer le pid

<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span> 	<span style="color: #000000;">1259</span>.toto.sql    <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-9</span>  <span style="color: #000000;">1259</span>

De cette façon vos screen vous appartiennes vraiment, sont identifiable et protéger.

 

Pour supprimer tout les messages en attente d’envois dans la queue Postfix

postsuper <span style="color: #660033;">-d</span> ALL

J’oublie tout le temps :D

 

Pour vider le cache DNS de votre Mac il vous faut utiliser la console et lancer la commande suivante

dscacheutil <span style="color: #660033;">-flushcache</span>

et hop

© 2012 Karlesnine Suffusion theme by Sayontan Sinha