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 | |
# extract all postgres databases from a sql file created by pg_dumpall | |
# this script outputs one .sql file for each database in the original .sql file | |
# unless you pass the name of a database in the dump | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2 | |
exit 1 | |
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
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/ffabreti/0512fb5705926ae7f5ee34536a0e28db/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
function die { |
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
[ec2-user@ip-172-31-49-17 ~]$ wget https://gist.githubusercontent.com/ffabreti/0512fb5705926ae7f5ee34536a0e28db/raw/97304371c0476ddcf0ae76151b20faf895bbd94b/install-redis.sh | |
--2016-04-01 20:06:43-- https://gist.githubusercontent.com/ffabreti/0512fb5705926ae7f5ee34536a0e28db/raw/97304371c0476ddcf0ae76151b20faf895bbd94b/install-redis.sh | |
Resolvendo gist.githubusercontent.com (gist.githubusercontent.com)... 199.27.76.133 | |
Conectando-se a gist.githubusercontent.com (gist.githubusercontent.com)|199.27.76.133|:443... conectado. | |
A requisição HTTP foi enviada, aguardando resposta... 200 OK | |
Tamanho: 6690 (6,5K) [text/plain] | |
Salvando em: “install-redis.sh” | |
install-redis.sh 100%[=========================================================================>] 6,53K --.-KB/s em 0s |
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 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/ffabreti/0512fb5705926ae7f5ee34536a0e28db/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
function die { |
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
migration: | |
rake db:migrate VERSION=0 | |
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
ERROS: | |
================================================ | |
ao tentar iniciar o android emulator: | |
ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy | |
ko:failed to initialize KVM | |
1) desligar máquinas virtuais VIRTUALBOX | |
2) sudo /etc/init.d/vboxdrv stop | |
================================================ |
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
-- conectar via FreeTDS | |
TDSVER=7.1 tsql -H <serverName> -p 1433 -U <domain>\\<user> -P `cat pass.txt` | |
-- fim de comando | |
go | |
-- selecionar o banco | |
use <dbname> | |
-- info sobre tabela |
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
############################################## | |
#query what packages depend upon XXX | |
repoquery --whatrequires --installed XXX | |
############################################## | |
#remove a repo named XXX | |
cd /etc/yum.repos.d/ | |
mv XXX.repo XXX.repo.not | |
ATT: However, each .repo file can and usually have more than one yum repository defined in it | |
############################################## | |
#query installed package content |
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
################################################### | |
#configuring authentication of a linux box with Microsoft Active-Directory | |
#refer: http://wiki.ubuntu-br.org/AutenticandoAD | |
$ apt-get install krb5-config krb5-user | |
$ vi /etc/krb5.conf | |
[libdefaults] | |
default_realm = DOMAIN.BR | |
default_tgs_enctypes = RC4-HMAC DES-CBC-MD5 DES-CBC-CRC |
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
------------------------------------------------------- | |
copy table FROM SHELL between distinct database files: | |
-------------------------------------------------------- | |
sqlite3 source.sqlite3 ".schema myTable" | sqlite3 destination.sqlite3 | |
sqlite3 source.sqlite3 "SELECT * FROM myTable" | sqlite3 destination.sqlite3 ".import /dev/stdin myTable" | |
--------------------------------------------- | |
import data into table: | |
--------------------------------------------- | |
$ head cbo_ocupacoes.csv |
NewerOlder