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/zsh | |
/usr/bin/vagrant destroy --force | |
yes | knife client delete {NODE_NAME} | |
yes | knife node delete {NODE_NAME} | |
/usr/bin/vagrant up | |
knife bootstrap localhost --node-name {NODE_NAME} --ssh-user vagrant --ssh-password vagrant --ssh-port 2222 --sudo | |
/usr/bin/vagrant provision |
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
Recipe: postgresql::server_debian | |
* package[postgresql-9.2] action install[2013-05-12T07:44:03+02:00] INFO: Processing package[postgresql-9.2] action install (postgresql::server_debian line 26) | |
[2013-05-12T07:44:03+02:00] DEBUG: package[postgresql-9.2] checking package status for postgresql-9.2 | |
postgresql-9.2: | |
Installed: 9.2.4-0ppa1~lucid | |
Candidate: 9.2.4-0ppa1~lucid | |
Version table: | |
*** 9.2.4-0ppa1~lucid 0 | |
500 http://ppa.launchpad.net/pitti/postgresql/ubuntu/ lucid/main Packages | |
100 /var/lib/dpkg/status |
heroku pgbackups:capture
curl -o latest.dump `heroku pgbackups:url`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
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
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
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
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |
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
FROM ubuntu:14.04.3 | |
MAINTAINER Toby Hede <> | |
ENV ELIXIR_VERSION 1.1.1 | |
ENV PORT 80 | |
ENV MIX_ENV prod | |
# Elixir requires UTF-8 | |
RUN locale-gen en_US.UTF-8 |
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
Pipe directly to remote server | |
pg_dump -C -U dbuser {DBNAME} | psql -h xxx.xxx.xxx.xx -U {DBUSER} >> restore.log | |
And with passwords as required | |
PGPASSWORD="{DBPASSWORD}" pg_dump -C -U dbuser {DBNAME} | PGPASSWORD="{DBPASSWORD}" psql -h xxx.xxx.xxx.xx -U {DBUSER} >> restore.log |
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 | |
echo "Reset iptables..." | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |