#prog #ruby
Исходники бота, который по расписанию постит в Твиттере случайный цвет, причём без повторов. Почему это привлекло моё внимание? А вот почему:
<...>
* statelessness: heroku doesn't come stock with any stores of persistent data; the ephemeral file system associated with your dyno is destroyed when the dyno stops running. this makes it hard to store a history of every color that's been generated (see above). for the OAuth credentials required for @everycolorbot, standard config vars suffice, but there doesn't seem to be a way of updating config vars from inside a dyno, and in any case the docs say that your dyno gets restarted whenever a config var changes (which seems like it would lead to an infinite loop of tweets, Twitter jail, dogs and cats living together, mass hysteria, &c.)
solution: everycolor uses Twitter itself as a store of persistent data, by reloading the last color it tweeted every time it goes to tweet.
Исходники бота, который по расписанию постит в Твиттере случайный цвет, причём без повторов. Почему это привлекло моё внимание? А вот почему:
<...>
* statelessness: heroku doesn't come stock with any stores of persistent data; the ephemeral file system associated with your dyno is destroyed when the dyno stops running. this makes it hard to store a history of every color that's been generated (see above). for the OAuth credentials required for @everycolorbot, standard config vars suffice, but there doesn't seem to be a way of updating config vars from inside a dyno, and in any case the docs say that your dyno gets restarted whenever a config var changes (which seems like it would lead to an infinite loop of tweets, Twitter jail, dogs and cats living together, mass hysteria, &c.)
solution: everycolor uses Twitter itself as a store of persistent data, by reloading the last color it tweeted every time it goes to tweet.
GitHub
GitHub - vogon/everycolor: colors, all of 'em
colors, all of 'em. Contribute to vogon/everycolor development by creating an account on GitHub.
#prog #c #ruby #article
An in-depth look at CVE-2018-8778 or why integer overflows are still a thing!
An in-depth look at CVE-2018-8778 or why integer overflows are still a thing!
Sqreen Blog
An in-depth look at CVE-2018-8778 or why integer overflows are still a thing! - Sqreen Blog
CVE-2018-8778 is a Buffer under-read that is triggered by `String#unpack`. In this article, we will do a deep dive into the vulnerability, show how to exploit it and how to mitigate it.