Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dr Kim Foale
    @kimadactyl
    kim@chips:~/git/taichi/taichi_rails$ cat config/database.yml
    <%
    require 'cgi'
    require 'uri'
    begin
      uri = URI.parse(ENV["DATABASE_URL"])
    rescue URI::InvalidURIError
      raise "Invalid DATABASE_URL"
    end
    env = ENV["RAILS_ENV"] || ENV["RACK_ENV"]
    raise "No RACK_ENV or RAILS_ENV found" unless env
    def attribute(name, value, force_string = false)
      if value
        value_string =
          if force_string
            '"' + value + '"'
          else
            value
          end
        "#{name}: #{value_string}"
      else
        ""
      end
    end
    database = "#{(uri.path || "").split("/")[1]}_#{env}"
    username = uri.user
    password = uri.password
    host     = uri.host
    port     = uri.port
    params   = CGI.parse(uri.query || "")
    params["encoding"] = ["utf8"] unless params["encoding"].present?
    params["pool"    ] = [5]      unless params["pool"    ].present?
    adapter = case uri.scheme.to_s
              when "postgres" then "postgresql"
              when "mysql"    then "mysql2"
              else uri.scheme.to_s
              end
    %>
    
    <%= env %>:
      <%= attribute "adapter",  adapter %>
      <%= attribute "database", database %>
      <%= attribute "username", username %>
      <%= attribute "password", password, true %>
      <%= attribute "host",     host %>
      <%= attribute "port",     port %>
    
    <% params.each do |key, value| %>
      <%= key %>: <%= value.first %>
    <% end %>
    which tbh i dont like cuz i cant load it locally now :D but w/e for time being
    Everton Ribeiro
    @nuxlli
    the way around this ;)
    I can see the database error?
    Dr Kim Foale
    @kimadactyl
    wait. im a dumbass. ive not pushed my db data. lol
    sorry
    how do i push over my database to the azk image?
    Everton Ribeiro
    @nuxlli
    hahaha
    Gullit Miranda
    @gullitmiranda
    Whatsapp format of your data?
    Dr Kim Foale
    @kimadactyl
    erm just a postgres database
    Gullit Miranda
    @gullitmiranda
    SQL dump file or seed?
    Dr Kim Foale
    @kimadactyl
    (fwiw i hate postgres i only migrated for heroku)
    Gullit Miranda
    @gullitmiranda
    You prefer mysql?
    Dr Kim Foale
    @kimadactyl
    i dont care at this point
    lol
    Everton Ribeiro
    @nuxlli
    @gullitmiranda will help you because he has more experience with the use of images
    Dr Kim Foale
    @kimadactyl
    the postgres db seems to be working fine on my azk image (is there a name for it?)
    just now dont know how to transfer my local db over?
    Everton Ribeiro
    @nuxlli
    about de the https erro, you can vote this issue? azukiapp/azk#340
    Dr Kim Foale
    @kimadactyl
    vote? want me to put a comment?
    Everton Ribeiro
    @nuxlli
    feel free ;)
    is just so we can prioritize according to demand
    Dr Kim Foale
    @kimadactyl
    yeah np
    wait github has reactions now :o
    Everton Ribeiro
    @nuxlli
    thanks ;)
    yes, hahah
    Gullit Miranda
    @gullitmiranda
    @kimadactyl you can make this question in http://stackoverflow.com/questions/tagged/azk while preparing the list of commands?
    so is documenting for other people.
    Dr Kim Foale
    @kimadactyl
    yes sure
    Gullit Miranda
    @gullitmiranda
    in the README of the image mysql (http://images.azk.io/#/mysql?_k=yvigvq) has already documented this. When I get time I will do the same in postgres, if someone doesn't do a PR before =D.
    Everton Ribeiro
    @nuxlli
    @kimadctyl while @gullitmiranda help you with thedb, can do a test for me just to make sure if we can solve the problem with the dns?
    Dr Kim Foale
    @kimadactyl
    do you have a name for what azk creates? images? vms? something else?
    beans? ;)
    Everton Ribeiro
    @nuxlli
    haha, nice idea ;)
    you can roolback the /etc/nsswitch.conf?
    hosts:          files resolver mdns4_minimal [NOTFOUND=return] dns
    Dr Kim Foale
    @kimadactyl
    k
    Everton Ribeiro
    @nuxlli
    only for check bug resolution
    Dr Kim Foale
    @kimadactyl
    then restart
    ?
    Everton Ribeiro
    @nuxlli
    it is not necessary, if that same resolution the bug should return
    Dr Kim Foale
    @kimadactyl
    restarted and its still working :)
    Everton Ribeiro
    @nuxlli
    hauhauah
    check the ping
    Dr Kim Foale
    @kimadactyl
    kim@chips:~/git/taichi/taichi_rails$ ping dev.azk.io
    PING dev.azk.io (172.18.0.1) 56(84) bytes of data.
    64 bytes from 172.18.0.1: icmp_seq=1 ttl=64 time=0.052 ms
    64 bytes from 172.18.0.1: icmp_seq=2 ttl=64 time=0.038 ms
    64 bytes from 172.18.0.1: icmp_seq=3 ttl=64 time=0.041 ms
    ^C
    --- dev.azk.io ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 0.038/0.043/0.052/0.009 ms
    kim@chips:~/git/taichi/taichi_rails$ ping taichi-school.dev.azk.io
    PING taichi-school.dev.azk.io (172.18.0.1) 56(84) bytes of data.
    64 bytes from 172.18.0.1: icmp_seq=1 ttl=64 time=0.040 ms
    64 bytes from 172.18.0.1: icmp_seq=2 ttl=64 time=0.043 ms
    64 bytes from 172.18.0.1: icmp_seq=3 ttl=64 time=0.038 ms
    ^C
    --- taichi-school.dev.azk.io ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 0.038/0.040/0.043/0.005 ms
    all good!
    Everton Ribeiro
    @nuxlli
    ok, if the bug you change back to the other format and let me know please?
    Dr Kim Foale
    @kimadactyl
    sorry what do you want me to do?
    Everton Ribeiro
    @nuxlli
    sorry, my English is shameful