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 / extract-metadata.js
Created October 23, 2024 20:07
Alfresco extract metadata action
var em = actions.create("extract-metadata");
em.execute(document);
@douglascrp
douglascrp / media_download
Created July 26, 2023 17:14
Media download
youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 <Video-URL>
@douglascrp
douglascrp / Some docker useful resources
Last active October 28, 2024 13:54
Some docker useful resources
Forcing the latest image's version before starting the containers
docker compose pull
Rebuilding all the containers with docker-compose
docker-compose up --build --force-recreate -d
Rebuild a single container with docker-compose
docker-compose up -d --force-recreate --no-deps --build <service_name>
@douglascrp
douglascrp / How to install ActiveMQ on Ubuntu
Last active March 24, 2022 11:09
How to install ActiveMq on Ubuntu
cd /tmp
wget http://archive.apache.org/dist/activemq/5.15.8/apache-activemq-5.15.8-bin.tar.gz
tar -xvzf apache-activemq-5.15.8-bin.tar.gz
sudo mv apache-activemq-5.15.8 /opt/activemq
sudo addgroup --quiet --system activemq
sudo adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq
sudo chown -R activemq:activemq /opt/activemq
@douglascrp
douglascrp / ldap sync fail fix.js
Created December 2, 2021 19:15
LDAP sync fail: Job DEFAULT.ldapPeopleJobDetail threw an unhandled Exception: org.springframework.dao.DataIntegrityViolationException: No property value exists for ID
// from https://hub.alfresco.com/t5/alfresco-content-services-forum/ldap-sync-fails-after-cleanalfproptablespostexec-sql/m-p/40015/highlight/true#M2224
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var SyncStatus = Packages.org.alfresco.repo.security.sync.SyncStatus;
var attributeService = context.getBean('attributeService', Packages.org.alfresco.service.cmr.attributes.AttributeService);
var ROOT_ATTRIBUTE_PATH = ".ChainingUserRegistrySynchronizer";
var STATUS_ATTRIBUTE = "STATUS";
var SUMMARY_ATTRIBUTE = "SUMMARY";
var zone = "ldap1";
@douglascrp
douglascrp / listAndRemoveSavedAttributes.js
Last active August 10, 2022 20:12
Using Alfresco's AttributeService with javascript
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var attributeService = context.getBean("attributeService", Packages.org.alfresco.repo.attributes.AttributeServiceImpl);
attributeService.getAttributes(function(id, value, keys) {
logger.warn("id: " + id + " - key: " + keys[0] + " - " + keys[1] + " - value: " + value);
if (keys[0] == "project-repo.sequencial.documentos.operacoes") {
attributeService.removeAttribute([keys[0], keys[1]]);
}
@douglascrp
douglascrp / flowable config
Last active July 27, 2022 13:53
Install and configure postfix on ubuntu
flowable.mail.server.host=localhost
flowable.mail.server.port=25
flowable.mail.server.username=email
flowable.mail.server.password=password
flowable.mail.server.default-from=email
@douglascrp
douglascrp / node-ubuntu-upstart-service.md
Created September 15, 2020 12:28 — forked from willrstern/node-ubuntu-upstart-service.md
Run Node.js App as Ubuntu Upstart Service

###The Issue With Forever Forever is great for running node services, with a minor setback: the word "forever" doesn't apply to system reboots.

###The solution, run node apps as a system service logged in as root

vim /etc/init/node-app.conf

Contents for node-app.conf

Atualização do tesseract para 4.0
sudo add-apt-repository ppa:alex-p/tesseract-ocr
sudo apt-get update
sudo apt-get upgrade
Intalação dos dados para português
apt-get install tesseract-ocr-por
@douglascrp
douglascrp / alfresco admin aliases for linux
Last active September 29, 2023 16:57
Linux Alfresco aliases
vim ~/.bashrc
Replace:
alias ll with "ls -ltra"
Create new:
alias alftail='tail -f /opt/alfresco/logs/alfresco.log'
alias alfless='less /opt/alfresco/logs/alfresco.log'
alias alfstart='service alfresco start'
alias alfstop='service alfresco stop'