Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / sphp
Last active January 10, 2024 15:54
Easy PHP version switching command-line script for devilbox
#!/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 / listusers.php
Last active March 15, 2023 09:17
Simple Joomla 4 CLI script
<?php
// listusers.php - simple cli script to dump users on CLI
// Written by René Kreijveld
// Version history:
// 1.0, 2023-03-09: Initial version
use Joomla\CMS\Factory;
const _JEXEC = 1;
@renekreijveld
renekreijveld / clidemo_3.2.php
Last active October 24, 2022 03:00
Example CLI script for Joomla 3,2
<?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 / rsformprocleanup.php
Last active September 23, 2022 09:21
RSForm!Pro cleanup old submissions
<?php
/**
* @package RSFormCleanUp
* @copyright Copyright 2018 René Kreijveld, DSD Business Internet.
* @license GNU General Public License version 2 or later.
*/
/**
* A command line cron job to remove submission data from RSFormPro database tables.
* Based on the excellent work of Peter Martin, db8.nl, see https://gist.github.com/pe7er/47bf1020b12ef29df8603fa80d1fdccd
@renekreijveld
renekreijveld / jnewfiles
Last active May 17, 2022 15:32
Bash script to detect new and changed php and html files last 3 hours. Skips cache directories.
#!/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 / joomlaupdate
Last active September 17, 2021 13:12
This bash script will update your Joomla 2.5/3.1 website to the latest Joomla version. It does this by automatically downloading the correct update zipfile from Joomla.org. The script also executes the sql update commads (if needed). If specified joomlaupdate will make a backup of your website and database before updating. Joomlaupdate can also …
#!/bin/sh
# joomlaupdate
# Updates your Joomla 2.5/3.1 website to the latest version.
#
# Usage: joomlaupdate [-s] [-b] [-h] [-l]
#
# Default action is verbose on, no backup.
# -s Silent. Do not display any informational messages.
# -b Backup. Create a backup before updating.
@renekreijveld
renekreijveld / cleanjoomla
Last active August 26, 2021 07:03
Bash script to cleanup all Joomla files and folders
#!/bin/bash
# cleanjoomla -- Script to delete all Joomla files and folders
#
# This scripts supports Joomla versions 2.5 - 3.x
#
# Copyright 2021 Rene Kreijveld - email@renekreijveld.nl
# This program is free software; you may redistribute it and/or modify it.
#
# Version history
@renekreijveld
renekreijveld / jfindfiles
Last active March 11, 2021 07:03
Find unused and used content files in your Joomla website
#!/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 / listupdates.php
Last active September 26, 2020 19:38
List extension updates
<?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.
@renekreijveld
renekreijveld / .bash_profile
Created April 23, 2020 07:19
Bash profile
HOST_NAME=macmini
shopt -s autocd
shopt -s histappend
export PATH=$PATH:$HOME/bin
export HISTSIZE=5000
export HISTFILESIZE=10000