Skip to content

Instantly share code, notes, and snippets.

@seebk
seebk / rsync_backup.py
Last active December 11, 2023 16:34
Python rsync backup script
#!/usr/bin/python3
#######################################################
# Python rsync Backup script
# Sebastian Kraft, 24.06.2013
#
#######################################################
#-----------------------------------------------------
# Config
@escopecz
escopecz / commands.php
Last active April 18, 2023 22:43 — forked from alanhartless/cron.php
Script to run Mautic (https://mautic.org) commands from a URL.
<?php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
die;
}
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$allowedTasks = array(
'cache:clear',
#!/bin/sh
#
# This script is used on a QNAP TS-269 PRO. https://www.en0ch.se/qnap-and-rsync/
#
# You have to change:
# 1. $SHAREUSR
# 2. $EXCLUDES (if you want o change the name of the file servername.excludes)
# 3. $SOURCE & $DESTINATION
# 4. user@yourserver.se for the mysqldump
# 5. --password=SUPERSECRET
@drmmr763
drmmr763 / user.sql
Created April 1, 2015 15:16
mautic user
INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`)
VALUES
(2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', 'user@local.host', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;');
@2dpi
2dpi / gist:4130110
Created November 22, 2012 09:08
SEBLOD: Importer readme
SEBLOD Importer
========================================
- create/open CSV file (use first row for column titles to make editing easier)
- NB! make sure the following columns exist (id, title, catid)
-- id (joomla core auto increment if not specified)
-- title (if not specified timestamp will be used)
-- catid (set a default category else will be save as uncategorised)
-- OPTIONAL - ADD ANY OTHER ARTICLE COLUMNS
- match existing exclusive columns (i.e. LOCKED -TABLE: cck_store_form_your_content_type - storage [standard - article - field_name])
@woogist
woogist / functions.php
Last active December 25, 2015 05:29
Place in your theme’s functions.php file or custom plugin. Will only allow customers to checkout is their cart total is greater than 50.
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
global $woocommerce;
$minimum = 10;
if ( $woocommerce->cart->get_cart_total() < $minimum ) {
$woocommerce->add_error( sprintf( 'You must have an order with a minimum of %s to place your order.' , $minimum ) );
}
}
<select name="Provinces" id="Provinces">
<option selected="selected">Please select</option>
<option value="Eastern Cape" id="EasternCape">Eastern Cape</option>
<option value="Free State" id="FreeState">Free State</option>
<option value="Gauteng" id="Gauteng">Gauteng</option>
<option value="KwaZulu-Natal" id="KwaZulu-Natal">KwaZulu-Natal</option>
<option value="Limpopo" id="Limpopo">Limpopo</option>
<option value="Mpumalanga" id="Mpumalanga">Mpumalanga</option>
<option value="Northern Cape" id="NorthernCape">Northern Cape</option>
<option value="North West" id="NorthWest">North West</option>