Skip to content

Instantly share code, notes, and snippets.

@p1nox
Last active July 15, 2020 15:10
Show Gist options
  • Save p1nox/6101559 to your computer and use it in GitHub Desktop.
Save p1nox/6101559 to your computer and use it in GitHub Desktop.
aws

http://www.cyberciti.biz/faq/osx-installing-the-aws-command-line-interface-using-brew/

# aws section on .zshrc
source /usr/local/share/zsh/site-functions/_aws

# cmd
aws configure

create swap

dd if=/dev/zero of=/swapfile bs=1024 count=80000000  # 80Gb
mkswap /swapfile
swapon /swapfile

https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-swap-creating-file.html

Jitsi https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md

AMI

Database instance slow after spawning it using an AMI (for mongo)?

Reason: https://forums.aws.amazon.com/thread.jspa?threadID=223779

  • If disks are not too big just do this on each mounted disk:
dd if=/dev/xvda of=/dev/null bs=1M

New

heroku pg:reset --app * HEROKU_POSTGRESQL_URL

heroku run rake db:migrate --app *

heroku run rake db:seed --app *

heroku logs --app * -t

Olds

heroku config:add MAIL_URL_HOST=* --app *

heroku config:set MAINTENANCE_PAGE_URL=http://tipea.me/...

heroku info --app simplypractice

POSTGRE BACKUP

heroku pgbackups:capture --app *

heroku pgbackups:url --app *

heroku pgbackups:restore DATABASE `heroku pgbackups:url --app *` --app * "https://s3.amazonaws.com..."

SET DEFAULT DATABASE ON HEROKU

heroku pg:promote HEROKU_POSTGRESQL --app *

POSTGRE PULL DUMP FROM HEROKU TO LOCAL

curl -o latest.dump `heroku pgbackups:url b002 -a *`
pg_restore --verbose --clean --no-acl --no-owner -U postgres -d *_development latest.dump

POSTGRE PUSH FROM LOCAL DUMP TO HEROKU

pg_dump --verbose --clean --no-acl --no-owner -U postgres *_development > local.dump

heroku pg:info --app *

# DATA BASE URL DROPBOX TO THE NEXT STEP
heroku pgbackups:restore HEROKU_POSTGRESQL_URL 'https://dl.dropboxusercontent.com/...' --app *

MULTIPLE ACCOUNTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment