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
importClass(Packages.org.springframework.web.context.ContextLoader); | |
importClass(Packages.org.alfresco.service.cmr.repository.StoreRef); | |
var ctx = ContextLoader.getCurrentWebApplicationContext(); | |
var archiveService = ctx.getBean("nodeArchiveService"); | |
archiveService.purgeAllArchivedNodes(new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore")); |
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 RunAsUtil = { | |
execute: function(workFunction, runAsUser) { | |
Packages.org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(new Packages.org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork() | |
{ | |
doWork: workFunction | |
}, runAsUser); | |
}, | |
doInTransaction: function(workFunction) { | |
var txs = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext().getBean("TransactionService"); | |
var th = txs.getRetryingTransactionHelper(); |
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
qpdf --encrypt "empty_or_password_open" "owner_password" 40 --print=y --modify=n --extract=n --annotate=n -- input.pdf output.pdf |
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
Some basic operations: | |
Split screen vertically: Ctrlb and Shift5 | |
Split screen horizontally: Ctrlb and Shift" | |
Toggle between panes: Ctrlb and o (or arrows < > V ^ toward the desired screen) | |
Close current pane: Ctrlb and x | |
You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them. |
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
sudo apt-get update | |
sudo apt-get install apache2 | |
sudo apache2ctl configtest | |
Se aparecer: | |
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message | |
Syntax OK | |
Editar /etc/apache2/apache2.conf |
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
This is the command to be used in the cron schedule to have the certificates automatically renewed | |
certbot renew --pre-hook "service apache2 stop" --post-hook "service apache2 start" --authenticator standalone --agree-tos --email <email> |
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
// To be used with Alfresco JS Console. Select folder in js console to create export package for | |
var exportaction = actions.create("export"); | |
exportaction.parameters["store"] = "workspace://SpacesStore"; | |
exportaction.parameters["package-name"] = space.properties.name + "_export.acp"; | |
exportaction.parameters["destination"] = space.parent; | |
exportaction.parameters["include-children"] = true; | |
exportaction.parameters["include-self"]=true; | |
exportaction.parameters["encoding"]="UTF-8"; | |
exportaction.execute(space); |
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(); |