Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / listupdates
Last active February 22, 2018 00:48
Bash script to find all Joomla extension updates in all Joomla instances on a DirectAdmin based server
#!/bin/sh
# listupdates -- Find Joomla instances and show all extension updates
#
# Copyright 2016 Rene Kreijveld - r.kreijveld@dsd.nu
#
# This program is free software; you may redistribute it and/or modify it.
#
# Version history
# 1.0 Initial version
@renekreijveld
renekreijveld / sitesinfo.php
Last active February 22, 2018 00:50
Watchful.li site overview through API
<?php
/**
* @package Watchful.li siteoverzicht
* @author Rene Kreijveld, based on the original work of Watchful.li
* @authorUrl https://about.me/renekreijveld
* @copyright (c) 2016, Rene Kreijveld
*/
//Config
define('API_KEY', 'plaats-jouw-watchful.li-api-key-hier');
@renekreijveld
renekreijveld / joomlaqueries.php
Last active February 22, 2018 00:51
DB queries
<?php
// Select record, all fields
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__table'))
->where($db->quoteName('id') . ' = '. (int) $searchId);
$db->setQuery($query);
$results = $db->loadObjectlist();
// Select record, specific fields
@renekreijveld
renekreijveld / logic.php
Last active February 22, 2018 01:09
Logic.php to include in Joomla 3.x templates
<?php
// Template by DSD business internet // www.gakijken.nl //
defined('_JEXEC') or die;
// Connect with Joomla
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$session = JFactory::getSession();
// Get variables
@renekreijveld
renekreijveld / findlargefiles
Created August 13, 2014 13:15
Find all image files with a resolution wider then a given width.
#!/bin/sh
# findlargefiles - Find all image files with a resolution wider then a given width.
# 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.
# Define general variables
#!/bin/sh
# joomlainfo -- Provide information about this Joomla! installation.
# 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.
@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
@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 / 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.
#
#!/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