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
| # Create and restore backups on PostgreSQL (tested on 9.2 and 9.3) | |
| # create database backup | |
| PGPASSWORD="XXX" pg_dump --no-owner --no-acl -U USER DATABASE -h HOST -F t > output_file.tar | |
| # create database backup (heroku) | |
| heroku pgbackups:capture | |
| heroku pgbackups # show stored backups (assuming a117 is the desired one) | |
| heroku pgbackups:url a117 # => it retrieves dump url on AWS S3 |
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
| # delete git tag from remote | |
| git tag -d tagname | |
| git push origin :refs/tags/tagname |
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
| # add ssh key on remote server | |
| cat ~/.ssh/id_rsa.pub | ssh user@server.com 'cat >> .ssh/authorized_keys' |
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
| xclip -sel clip < ~/.ssh/id_rsa.pub | |
| # in case you get a display null error | |
| DISPLAY=:0 xclip -sel clip < ~/.ssh/id_rsa.pub | |
| # osx | |
| pbcopy < ~/.ssh/id_rsa.pub | |
| ## Alternative |
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
| # Deploying Ruby on Rails applications using Nginx and Phusion Passenger | |
| # | |
| # guideline commands were tested on ubuntu 14.04 server, ruby 2.1.1 and rails 4.1# | |
| # | |
| # create user on sudoers | |
| useradd -d /home/orendon -s /bin/bash -G sudo -m orendon | |
| # add 1024mb swap | |
| sudo dd if=/dev/zero of=/swap bs=1M count=1024 |
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/sh | |
| # from https://www.digitalocean.com/community/articles/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5 | |
| . /etc/rc.d/init.d/functions | |
| . /etc/sysconfig/network | |
| [ "$NETWORKING" = "no" ] && exit 0 | |
| nginx="/opt/nginx/sbin/nginx" | |
| prog=$(basename $nginx) |
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
| # hourly | |
| @hourly curl "https://dynamicdns.park-your-domain.com/update?host=HOST_NAME_HERE&domain=YOUR_DOMAIN_HERE&password=YOUR_PASSWORD_HERE&ip=`curl -s echoip.com`" | |
| # every 30 min | |
| 0,30 * * * * curl "https://dynamicdns.park-your-domain.com/update?host=@&domain=YOUR_DOMAIN_HERE&password=YOUR_PASSWORD_HERE" | |
| # ddclient (dns client alternative) | |
| http://sourceforge.net/p/ddclient/wiki/Home/ |
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
| chronos@localhost / $ sudo startxfce4 | |
| Enter encryption passphrase for trusty: | |
| Entering /usr/local/chroots/trusty... | |
| /usr/bin/startxfce4: Starting X server | |
| X.Org X Server 1.15.1 | |
| Release Date: 2014-04-13 | |
| X Protocol Version 11, Revision 0 | |
| Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu |
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
| chronos@localhost / $ sudo startlxde | |
| Password: | |
| Enter encryption passphrase for precise: | |
| Entering /usr/local/chroots/precise... | |
| X.Org X Server 1.11.3 | |
| Release Date: 2011-12-16 | |
| X Protocol Version 11, Revision 0 | |
| Build Operating System: Linux 2.6.42-37-generic x86_64 Ubuntu |
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/sh | |
| # A Ubuntu 14.04 install aimed for Ruby on Rails development | |
| # This box start with a basic Ubuntu 14.04 (trusty) based on phusion/ubuntu-14.04-amd64 | |
| # And it adds the following packages aimed for rails development | |
| # - rbenv and ruby-build | |
| # - ruby 2.1.2 with bundler | |
| # - Git 1.9.1 |