PHPInfo in Bootstrap Style

Einfach in den Body der Bootstrap Seite reinkopieren.
<?php
ob_start();
phpinfo();
$phpinfo = ob_get_clean();

# Body-Content rausholen
$phpinfo = preg_replace('#^.*<body>(.*)</body>.*$#s', '$1', $phpinfo);
# XHTML-Fehler korrigieren
$phpinfo = str_replace('module_Zend Optimizer', 'module_Zend_Optimizer', $phpinfo);
# <font> durch <span> ersetzen
$phpinfo = str_replace('<font', '<span', $phpinfo);
$phpinfo = str_replace('</font>', '</span>', $phpinfo);
#Table
$phpinfo = str_replace( 'border="0" cellpadding="3"', 'class="table table-bordered table-striped" style="table-layout: fixed;word-wrap: break-word;"', $phpinfo );
$phpinfo = str_replace('<tr class="h"><th>', '<thead><tr><th>', $phpinfo);
$phpinfo = str_replace('</th></tr>', '</th></tr></thead><tbody>', $phpinfo);
$phpinfo = str_replace('</table>', '</tbody></table>', $phpinfo);
# Schlüsselwörter grün oder rot einfärben
$phpinfo = preg_replace('#>(on|enabled|active)#i', '><span class="text-success">$1</span>', $phpinfo);
$phpinfo = preg_replace('#>(off|disabled)#i', '><span class="text-error">$1</span>', $phpinfo);

echo '<div id="phpinfo">';
echo $phpinfo;
echo '</div>';
?>

Copy Image via netcat

This is for a High-Bandwidth Network. If you have a Low-Bandwidth Network you can try to switch lzo with bzip2.

Target:
nc -v -l -p 19000 | lzop -c -d | pv -s 70G | dd bs=16M of=/root/foo.img

  1. listen on port 19000 for connections.
  2. decompress the datapackages.
  3. pv displays a status bar.
  4. and wirte them into a file.

Source:
dd bs=16M if=/root/bar.img | lzop -3 -c | nc -v 10.0.01 19000

  1. dd reads the file in 16MB Blocks.
  2. each block will be compressed with lzo.
  3. nc connects 10.0.01 on port 19000 and pushes data.

mdadm Software Raid

Kaputte Platte entfernen:

mdadm /dev/md0 --remove /dev/sda1

Neue Platte rein und Partionierung Syncen:

sfdisk -d /dev/sdb | sfdisk /dev/sda

Platte Raid hinzufügen:

mdadm /dev/md0 --add /dev/sda1

Raid sync verschnellern:

echo 100000 >/proc/sys/dev/raid/speed_limit_min

Raid1 spare Platten aktivieren:

mdadm --grow --raid-devices=3 /dev/md0

Festplatteninfo anzeigen:

hdparm -I /dev/sd*

Raid resync DELAYED

echo idle > /sys/block/md0/md/sync_action

Raid md0 auf Konsistenz prüfen

echo check > /sys/block/md0/md/sync_action