#dev 2021-10-02

2021-10-02 UTC
hendursaga and oodani joined the channel
#
plindner[m]
more fun with jq and shpub:
#
Loqi
[Paul Lindner] Hacker News Ingested Here's some q&d scripting to pull your comments into a bunch of shpub commands. You'll need to edit some of the quoting, but it works well! curl https://hnrss.org/threads.jsonfeed?id=lindner |jq > hackernews-plindner-threads...
#
plindner[m]
curl https://hnrss.org/threads.jsonfeed?id=lindner |jq > hackernews-plindner-threads.json
#
plindner[m]
cat hackernews-plindner-threads.json | jq -r '.items[]| "shpub note --html --syndication=" + .url + " --published=" + .date_published + " --name=\"" + .title + "\" - <<EOF\n" + .content_html + "\nEOF\n\n"'
alex11, maxwelljoslyn[d] and Poorchop joined the channel
#
Poorchop
has anyone been able to successfully send mentions to micro.blog endpoints (https://micro.blog/webmention)?
#
Poorchop
I have sent a few and they never seem to show up or get acknowledged by the recipient
#
Poorchop
actually never mind, I just sent another one and it seems to have worked
#
Poorchop
unrelated but does anyone have an example of how one can have a back and forth conversation using a single permalink? like if I send a Webmention reply to someone and get a response, and then I want to tack on my reply from the same permalink
#
Poorchop
I'm thinking that I'd need to create a non-public folder of these additional replies where I mark my original permalink and the other person as my intended recipients, and then I send a mention to both myself and to the other person
#
nekr0z
<Poorchop> "unrelated but does anyone have..." <- I believe salmentions is the "proper" way to go about it, but it should be supported by everybody who takes part in the conversation...
#
Poorchop
thanks
hendursa1, Memicme, [marksuth] and KartikPrabhu joined the channel
#
capjamesg[d]
How do people manage multiple web projects? I have a few Flask apps I’d like to run and would love to keep them all on one server.
#
capjamesg[d]
I use PythonAnywhere for hosting four apps and it is more expensive then I would like.
#
jeremycherfas
I'm interested in the answers. People have said run things on a Pi but I get confused about how to make it accessible but keep it secure.
#
capjamesg[d]
Me too jeremycherfas.
#
capjamesg[d]
I like the idea of running an app on a Pi but security is a big concern.
#
capjamesg[d]
And I don’t keep computers on indoors when I go on holiday which would lead to quite odd periods of downtime.
#
jeremycherfas
So you want it on a remote server?
#
jeremycherfas
I believe that is actually eaiser, though I have not tried.
tetov-irc joined the channel
#
nekr0z
<capjamesg[d]> "How do people manage multiple..." <- A reverse proxy might be a solution if what you want is to run several web servers on one machine and have them available on, say, different subdomains. There are plenty of manuals on setting it up using common web server software (nginx, apache, etc)
KartikPrabhu and akevinhuang joined the channel
#
capjamesg[d]
nekr0z the concern is more how much memory the Elasticsearch instance on the same server would use up.
#
capjamesg[d]
I want to run six web apps on this server in total 😬
#
aaronpk
it'll be fine. i run 60 different websites on the same server
#
capjamesg[d]
Really? Wow. Well that solves that problem.
#
capjamesg[d]
I just knew that Elasticsearch can eat through a lot of memory.
#
capjamesg[d]
But using the same server is so much easier.
#
aaronpk
I think you can configure elastic search with a max memory amount it will use to make sure there's always room for the other stuff too
#
nekr0z
<capjamesg[d]> "Evgeny Kuznetsov the concern..." <- Yeah, that one's a hog. They don't even recommend running it on a machine with less than 8 GB RAM, and I gather it's for the case where Elasticsearch is the only thing the machine runs... https://www.elastic.co/guide/en/elasticsearch/guide/current/hardware.html#_memory
#
sknebel
yeah. by default elasticsearch will assume it can use the full macine, but you can set the JVM heap sizes manually still. or stuff it in a container where it thinks it has less memory than the box has
#
sknebel
or depending what you are looking at, get two smaller VMs instead of one large one if you want to keep it separated.
#
sknebel
but I'd start with one and see what happens
#
capjamesg[d]
Yeah. It’s running with the minimum recommended RAM right now.
#
capjamesg[d]
I suppose I could deploy my web apps on the crawler server. But when in use the crawler eats up most of the machine.
#
capjamesg[d]
Would a $5 / month cloud server be enough to host a few web apps?
#
Zegnat
capjamesg[d]: probabbly yes, depending on traffic and stuff
#
Zegnat
I host stuff on a $5/month (ish) VPS from Hetzner and have never bumped into resource issues. That said the heaviest load I have put it in is probably when my archiver application runs and has to load sites in a headless Chromium instance. Has not given me problems so far at least
#
capjamesg[d]
PythonAnywhere charges per app and soon I will have five apps to run. So their pricing isn’t scalable.
#
capjamesg[d]
Good to know Zegnat++
#
Loqi
Zegnat has 11 karma in this channel over the last year (31 in all channels)
#
nekr0z
<capjamesg[d]> "Would a $5 / month cloud..." <- I host all I have on a $5/mo DO VPS (with the exception of indieweb-glue, that one's on Heroku). The only time I had issues was when I tried to stuff an IPFS node on the same VPS to have my site automatically mirrored to IPFS; I had to give up until the times they make IPFS behave memory-wise. Other than that, I've been running it for almost a year now, and I plan on adding more web stuff there
#
nekr0z
because I have plenty of free resources. Then again, I don't do Elasticsearch. $)
costledger_ and capablecable[d] joined the channel; costledger_ left the channel
#
Loqi
nekr0z has 1 karma in this channel over the last year (2 in all channels)
#
capjamesg[d]
That is very helpful. I’m going to run everything on a $5 DO cloud server.
#
capjamesg[d]
That will be much cheaper than PythonAnywhere.
#
sknebel
how much is PythonAnywhere for 4 apps?
[snarfed] joined the channel
#
[snarfed]
looks like $5 per app if you use different accounts, https://www.pythonanywhere.com/pricing/ , but not really their intended model
#
[snarfed]
capjamesg beware the admin tax, you'll probably spend a lot more than $15-25/mo in your time and annoyance administering an OS and web server. go for it if you're excited about that! but if not, consider spending the money
#
[snarfed]
(or consider a platform that has a free tier and supports multiple apps, like App Engine or many others)
#
capjamesg[d]
Admin tax is a factor on my mind.
#
capjamesg[d]
I went with PythonAnywhere for SSH access and the web interface.
#
capjamesg[d]
I’ll check out App Engine.
#
GWG
Looking at the Microsub spec, and many of the requests in it do not show what the return should be
#
GWG
Such as mark entry as read and remove entry.
#
capjamesg[d]
GWG This was an issue for me.
#
capjamesg[d]
I think it return a JSON object with a message.
#
GWG
capjamesg[d]: Minimum is just a 200
#
capjamesg[d]
Yeah. The code was 200.
#
GWG
I would think a json message wouldn't add anything
#
capjamesg[d]
If anything a 200 itself would be fine.
#
capjamesg[d]
I just have a habit of adding response messages to my APIs.
#
GWG
capjamesg[d]: Agreed, which is probably why it isn't specified, but never hurts
hendursaga and [jgmac1106] joined the channel
#
doosboox
If I have a bunch of DOM elements sorted in a certain order, and then I fetch data and form another element that should be sorted somewhere into that sequence... Do I have to redraw the whole sequence or can I insert that element somewhere?
#
capjamesg[d]
GWG Are there any test cases yet? I don’t see anything on the Microsub.rocks website.
#
capjamesg[d]
doosboox I don’t know much about JS but I think you can insert elements before and after nodes.
#
doosboox
Like, say I have '<div>1</div><div>3</div><div>5</div>' and I fetch '<div>2</div><div>4</div>', can I insert those in order or do I have to rebuild the sequence?
#
GWG
Not that I know of. I write my own tests, but it's a weakness of mine
#
capjamesg[d]
If every item in the list had an ID, you could find the place to insert it in.
#
doosboox
capjamesg[d]: I sort of think it's possible too... but in the real case I'd have to sort by timestamps
#
doosboox
actually... that's just an alphabetic sort since they're all the same timezone
#
doosboox
heh
#
capjamesg[d]
If div 2 had an ID, you could select it and then insert after.
#
capjamesg[d]
You can use document.getelementbyid() to get an individual element (the MDN examples don’t show this but it is appropriate for your use case).
#
capjamesg[d]
There might be a better way. I’m sure someone else can weigh in too 🙂
#
capjamesg[d]
GWG I’d love a test suite. I haven’t given my Microsub server as much attention as I would like but I hope to come back to it and add a few new features and test it a bit more.
#
GWG
I'm working on optimizing the one that I worked on with jackjamieson. I did the feed to jf2 code part
#
Zegnat
doosboox: what capjamesg[d] sounds correct. There is a lot of talk about this with JS frameworks ("virtual DOM" and DOM diffing) but at the end of the day the easiest way is to use after/insertAdjacentElement/insertBefore (depending on browser support you are aiming for)
#
Zegnat
Using those methods with elements that already exist will move them
shoesNsocks, akevinhuang2, chenghiz_, johs1, akevinhuang and tetov-irc joined the channel