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 | |
set -eo pipefail | |
cert_file="$1" | |
if [ -z "$cert_file" ]; then | |
echo "Usage: create-startssl-cert-bundle CERTIFICATE_FILE" >&2 | |
echo >&2 | |
echo "Bundles StartSSL's intermediate certs and writes combined certificate to stdout" >&2 | |
exit 1 |
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 | |
sudo apt-get install --no-install-recommends open-vm-dkms | |
sudo apt-get install open-vm-tools | |
sudo shutdown -r now | |
# Caso troque o kernel, deve ser removido e reinstalado: | |
#sudo apt-get remove open-vm-tools | |
#sudo apt-get remove open-vm-dkms | |
#sudo shutdown -r now |
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 | |
# Substitua "user" pelo nome de usuário | |
# "host" pelo nome ou endereço IP do servidor remoto | |
# "/var/log/messages" pelo arquivo que você quer exibir. | |
ssh user@host "tail -f /var/log/messages" |
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 | |
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php | |
# Gera linhas de configuração que podem ser adicionadas ao sysctl | |
# com base no total de RAM do sistema. A saída | |
# permite até 50% da memória física para ser alocada como | |
# shared memory. | |
# No Linux, você pode usar desta forma (como root): | |
# | |
# ./shmsetup >> /etc/sysctl.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
-- Gera queries do tipo CREATE INDEX para todos os índices de um banco de dados. | |
select | |
'CREATE INDEX '|| index_name || ' ON ' || table_name || ' ( ' || colunas || ' );' | |
from | |
(select | |
table_name, | |
index_name, | |
array_to_string ( ARRAY ( select | |
a.attname as column_name |
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 | |
# | |
# Primeiro, verifica o nome e o caminho do arquivo .out, dentro do .tar.bz2 | |
tar --list --file=backup.tar.bz2 | |
# | |
# Vamos supor que o arquivo backup.tar.bz2 tem os seguintes arquivos: | |
# | |
# script.sh | |
# README.txt | |
# backup/saida.out |
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/sh | |
NODE_ENV="production" | |
NODE_APP='index.js' | |
APP_DIR='/opt/syonet/screenshot-service'; | |
PID_FILE=$APP_DIR/app.pid | |
LOG_FILE=$APP_DIR/app.log | |
CONFIG_DIR=$APP_DIR | |
PORT=4001 | |
NODE_EXEC=`which node` |
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/sh | |
# script para adicionar apt.postgresql.org ao sources.list | |
# da linha de comando | |
CODENAME="$1" | |
# lsb_release é o melhor, mas nem sempre disponível | |
if [ -z "$CODENAME" ]; then | |
CODENAME=$(lsb_release -cs 2>/dev/null) | |
fi |
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
-- Cria o índice, se ele não existe | |
DO $$ BEGIN IF NOT EXISTS ( | |
SELECT | |
1 | |
FROM | |
pg_class c | |
JOIN | |
pg_namespace n |
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 | |
file --mime-type -b ${1} |
OlderNewer