This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script will output dumps for all databases using seperate files | |
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/ | |
USER="local_backup_script" | |
PASSWORD="LocalBackupScript#429" | |
HOST="localhost" | |
MYSQL="$(which mysql)" | |
MYSQLDUMP="$(which mysqldump)" | |
GZIP="$(which gzip)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OWNER="drpepper" | |
GROUP="administrators" | |
PUBLICDIRECTORY="" | |
# used by crontab | |
MAXLOGAGE="7 days" | |
MAXLOCKAGE="4 hours" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* File System Functions | |
* | |
* File System Abstraction which automatically | |
* works in a given root path | |
* | |
* Can be added with composer by adding a composer.json file with: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class cleanUp | |
{ | |
static public function folder(string $folder, string $fileRegEx, int $days, bool $recusive = true): int | |
{ | |
$count = 0; | |
if (!\FS::file_exists($folder)) { | |
throw new \Exception('Folder "' . $folder . '" not found.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bash Shell Find Out If a Variable Is Empty Or Not | |
Let us see syntax and examples in details. The syntax is as follows for if command: | |
if [ -z "$var" ] | |
then | |
echo "\$var is empty" | |
else | |
echo "\$var is NOT empty" | |
fi | |
OR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function base62_encode($num) { | |
$b = 62; | |
$base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$r = $num % $b ; | |
$res = $base[$r]; | |
$q = floor($num/$b); | |
while ($q) { | |
$r = $q % $b; | |
$q = floor($q/$b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Gulp | |
https://nodejs.org/en/ | |
* Install Node | |
Node.js v12.16.1 to /usr/local/bin/node | |
npm v6.13.4 to /usr/local/bin/npm | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class readCsv implements Iterator | |
{ | |
const ROW_SIZE = 8192; | |
protected $handle = NULL; | |
protected $currentRow = NULL; | |
protected $rowCounter = NULL; | |
protected $hasHeader = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
/** | |
* File System Functions | |
* | |
* File System Abstraction which automatically | |
* works in a given root path | |
* |
OlderNewer