Skip to content

Instantly share code, notes, and snippets.

@CesarCapillas
CesarCapillas / cleanAlfPropTables-MySQL.sql
Created June 24, 2018 17:43
SQL script for properly clearing Alfresco unused audit data / property values (NOT node properties, but the property tables used for AuditComponent and AttributeService functionality) for PostgreSQL / MySQL.NOTE: Only run when the Alfresco Repository is NOT running as values kept in in-memory caches will otherwise result in constraint violations.
set autocommit=0;
begin;
-- get all active references to alf_prop_root
create temporary table temp1 (id bigint(20), index (id));
insert into temp1 select disabled_paths_id as id from alf_audit_app;
insert into temp1 select audit_values_id as id from alf_audit_entry;
insert into temp1 select prop1_id as id from alf_prop_unique_ctx;
-- determine the obsolete entries from alf_prop_root
@CesarCapillas
CesarCapillas / gist:d3317213413f2913d99e2a301cad0ce0
Created March 4, 2018 19:54 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
/**
* Script to locate error nodes from solr error report, and do something with them.
*
* @author Younes Regaieg <younes.regaieg@xenit.eu>
* @version 1.0
**/
//----- Solr error report to be fetched from solr /solr4/alfresco/query?q=EXCEPTIONMESSAGE:*&wt=json&rows=<number-of-rows-to-fetch>
//----- Swap this dummy object with a real object from the output of the endpoint mentionned above.
var solrErrorsReport = {