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
update pg_database set datallowconn = TRUE where datname = 'template0'; | |
\c template0 | |
update pg_database set datistemplate = FALSE where datname = 'template1'; | |
drop database template1; | |
create database template1 with template = template0 encoding = 'UTF8'; | |
update pg_database set datistemplate = TRUE where datname = 'template1'; | |
\c template1 | |
update pg_database set datallowconn = FALSE where datname = 'template0'; |
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
#!/usr/bin/nice /bin/bash | |
# | |
# Your script goes here.... | |
# | |
# Now when this script is run from the command line as ./run_as_nice.sh, it will execute with lower | |
# priority to avoid causing the load average to spike as much. |
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
# Thanks to http://dev.enekoalonso.com/2011/08/09/uninstalling-brew-so-i-can-reinstall/ | |
cd `brew --prefix` | |
rm -rf Cellar | |
brew prune | |
rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew | |
rm -rf ~/Library/Caches/Homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" |
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
After upgrading from Ruby 1.9.2 to 1.9.3 on a test server, the pg would not install. | |
mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm | |
bundle config build.pg --with-pg-config=/usr/bin/pg_config.libpq-dev | |
gem install pg | |
The mv line was the breakthrough, see: | |
http://stackoverflow.com/questions/8814924/gem-install-pg-can-not-bind-to-libpq |
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
#!/usr/bin/env bash | |
# Archive a directory into a compressed tar file | |
# and prepare a text file that lists all of the files in each archive. | |
### | |
# The trash command is OS X specific ane requires a 3rd party tool - | |
# brew install trash | |
# brew install pigz | |
### |
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
#!/usr/bin/env bash | |
# Archive all of the children directories of a directory into compressed tar files | |
# and prepare a text file that lists all of the files in each archive. | |
# Therefore, for directories foo ane bar, produce | |
# foo.tar.bz2, foo.tar.txt, bar.tar.bz2, and bar.tar.txt. | |
### | |
# The trash command is OS X specific ane requires a 3rd party tool - | |
# brew install trash |
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 | |
for png in `find $1 -name "*.png"`; | |
do | |
echo "crushing $png" | |
pngcrush -brute "$png" temp.png | |
mv -f temp.png $png | |
done; |
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
# | |
# PostgreSQL writes two optional commands to the database schema | |
# file, called db/structure.sql, that can only be run as a root | |
# database user. These are not needed actually, so comment them | |
# out automatically | |
# | |
# CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; | |
# COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; | |
# | |
namespace :db do |
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
## | |
# SSL Configuration | |
# | |
# This is a strong configuration that will get an A+ on the SSL Labs test as of | |
# April 5, 2014. | |
# | |
# To test your SSL setup against the best standards, see: | |
# https://www.ssllabs.com/ssltest/ | |
# | |
SSLEngine on |