Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / yearlist.php
Last active September 9, 2019 08:11
Custom form field to create a select list with year numbers
<?php
/**
* @version 1.0.0
* @author Rene Kreijveld <r.kreijveld@dsd.nl>
* @copyright 2019 DSD Business Internet
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Example form xml definition:
* <field name="established"
* type="yearlist"
@renekreijveld
renekreijveld / No WordPress urls allowd in Joomla
Created August 14, 2018 13:46
Add this code snippet to .htaccess of your Joomla website after RewriteEngine On
## Redirect WordPress attempts - BEGIN
Redirect 301 /wp-login.php http://127.0.0.1/wp-login.php
Redirect 301 /wp-admin.php http://127.0.0.1/wp-admin.php
RewriteRule ^wp-content(.*)$ http://127.0.0.1/$1 [L,R=301]
RewriteRule ^wp-admin(.*)$ http://127.0.0.1/$1 [L,R=301]
## Redirect WordPress attempts - END
@renekreijveld
renekreijveld / jdbdump
Last active August 7, 2019 08:15
Dump a Joomla database to sql file.
#!/bin/sh
# jdbdump -- Dump a Joomla database to sql file.
#
# This scripts supports Joomla versions 1.0 - 3.3
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#
@renekreijveld
renekreijveld / gist:bef15b0045327c23e64894bcb48d3794
Created September 2, 2016 08:10
Repair non-working phpMyAdmin in MAMP PRO 4 for OSX
# Open Terminal on your Mac and do the following:
cd "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
cp -R /Applications/MAMP/bin/phpMyAdmin/* .
#!/bin/sh
# findjoomlas -- Find Joomla instances on your (DirectAdmin based) server.
# Supports Joomla versions 1.0/1.5/1.6/1.7/2.5/3.0/3.1/3.2/3.2
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
# Define variables
#!/bin/sh
# jbackup -- Create a full backup (including database) of a Joomla website to .tgz file.
# Supports Joomla 1.0 - 3.3
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#
# Warning! This script needs the file joomlafunctions. This has to be installed in the same directory as this script.
#!/bin/sh
# jrestore - Restore a local site backup
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
# General variables
VERSION=1.0
@renekreijveld
renekreijveld / jbackupstore
Created July 3, 2014 11:22
Create a full backup of a Joomla website to tar gzip file and store in backup directory
#!/bin/sh
# jbackupstore -- Create a full backup of a Joomla website to tar gzip file and store in backup directory
#
# Copyright 2012 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#
# Warning! This script needs the file joomlafunctions. This has to be installed in the same directory as this script.
#
@renekreijveld
renekreijveld / jfunctions
Last active June 12, 2018 07:22
General bash functions for use in jooma scripts
#!/bin/sh
# jfunctions - general bash functions for use in Joomla bash scripts
# Supports Joomla versions 2.5 - 3.x
#
# Copyright 2014 - 2016 Rene Kreijveld - r.kreijveld@dsd.nu
#
# This program is free software; you may redistribute it and/or modify it.
#
# Version history
@renekreijveld
renekreijveld / dbbackup
Last active February 22, 2018 01:14
Create a backup of all your MySQL databases
#!/bin/sh
# dbbackup - Create a backup of all your MySQL databases
#
# Copyright 2011 Rene Kreijveld - r.kreijveld@gakijken.nl
#
# This program is free software; you may redistribute it and/or modify it.
NOW=$(date +"%Y%m%d-%H%M%S")
DBCONF=/usr/local/directadmin/conf/mysql.conf