Skip to content

Instantly share code, notes, and snippets.

<?php
// Get parameters
$arguments = $_SERVER['argv'];
array_shift($arguments);
if (empty($arguments)) {
die("File path is undefined\n");
}
$filePath = array_shift($arguments);
if (!is_file($filePath)) {
die("File not found : $filePath\n");
$image = file_get_contents('/path/to/file');
$base64 = base64_encode($image);
echo 'data:image/png;base64,'.$base64."\n";
#!/bin/bash
snapshotDir=/path/to/backup/dir
if [ -d $snapshotDir/daily.2 ]
then
rm -rf $snapshotDir/daily.2
fi
if [ -d $snapshotDir/daily.1 ]
#!/bin/bash
source=myLogin@hostname:
snapshotDir=/path/to/backup/dir
if [ -d $snapshotDir/hourly.3 ]
then
rm -rf $snapshotDir/hourly.3
fi