Linux
comandos uteis linux
Geral
Listar links simbolicos
find . -type l -ls
Reload Bash
source ~/.bashrc
Verificar espaço
du -shc *
Vim
(ctrl v mouse)
/.vimrc
set mouse-=a
Setar timezone
sudo timedatectl set-timezone America/Sao_Paulo
Tar
tar -cvf sampleArchive.tar /sampleArchive
tar -xvf sampleArchive.tar
Composer
Download
curl -sS https://getcomposer.org/installer -o composer-setup.php
Instalar
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Crontab
- ver log: /var/mail/
Find
Dentro do ditetorio
find .
Somente diretorios
-type d
Somente arquivos
-type f
com permissoes diferentes
find / -type f ! -perm 777
Arquivos acessados nas ultimas 12 horas
find . -type f -ctime -0.5 -exec ls -l {} \;
Metabase
Atualização
- Stop metabase
- Download da nova versão e backup anterior
- Copia para pasta
- Start e reinicia
sudo systemctl stop metabase.service
sudo systemctl start metabase.service
sudo systemctl status metabase.service
Docker
service docker start
docker container start metabase
Rocket Chat
Programa de chat empresarial
Certficado SSL
Atualização de certificado ssl https:
- stop ngix
/etc/init.d/nginx stop
- renew certificate
certbot renew
- start
/etc/init.d/nginx start
- delete
sudo certbot delete
sudo certbot delete --cert-name example.com
Atualizar/Manutenção
Documentação:
https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/
https://snapcraft.io/rocketchat-server
Checar versão do snap:
snap --version
Checar versão programas instalados
snap list
Ver informações
snap info rocketchat-server
How do I manually update to a new release?
While updates happen automatically usually within 6 hours from time of release, you can update manually by issuing this command:
sudo snap refresh rocketchat-server
- opção de escolher canal
--channel=canal/stable
How do I tell if Rocket.Chat is actually running?
You can check on the status of Rocket.Chat with:
sudo service snap.rocketchat-server.rocketchat-server status
To restart Rocket.Chat:
sudo service snap.rocketchat-server.rocketchat-server restart
Chat por departamento
Chat padrão
<script type="text/javascript">
(function(w, d, s, u) {
w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
w.RocketChat.setDepartment('FILL HERE DEPARTMENT NAME - case sensitive');
var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
j.async = true; j.src = 'https://chat.sistemaprever.com.br/livechat/rocketchat-livechat.min.js?_=201903270000';
h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'https://chat.sistemaprever.com.br/livechat');
</script>
Atribuir departamento ao chat do livechat
<script type="text/javascript">
RocketChat(function() {
this.setDepartment('FILL HERE DEPARTMENT NAME - case sensitive');
});
</script>