Moved to https://github.com/rdeavila/google-drive-upload
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
-- Usa as estatísticas do PostgreSQL para a contagem. | |
-- Para números mais precisos, execute | |
-- VACUUM ANALYZE | |
-- antes de iniciar. | |
SELECT | |
relname, | |
n_live_tup | |
FROM | |
pg_stat_user_tables | |
ORDER BY |
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 | |
# Adicione um novo remote; pode chamá-lo de "upstream": | |
git remote add upstream https://github.com/usuario/projeto.git | |
# Obtenha todos os branches deste novo remote, | |
# como o upstream/master por exemplo: | |
git fetch upstream |
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} |
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 | |
# IE 7, Windows Vista | |
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=parallels&browserOS=IE7-Vista&filename=Parallels/IE7_Vista/IE7.Vista.For.MacParallels.part0{1.sfx,2.rar,3.rar}" | |
# IE 8, Windows XP | |
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=parallels&browserOS=IE8-WinXP&filename=Parallels/IE8_WinXP/IE8.WinXP.For.MacParallels.part{1.sfx,2.rar}" | |
# IE 9, Windows 7 | |
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=parallels&browserOS=IE9-Win7&filename=Parallels/IE9_Win7/IE9.Win7.For.MacParallels.part0{1.sfx,2.rar,3.rar,4.rar}" |