This file contains hidden or 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 | |
# | |
# PostgreSQL Backup Script Ver 1.0 | |
# http://autopgsqlbackup.frozenpc.net | |
# Copyright (c) 2005 Aaron Axelsen <[email protected]> | |
# | |
# This script is based of the AutoMySQLBackup Script Ver 2.2 | |
# It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
This file contains hidden or 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 | |
mkdir /opt/tomcat | |
yum update -y | |
yum install java-1.8.0-openjdk-devel httpd24 git -y | |
service httpd start | |
chkconfig httpd on | |
yum remove java-1.7.0-openjdk -y | |
# calling the version may ensure that java recognizes 1.8 as the new defaut | |
java -version | |
echo "JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/jre" | \ |
This file contains hidden or 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 | |
for domain in "github.com" "bitbucket.org"; do | |
echo $domain | |
sed -i "/$domain/d" ~/.ssh/known_hosts | |
line=$(ssh-keyscan $domain,`nslookup $domain | awk '/^Address: / { print $2 ; exit }'`) | |
echo $line >> ~/.ssh/known_hosts | |
done |
This file contains hidden or 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
## Install bash-completion on Amazon Linux | |
wget http://www.caliban.org/files/redhat/RPMS/noarch/bash-completion-20060301-1.noarch.rpm | |
rpm -ivh bash-completion-20060301-1.noarch.rpm | |
. /etc/bash_completion |
This file contains hidden or 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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
NewerOlder