Archive

Archive for the ‘Heroku’ Category

backup dan sync database dari aplikasi di heroku

May 12, 2011 5 comments

backup

syntax:

heroku db:pull sqlite://nama-backup.db --app nama_aplikasi

sync

syntax:

heroku db:push sqlite://nama-db.db --app nama_aplikasi

jika opsi –app tidak disertakan, maka aplikasi yang dipakai adalah aplikasi yang berada pada heroku info.

real worlds: Read more…

Advertisements
Categories: Coding, GNU/Linux, Heroku Tags:

few tricks redirect domain with rails 2.1.0 on heroku


as i know, rails 2.1.0 has been depracted while using middleware option.

undefined method `middleware' for #<Rails

so, i can’t use it for the code on post previous.

but using this code will available to redirect main domain.

class ApplicationController                                              
  before_filter :ensure_domain                                            

  TheDomain = 'beta.deanet.web.id'

  def ensure_domain
    if request.env['HTTP_HOST'] != TheDomain
      redirect_to TheDomain
        end
   end
end

put on routes.rb .

real worlds: mainpagedeanet.heroku.com and beta.deanet.web.id

ref: docs.heroku.com/custom-domains

Categories: Coding, GNU/Linux, Heroku, Rack, Rails Tags: , ,

redirect domain using rack on rails on heroku

April 17, 2011 2 comments

Sudah satu minggu, kita ngoding ruby ngoprek lagi 😀 . masi dengan ruby.

kemarin sempet ngoprek RoR atau ruby on rails, ya iseng2 disaat sengggang kalo pas bosen ngadmin :D. ketemu masalah gimana cara bikin domain yang ada di heroku dengan aplikasi RoR hanya 1atau 2 lebih domain yg menghandle nya.

berikut contohnya:

Multiple domain list:
1. devel.heroku.com
2. coderiver.alinux.web.id

add on your environment.rb :
Read more…

Overwrite remote sqlite db with local db on heroku (push database)

April 2, 2011 2 comments

Check first, local.db is exist

      sopir@debian:~/public_html/scanty/scanty$ ls
      access.log  blog.db  config.ru  lib  main.rb  public  Rakefile  read.me  README.rdoc  spec  vendor  views

Push to repo

      sopir@debian:~/public_html/scanty/scanty$ heroku db:push sqlite://blog.db
      Loaded Taps v0.3.9
      Warning: Data in the app 'sopir' will be overwritten and will not be recoverable.
      Are you sure you wish to continue? (y/n)? y
      Sending schema
      Schema:        100%
      |=======================================================================================================================| Time: 00:00:02
      Sending indexes
      Sending data
      1 tables, 0 records
      posts:         100%
      |=======================================================================================================================| Time: 00:00:00
      Resetting sequences
      sopir@debian:~/public_html/scanty/scanty$
Categories: Coding, GNU/Linux, Heroku, Sqlite Tags: , , ,

Pull Aplikasi Heroku dari awal (Pull heroku application from scratch)

March 7, 2011 3 comments

Yap.. stelah lama tidak utak-utik aplikasi heroku, kiranya sudah hilang / didestroy semua mengingat beberapa bulan lalu heroku mengultimatum user yang masih gratisan (haha) . Karena judul ini dari `NOL` , maka semua repository di local anggap saja hilang terformat, dan tinggal di repo heroku 😀

Oke. Yang paling terpenting adalah masih ingat username dan password, serta tentunya adalah semua dilakukan di lingkungan Linux 😀 ..

Read more…

Categories: Coding, Heroku, Ruby Tags: ,