#numero de blocks PE lvextend -l 15359 /dev/vgdb/lvdb resize2fs -p /dev/vgdb/lvdb lvextend -L +2G /dev/vg/lv_log resize2fs -p /dev/vg/lv_log lvextend -L +5G /dev/vg/lv_home resize2fs -p /dev/vg/lv_home
Category: Linux
Linux -Como estender as partiçoes no Ubuntu on vmware
##Comandos para recanear a partição. echo 1 > /sys/class/block/[sdb]/device/rescan ##Alterar dados na partição growpart /dev/sda 3 ##Recalcular a partição resize2fs /dev/sda3 Teste ##Estender a partição resize2fs /dev/sda3 20G
Linux – crontab Rodar a cada 10 segundos
* * * * * chmod 777 /home/pinhais/ftp/* -Rf * * * * * sleep 10; chmod 777 /home/pinhais/ftp/* -Rf * * * * * sleep 20; chmod 777 /home/pinhais/ftp/* -Rf * * * * * sleep 30: chmod 777 /home/pinhais/ftp/* -Rf * * * * * sleep 40; chmod 777 /home/pinhais/ftp/* -Rf * *
Continue reading Linux – crontab Rodar a cada 10 segundos
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 – Atulizar Horario de Verão 2019
# zdump -v /usr/share/zoneinfo/America/Sao_Paulo | grep 2019 # apt-get update # apt-get install tzdata # dpkg-reconfigure tzdata yum update tzdata -y by:https://www.linuxnaweb.com/fim-do-horario-de-verao-2019-ajuste/
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