Skip to content

Instantly share code, notes, and snippets.

Avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / jfindfiles
Last active Mar 11, 2021
Find unused and used content files in your Joomla website
View jfindfiles
#!/bin/sh
# jfindfiles -- Find used and unused content files in your Joomla website
#
# This scripts supports Joomla versions 2.5 - 3.x
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#
@renekreijveld
renekreijveld / php.ini
Last active Mar 6, 2021
php.ini for local development, PHP 5.6
View php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@renekreijveld
renekreijveld / sphp
Last active Dec 23, 2020
Easy PHP version switching command-line script for devilbox
View sphp
#!/bin/bash
# sphp - Easy PHP version switching command-line script for devilbox
# Written by: René Kreijveld, email[at]renekreijveld.nl
# Version
version=1.1
# Available PHP versions in devilbox
php_array=(5.2 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0)
# Devilbox folder
devilbox=/Users/yourusername/devilbox
@renekreijveld
renekreijveld / clidemo_3.2.php
Last active Oct 6, 2020
Example CLI script for Joomla 3,2
View clidemo_3.2.php
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Joomla 3.2 example CLI script
* Written by: Rene Kreijveld, email [at] renekreijveld.nl
* 05-feb-2014
@renekreijveld
renekreijveld / listupdates.php
Last active Sep 26, 2020
List extension updates
View listupdates.php
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2016 Rene Kreijveld, All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is a script which should be called from the command-line, not the web.
View .bash_profile
HOST_NAME=macmini
shopt -s autocd
shopt -s histappend
export PATH=$PATH:$HOME/bin
export HISTSIZE=5000
export HISTFILESIZE=10000
@renekreijveld
renekreijveld / jnewfiles
Last active Dec 28, 2019
Bash script to detect new and changed php and html files last 3 hours. Skips cache directories.
View jnewfiles
#!/bin/sh
# jnewfiles
# Detects new and changed php and html files last xxx minutes
# (C) 2014 Rene Kreijveld, enail [at] renekreijveld [dot] nl
# Update 31-12-2013: only send email when changes are found
# Update 04-02-2014: check for new files last three hours
# Update 05-05-2014: check for new html files also
# Update 07-05-2014: filter out ju_chached and DirectAdmin stats folders in html files
@renekreijveld
renekreijveld / yearlist.php
Last active Sep 9, 2019
Custom form field to create a select list with year numbers
View yearlist.php
<?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 Aug 14, 2018
Add this code snippet to .htaccess of your Joomla website after RewriteEngine On
View No WordPress urls allowd in Joomla
## 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 Aug 7, 2019
Dump a Joomla database to sql file.
View jdbdump
#!/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.
#