Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:23
    gmcgibbon synchronize #34468
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:12
    kamipo commented #34316
  • Nov 19 2018 23:10
    oniofchaos commented #34218
  • Nov 19 2018 23:09
    rafaelfranca synchronize #30320
  • Nov 19 2018 23:08
    oniofchaos commented #34236
  • Nov 19 2018 23:07
    rafaelfranca closed #34487
  • Nov 19 2018 23:07

    rafaelfranca on master

    Prevent TextHelper#word_wrap fr… Merge pull request #34488 from … (compare)

  • Nov 19 2018 23:07
    rafaelfranca closed #34488
  • Nov 19 2018 23:06
    rafaelfranca review_requested #34308
  • Nov 19 2018 23:05
    oniofchaos commented #34280
  • Nov 19 2018 23:01
    oniofchaos commented #34308
  • Nov 19 2018 22:52
    rafaelfranca synchronize #30320
  • Nov 19 2018 22:51

    rafaelfranca on master

    Indent guides as rails help com… Homogenize rails help output I… Merge pull request #34085 from … (compare)

  • Nov 19 2018 22:51
    rafaelfranca closed #34085
  • Nov 19 2018 22:51
    rafaelfranca commented #33643
  • Nov 19 2018 22:51
    rafaelfranca closed #33643
  • Nov 19 2018 22:50

    rafaelfranca on 5-2-stable

    Merge pull request #34106 from … (compare)

  • Nov 19 2018 22:49
    rafaelfranca synchronize #30320
Sourav Goswami
@Souravgoswami
oops wait
image.png
You can see, the genrated svg has still 4876 lines counted, but the data should be up to date by now
I have disable caching, but...
Kaia Leahy
@tenebrousedge
you should probably think about what exactly happens when you start up a dyno. It's probably best to store your JSON in a database rather than persisting your state to a file
Sourav Goswami
@Souravgoswami
Ummm that's interesting...
Kaia Leahy
@tenebrousedge
see also, btw, why you can't use sqlite on heroku https://devcenter.heroku.com/articles/sqlite3
Sourav Goswami
@Souravgoswami
I have deliberately removed database thinking I can update it like that... I don't need a lot of security here TBH
Is there a way to disable the cache that heroku is doing with my file?
Kaia Leahy
@tenebrousedge
no
Sourav Goswami
@Souravgoswami
Got it...
Kaia Leahy
@tenebrousedge
but, for your purposes, you could probably also use like a digitalocean server or something
Sourav Goswami
@Souravgoswami

I have yet another app that calculates system usage of heroku:

https://picalculator.herokuapp.com/system_stats

It works just fine
Kaia Leahy
@tenebrousedge
okay?
Sourav Goswami
@Souravgoswami
Yup, sure...
But you can read stuff from /proc/ or /sys/ on heroku
why not the data.txt?

But you can read stuff from /proc/ or /sys/ on heroku

And show that live with ajax

Kaia Leahy
@tenebrousedge
you can read from data.txt
you can't write to it
or at least, you can't expect that to be persistent
Sourav Goswami
@Souravgoswami
Got it
I think the method just caches it. It generates random coloured svgs, but it doesn't update the data read from data file... So it's mysteriously caching IO.read() only...

you can't write to it

But actually there's my confusion. Cat shows the data is updated.

image.png

Here

IO.read() doesn't read the data, it's kind of cached
I am using a class variable there though...
Kaia Leahy
@tenebrousedge
and you're entirely sure that cat is reading from the same dyno?
Sourav Goswami
@Souravgoswami
Sure
The reason is that the dyno is a container
What does it show? Look at the process start time, it's like 1 hour or so
Because you are running the same container as I am
No matter where you are, my heroku account is free
If you then go to the home page, start calculating pi, you will see the CPU usage goes 12.5%, core count is 8, 12.5 * 8 = 100% of a core
Kaia Leahy
@tenebrousedge
you say yes it is, your code says no it isn't
Sourav Goswami
@Souravgoswami
Well actually you are right. I am running the picalc, and then I ran heroku bash on my system, then checked the nodename with LinuxStat::OS.nodename, it's different. The IP is different, the root is mounted on /dev/loop8 instead of /dev/loop2. So the online instance is different from the heroku bash I am running.
Kaia Leahy
@tenebrousedge
kk. So I'm going to go out for a run, I'll check back later if you have further questions
Sourav Goswami
@Souravgoswami
I learnt a lot! Thanks... I don't have further questions!
Interestingly I am changing data on another container with the rake task, rather than changing it on the rails root... 😂😂
Sourav Goswami
@Souravgoswami
Anyway, I have created one thread in the controller that updates the data there. I have also implemented begin rescue block that is run if the thread fails for 3 times, to avoid race condition. It's updating the data.txt, but not keeping that data in memory for some other reason. It's working perfectly fine. So technically I can write to heroku's rootfs, it's just a simple container with r/w access. But I can't use rake task because the container that I fire up with rake or with heroku run bash is completely different container, as far as I have seen...
Actually I don't even need rails for that. My app's view folder is deleted, along with many rubygems like webpacker itself! It has no JS, or database. It just has a route and the controller. At this point I think it's really not a good idea to use rails... Any ruby server could be used there...
Gus P
@staycreativedesign
how does one add a helper to a gem im creating? I just created a gem and im trying to add a helper to my gem inside the gem
Marco Amato
@linediconsine

Hi all,

I see in the log this error

"../../../../../../../../../../etc/services{{" is not a valid MIME type

Do you have any clue about what its happening here?

Thanks

Look like somebody with an Header parameter like:

../../../../../../../../../../etc/services{{

Make a request to my app, its this a sort of attack?

Mike Simkins
@msimkins
Has been seen before, they are hoping you have insecure permissions on system files
Marco Amato
@linediconsine
@msimkins Thanks for confirm it