This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reference: http://demon.tw/my-work/vbs-json.html | |
VbsJson class for parsing JSON format data with VBS | |
Tags: JavaScript , JSON , VB , VBS , VBScript | |
Title: The VBS resolve VbsJson class of JSON data format of: Demon | |
Link: http://demon.tw/my-work/vbs-json.html | |
Copyright: All articles in this blog are subject to the terms of " Signature - Non-Commercial Use - Share 2.5 China in the Same Way ". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var usuarios = people.getPeople(null, -1); | |
logger.warn(usuarios.length); | |
for (var i = 0; i < usuarios.length; i++) { | |
var usuario = search.findNode(usuarios[i]); | |
var userName = usuario.properties["cm:userName"]; | |
var userEnabled = people.isAccountEnabled(userName); | |
logger.warn(userName + ": " + userEnabled); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab | |
# 0 5 * * * /opt/alfresco/scripts/cleanlogs.sh | |
DAYS_TO_KEEP=7 | |
find /opt/alfresco/logs/* -maxdepth 0 -name '*.log*' -mtime +${DAYS_TO_KEEP} -type f -exec rm {} \; | |
find /opt/alfresco/logs/bart/* -maxdepth 0 -name '*.log*' -mtime +${DAYS_TO_KEEP} -type f -exec rm {} \; | |
find /opt/alfresco/tomcat/logs/* -maxdepth 0 -name '*.log*' -mtime +${DAYS_TO_KEEP} -type f -exec rm {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete thumbnails if exists. To be used in Alfresco javascript console. Starts from selected space | |
recurse(space, function(node) { | |
var doclib = node.getThumbnail('doclib'); | |
var webpreview = node.getThumbnail('webpreview'); | |
var webpreview2 = node.getThumbnail('web-preview'); | |
var imgpreview = node.getThumbnail('imgpreview'); | |
var pdf = node.getThumbnail('pdf'); | |
if(doclib){ | |
doclib.remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JavaScript https://community.alfresco.com/thread/193889-is-there-any-way-to-remove-node-property-using-js-api#comment-739758 # | |
delete node.properties["yourprefix:yourproperty"]; | |
node.save(); | |
# Java https://community.alfresco.com/thread/193889-is-there-any-way-to-remove-node-property-using-js-api#comment-651225 # | |
nodeService.removeProperty(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
Connect to container console as root | |
docker exec -u root -it <container_name> /bin/bash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 <Video-URL> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; |
NewerOlder