Linux tips and tricks

Redirect while preserving the “back button” functionality in php
index.php:
<?php
header(“Location: http://www.hartvig.de”); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>
Batch rename files from htm to html
for file in *.htm ; do mv $file `echo $file | sed ‘s/\(.*\.\)htm/\1html/’` ; done
Control remote desktop with local keyboard and mouse
ssh -X 10.0.0.8 “x2x -west -to :0.”



