UBUNTU – 12 – 04 – Criar script para rodar um comando no inicializar.

sudo vim /etc/systemd/system/rc_local.service —————————————————— [Unit] After=network.service [Service] ExecStart=/usr/local/bin/rc_local.sh [Install] WantedBy=default.target —————————————————– vim /usr/local/bin/rc_local.sh —————————————————- #!/bin/bash date > /root/disk_space_report.txt du -sh /home/ >> /root/disk_space_report.txt —————————————————– sudo chmod 664 /etc/systemd/system/rc_local.service sudo chmod 744 /usr/local/bin/rc_local.sh sudo systemctl daemon-reload sudo systemctl enable rc_local.service sudo systemctl status rc_local.service

Zimbra – Comando para Fazer backup e restaurar usuário

Todos os comandos só funcionam no usuario zimbra Backup zmmailbox -z -m gisele.clemente@pinhais.pr.gov.br -t 0 getRestURL “//?fmt=tgz” > /bkp/mails/gisele.clemente@pinhais.pr.gov.br.tgz Restaurar zmmailbox -z -m gisele.clemente@p.pinhais.pr.gov.br -t 0 postRestURL “//?fmt=tgz&resolve=skip” /bkp/mails/gisele.clemente@pinhais.pr.gov.br.tgz   Comando para deletar uma conta do ldap source ~/bin/zmshutil zmsetvars ldapdelete -x -H ldap://$zimbra_server_hostname -D $zimbra_ldap_userdn -w $zimbra_ldap_password uid=luana.bonfim,ou=people,dc=p,dc=pinhais,dc=pr,dc=gov,dc=br

Zimbra Comandos para Subir certificado .

Os comando dever ser rodados com o usuário zimbra /opt/zimbra/bin/zmcertmgr createcsr comm -new -keysize 2048 -subject “/C=BR/ST=PR/L=PINHAIS/O=MUNICIPIO DE PINHAIS/OU=TI/CN=srvwebmailp.p.pinhais.pr.gov.br” /opt/zimbra/bin/zmcertmgr verifycrt comm ./private.key ./certificate.crt ./ca_bundle.crt /opt/zimbra/bin/zmcertmgr deploycrt comm ./webmail.pinhais.pr.gov.br.crt ./commercial_ca.crt

Oracle – Linux Instalar instantclient

tar -xzvf oci8–2.1.8.tgz cd oci8–2.1.8 phpize ./configure — with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib make sudo make install This will build and install the oci8 library which will be located (probably) in /usr/lib/php/20170718/oci8.so Now we should edit both these files… /etc/php/7.0/apache2/php.ini /etc/php/7.0/cli/php.ini Enable the oci8 extension by adding the line to each php.ini extension=/usr/lib/php/20170718/oci8.so /etc/apache2/envvars then add the following lines:
Continue reading Oracle – Linux Instalar instantclient

Python – KIVY Instalação

# Comandos para instalação do KIVY python -m pip install ffpyplayer python -m pip install –upgrade pip wheel setuptools python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew python -m pip install kivy.deps.gstreamer python -m pip install kivy.deps.angle python -m pip install kivy

Linux – Comando para gerar certificado SSL

openssl req -new -newkey rsa:2048 -nodes -keyout pinhais.pr.gov.br.key -out pinhais.pr.gov.br.csr -subj “/C=BR/ST=PARANA/L=PINHAIS/O=MUNICIPIO PINHAIS/OU=TI/CN=pinhais.pr.gov.br” cat /root/certificados/pinhais.pr.gov.br.key /root/certificados/pinhais.pr.gov.br.crt > /root/certificados/pinhais.pr.gov.br.pem openssl pkcs12 -export -in /root/certificados/pinhais.pr.gov.br.crt -inkey /root/certificados/pinhais.pr.gov.br.key -certfile /root/certificados/pinhais.pr.gov.br.pem -out /root/certificados/pinhais.pr.gov.br.pfx     openssl pkcs12 -export -out /root/srvad01.pinhais.pr.gov.br.pfx -inkey /etc/letsencrypt/live/srvad01.pinhais.pr.gov.br/privkey.pem -in /etc/letsencrypt/live/srvad01.pinhais.pr.gov.br/fullchain.pem -passout pass:pinhais