Skip to content

Instantly share code, notes, and snippets.

View douglascrp's full-sized avatar

Douglas C. R. Paes douglascrp

View GitHub Profile
@douglascrp
douglascrp / refresh-tags-count.js
Last active March 30, 2017 12:54
How to update the tags count in a folder
// using the javascript console, in the folder where the count is wrong, execute the code
var refresh = actions.create('refresh-tagscope');
refresh.execute(document);
@douglascrp
douglascrp / configure alfresco tomcat memory on windows.txt
Created April 12, 2017 21:42
How to configure Tomcat memory in Windows
Inside Alfresco's installation folder:
<alfresco>/tomcat/bin
Execute
alfrescoTomcatw.exe //ES//alfrescoTomcat
In the dialog shown, configure memory as needed.
@douglascrp
douglascrp / gist:8d4c9b04d33ccb2cfda0f9a5bd565ed2
Created April 19, 2017 03:27
Tips on multi-value advanced search
http://muras.eu/2013/04/21/Multi-valued-search-in-Alfresco/
http://smasue.github.io/alf-debug-solr
In your log4j.properties:
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug
@douglascrp
douglascrp / Solr indexing status.txt
Created May 6, 2017 02:08
How to follow the indexing status with Solr 1.4
To ask SOLR how is indexing going try this url:
/solr/admin/cores?action=SUMMARY&wt=xml
Most interesting values here are:
<long name="Approx transactions remaining">0</long>
<str name="Approx transaction indexing time remaining">0 Seconds</str>
which tell how much work SOLR thinks it has to do.
@douglascrp
douglascrp / How to disable alfresco policy using javascript.js
Last active March 11, 2024 03:00
Disable alfresco policy in Javascript.js
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var model = Packages.br.com.dgcloud.model.CustomerXModel;
var policyBehaviourFilter = context.getBean('policyBehaviourFilter', Packages.org.alfresco.repo.policy.BehaviourFilter);
try {
policyBehaviourFilter.disableBehaviour(node.nodeRef, model.TYPE_DOCUMENT_EMPLOYEE_QNAME);
// your code here
} finally {
@douglascrp
douglascrp / Alfresco Community with JODConverter Install Guide.txt
Last active September 28, 2017 12:13
Installing jod on Ubuntu. Based on the Docker configuration available at https://bitbucket.org/xenit/docker-jodconverter-ws
Install Oracle JDK7
cd /opt
wget -O jod-tomcat.zip 'http://sourceforge.net/projects/jodconverter/files/JODConverter/2.2.2/jodconverter-tomcat-2.2.2.zip/download'
#unzip jod-tomcat.zip -d /usr/local/src
unzip jod-tomcat.zip -d /opt
# edit /opt/jodconverter-tomcat-2.2.2/bin/catalina.sh and make sure the JAVA_HOME variable points to the JDK 7
# Example: JAVA_HOME=/usr/lib/jvm/java-7-oracle
@douglascrp
douglascrp / How to set ubuntu date.txt
Last active June 23, 2017 19:01
How to correctly set date on Ubuntu
You can set the system date with this command:
sudo date --set="2015-09-30 10:05:59.990"
Then when using date, it should be showed correctly.
Now you should also the set hardware clock in the BIOS of the system, that the setting persists over a reboot (dureing the startup the system time is set to the value of the hardware clock). Do that with hwclock:
sudo hwclock --systohc
This gets the system clocks (sys) value and sets the hardware clock (hc). Check it with the hwclock command. Both hwclock and date should now show the same date and time.
@douglascrp
douglascrp / alfresco-backup.bat
Last active May 3, 2021 10:25
A simple incremental backup script for Alfresco on Windows
set dt=%date:~6,2%-%date:~3,2%-%date:~0,2%
set bkp_db_log=%dt%_backup_banco.log
set bkp_fs_log=%dt%_backup_conteudo.log
set bkp_install_log=%dt%_backup_install.log
robocopy E:\alfresco\amps "G:\BACKUP GED\install\amps" /MIR /W:20 /R:15 /LOG+:"G:\BACKUP GED\%bkp_install_log%"
robocopy E:\alfresco\amps_share "G:\BACKUP GED\install\amps_share" /MIR /W:20 /R:15 /LOG+:"G:\BACKUP GED\%bkp_install_log%"
robocopy E:\alfresco\tomcat\shared "G:\BACKUP GED\install\shared" /MIR /W:20 /R:15 /LOG+:"G:\BACKUP GED\%bkp_install_log%"
robocopy E:\alfresco\tomcat\webapps "G:\BACKUP GED\install\webapps" alfresco.war share.war /LOG+:"G:\BACKUP GED\%bkp_install_log%"
@douglascrp
douglascrp / alfresco logs analysis.txt
Last active October 20, 2020 12:37
Some useful commands to help analyse logs and understand what is going on with your Alfresco server
How to get a list errors:
=========================
cat catalina.out | egrep "(WARN|ERROR|Caused by)" | uniq > output.txt
How to count the errors by type:
================================
$ grep ERROR solr.log| awk '{print $4}'| sort | uniq -c
63 [org.alfresco.solr.tracker.AbstractTracker]
135 [org.apache.solr.core.SolrCore]
@douglascrp
douglascrp / restart-unity-panel-service
Created August 25, 2017 14:52
Restart the Ubuntu Unity Panel bar
initctl restart unity-panel-service