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 / 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'
@douglascrp
douglascrp / zbarimg.txt
Last active May 30, 2020 23:22
Extract barcode information from documents
Convert the document into an image
convert -density 150 -threshold 55% SOURCE.pdf +adjoin DEST.gif
convert -blur 0 -density 150 -quality 95 -threshold 55% digitalizar0004.pdf 4.png
Extract the barcode text
zbarimg -q --raw DEST.gif
http://www.imagemagick.org/discourse-server/viewtopic.php?p=54039&sid=de8e1bed3fb621a91f8f00720cec7e33#p54039
@douglascrp
douglascrp / gist:50d0ae95c78181971e5f0ab9ec03e399
Created January 20, 2020 19:30 — forked from dexalex84/gist:334bdd189dd923a63e80c45300fb30be
Pentaho BA CE 7.0 Install with PostgreSQL repo DB on CentOS
Pentaho BA 7.0 Install with PostgreSQL repo DB
INSTALL POSTGRES
https://wiki.postgresql.org/wiki/YUM_Installation
1) find
/etc/yum.repos.d/CentOS-Base.repo
vi /etc/yum.repos.d/CentOS-Base.repo
remove
add
@douglascrp
douglascrp / add_all_users_members_group.js
Created November 6, 2019 13:08
How to insert all Alfresco users into a group with javascript
var group = groups.getGroup("todos");
if (group) {
logger.warn("encontrado");//
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"];
@douglascrp
douglascrp / Duplicity install Ubuntu
Last active January 11, 2025 09:50
Duplicity install
No ubuntu 14.04
https://launchpad.net/~duplicity-team/+archive/ubuntu/ppa
sudo add-apt-repository ppa:duplicity-team/ppa
sudo apt-get update
Most recent version today (2019-09-25): 0.7.19-0ubuntu0ppa1374~ubuntu14.04.1
sudo apt-get install duplicity=0.7.19-0ubuntu0ppa1374~ubuntu14.04.1
host <server_ip>
host <server_dns_name>
The values returned should match in order to be ok
Abrir uma nova aba e digitar na barra de endereço:
```
data:text/html,<a href="sinadura://resolve?domain=Bold">Link</a>
```
@douglascrp
douglascrp / configuracoes ssh.txt
Last active June 14, 2024 12:59
SSH Hardening
No servidor ssh
Criar novo usuário (não root)
# adduser <user>
Dar permissão de sudo para novo usuário
# echo '<user> ALL=(ALL) ALL' >> /etc/sudoers
Bloquear acesso ssh com root e trocar porta padrão
# vim /etc/ssh/sshd_config