Skip to content

Instantly share code, notes, and snippets.

@aurmil
aurmil / backup_cwrsync.cmd
Last active February 26, 2022 07:47
Backup batch script using cwRsync
@ECHO OFF
REM *****************************************************************
REM
REM CWRSYNC.CMD - Batch file template to start your rsync command (s).
REM
REM *****************************************************************
REM Make environment variable changes local to this batch file
SETLOCAL
@aurmil
aurmil / backup.php
Created July 27, 2020 05:22
Scheduled backup script
<?php
class Backup
{
protected $logFilePath;
public function __construct($logFilePath)
{
$this->logFilePath = $logFilePath;
}
function getBaseUrl($includeTrailingSlash = FALSE)
{
$protocol = (isset($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS']) ? 'https' : 'http';
$domain = php_uname('n');
$port = '';
if (isset($_SERVER['HTTP_HOST'])) {
$domain = filter_input(
INPUT_SERVER,
'HTTP_HOST',
@aurmil
aurmil / gcd.php
Created July 28, 2018 09:32
PHP : GCD
<?php
/**
* Calculate Greatest Common Divisor of 2 integers.
* The result is always positive even if either of, or both, input operands are negative.
*
* @param int $a
* @param int $b
* @return int
*/
@aurmil
aurmil / Vagrantfile
Created July 23, 2018 09:55
Vagrant box based on Ubuntu 18.04 with Apache 2.4 + mod_rewrite ; PHP 7.2 + composer ; MariaDB 10 ; git, node, npm, bower, yarn
# -*- mode: ruby -*-
# vi: set ft=ruby :
# author Aurélien Millet
# license MIT
# configuration
time_zone = "Europe/Paris"
Vagrant.configure("2") do |config|
@aurmil
aurmil / svn-update.bat
Created June 21, 2018 07:09
Update all SVN projects in a folder
@ECHO off
SETLOCAL enabledelayedexpansion
SET svnFolders=
FOR /D %%G IN ("C:\Users\xyz\Documents\abcd\*") DO (
IF EXIST %%G"\.svn" (
SET svnFolders=!svnFolders!%%G*
)
@aurmil
aurmil / Vagrantfile
Last active July 23, 2018 09:07
Vagrant box based on Debian 8 with Apache 2.4 + mod_rewrite ; PHP 5.6 + composer ; MySQL 5.5 ; git, node, npm, bower, yarn
# -*- mode: ruby -*-
# vi: set ft=ruby :
# author Aurélien Millet
# license MIT
# configuration
time_zone = "Europe/Paris"
Vagrant.configure("2") do |config|