The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-12-21

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 flamey ah, I'm sorry guys. I think I know what the problem is
00:00 sri jberger: would be a client specific api though
00:00 bpmedley flamey : What was the issue?
00:00 flamey I wanted to run it on port 80, but I got "Can't create listen socket: Permission denied at /usr/local/share/perl/5.18.2/Mojo/IOLoop.pm line 124."
00:01 bpmedley Woopsie.. :-0
00:01 flamey so, I ran it with sudo hypnotoad script.pl
00:01 flamey not a linux guy, like I said before :(
00:02 bpmedley Are things working now for you flamey ?
00:03 hgichon joined #mojo
00:04 flamey bpmedley, it is now yes-- I can stop it with sudo hypnotoad -s script.pl after re-login
00:04 flamey i'm sorry
00:04 flamey and thank you for trying to help!
00:07 flamey well, 3am for me ... have a good rest of your days. and thank you again
00:07 batman flamey: why do you run it with sudo?
00:07 flamey I don't know how else to run it on port 80
00:07 batman Maybe someone else have asked you that already...?
00:08 flamey can you suggest?
00:08 flamey I wanted to run it on port 80, but I got "Can't create listen socket: Permission denied at /usr/local/share/perl/5.18.2/Mojo/IOLoop.pm line 124."
00:08 batman flamey: ok. Do you run the whole process as root or do you change user inside the app?
00:09 flamey I guess the first, cause I don't know how to do the second :)
00:10 batman Right. That's not a good idea, since an "evil" http request can then take over your server...
00:10 batman https://metacpan.org/pod/distribution/Toadfarm/lib/Toadfarm/Manual/RunningToadfarm.pod#Listen-to-standard-HTTP-ports
00:10 batman "Toadfarm" is a wrapper around "hypnotoad"... But nevermind that.
00:11 jberger flamey: or this: https://metacpan.org/pod/Mojolicious::Plugin::SetUserGroup
00:11 batman Just read about "port forward" and check out https://metacpan.org/pod/Mojolicious::Plugin::SetUserGroup
00:12 * sri uses linux capabilities to allow listening on port 80
00:12 batman Sorry not "and", but "or" :)
00:12 jberger another option is to use nginx as a reverse proxy
00:12 batman sri: how? Can you pass me a link?
00:12 jberger http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Nginx
00:13 batman flamey: don't worry about nginx. It's too complicated for what you need now (I think)
00:13 jberger I think its reasonably easy
00:13 sri batman: http://stackoverflow.com/a/414258
00:14 jberger nginx runs as root (ubuntu does that for you)
00:14 jberger (assuming ubuntu)
00:14 flamey I see. ok I'll try that tomorrow, thanks! I saw Digitalocean has an article how to use nginx, but I just wanted to see if the app works. its really a very simple script, nobody uses it but me. but, I want to eventually others to use it, so I'll read up on all that
00:14 batman jberger: of course. You've already set it up :)
00:14 flamey lol
00:14 jberger then with that config file you proxy to your hypnotoad which is running on 8080
00:14 flamey yes, it's ubuntu 14.04
00:15 batman flamey: SetUserGroup plugin is probably what you want
00:16 batman sri: thanks :)
00:17 sri if you deploy with perlbrew and can give the perl binary capabilities, it's pretty comfortable
00:17 flamey ok guys. one more big thank you to everyone for help and tips! it's all for another day for me, now some sleeeep :)
00:19 jberger flamey: nn o/
00:24 jberger sri: i'm really curious about that third caveat
00:28 jontaylor joined #mojo
00:29 * jberger goes to force awakens o/
01:37 sri \o
01:53 good_news_everyon joined #mojo
01:53 good_news_everyon [mojo] kraih tagged v6.38 at eb4ca77: http://git.io/vEIa4
01:53 good_news_everyon left #mojo
01:54 good_news_everyon joined #mojo
01:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vEIai
01:54 good_news_everyon mojo/master 2a04daa Sebastian Riedel: bump version
01:54 good_news_everyon left #mojo
02:03 asarch joined #mojo
02:10 kaare joined #mojo
03:13 miller joined #mojo
03:23 noganex_ joined #mojo
03:58 jberger Ok, it was really good
04:01 * jberger is very excited and relived
04:01 jberger Relieved
04:02 jberger Now who wants spoilers \m/
04:32 Adurah joined #mojo
04:47 * sri has seen it too
04:48 sri so much better than the prequels
04:49 sri had already seen spoilers, but they don't really take much away from the story, it's revealed very early anyway
04:49 preaction you mean vader was luke's father?!
04:52 sri noooOOOOOOOOOOO!
04:56 klapperl joined #mojo
05:14 genio heh
05:14 genio I haven't been able to see it yet.
05:17 genio for anyone who wanted to know, it takes a really long time to dd a 480 GB spinning disk in a USB 2.0 tray to a brand new 480GB SSD
06:12 sri wow, that juniper backdoor password was really creative
06:14 sri they just made it look like the surrounding debug format strings "<<< %s(un='%s') = %u"
06:15 sri so crude, i bet that one is actually chinese or russian
06:15 sri the crypto constants thing sounds more like nsa
07:37 McA joined #mojo
07:53 Lee joined #mojo
08:05 Vandal joined #mojo
08:15 trone joined #mojo
08:27 eseyman joined #mojo
08:52 Witch joined #mojo
09:20 vytas joined #mojo
09:23 vytas joined #mojo
10:02 sugar joined #mojo
10:39 * batman will watch sw7 on the 25th. (Please don't say anything)
10:41 batman http://cdn.meme.am/instances/66061322.jpg
11:27 kaare joined #mojo
11:31 dvinciguerra joined #mojo
11:43 odc joined #mojo
11:58 melo joined #mojo
12:08 neilhwatson joined #mojo
12:36 asarch joined #mojo
12:38 salva joined #mojo
12:54 sue joined #mojo
12:55 sri batman: spoiler, there's no funny speaking in episode 7!
12:58 jberger batman++
12:59 sri looks like a lot of rails folks are actually complaining on twitter about actioncable now :o
12:59 sri mostly about the new deps, redis and eventmachine
13:00 jberger Hehe
13:00 sri i really don't understand their decisions anymore
13:01 sri so, with activejob they went all abstraction, not shipping a job queue... but actioncable is totally tied to redis pub/sub
13:02 sri seems like a panic reaction
13:04 sri if they went all full-stack requiring redis+relational database, they could at least ship a basic job queue
13:05 * sri shrugs
13:23 batman :)
13:28 marcus why are you online, batman? Aren't you in Asia anymore?
13:33 batman marcus: they have internets in Malaysia!!!
13:33 batman ;)
13:33 batman I'm jumping between Internet and vacation mode.
13:34 sri maybe we should ban him until his vacation is over
13:34 batman Too bad we made Convos... Enables me to be on IRC with my phone
13:35 batman sri :p
13:35 * sri imagines batman hiding from his girlfriend for a few minutes in some closet to get online :)
13:37 batman sri: she's next to me writing Facebook message
13:42 batman marcus: sorry. Trying to be funny, but failing and being sarcastic instead..?
13:43 * batman gets back to posting images on Facebook
13:43 batman <3
13:43 batman (Back on the 28th)
13:43 batman Hope you had a wonderful birthday Marcus :)
13:44 Trelane joined #mojo
13:44 marcus batman: It was pretty good.
13:45 Trelane Hello, would someone be willing to read through a Mojo::UserAgent / websocket perl advent calendar entry and double check I'm not making an idiot of myself (like last time with the j() thing)
13:45 batman Trelane: just post the link :)
13:45 batman marcus: cool! Wish I could've been there :/
13:45 Trelane https://raw.githubusercontent.com/perladvent/Perl-Advent/y2015/2015/articles/2015-12-23.pod
13:48 irqq joined #mojo
13:49 jberger :o happy birthday marcus!
13:49 jberger Trelane: reading
13:49 bpmedley ????
13:49 marcus jberger: Thanks :) It was a week ago.
13:51 Trelane Happy week after your birthday marcus ;-)
13:51 Trelane fyi, your advent calendar entry goes live tomorrow
13:51 marcus trelane: Phear :)
13:51 marcus And thanks
13:52 * marcus is playing with openresty and openid connect today.
13:54 jberger Trelane: you don't need build_websocket_tx and start
13:54 jberger You can just use $ua->websocket(...)
13:56 jberger Also (and this is kinda a matter of taste) since it is a script, you don't NEED to check if the ioloop is running
13:56 sri marcus: happy birthday! ????????????????
13:56 Trelane Yeah, I was just being consistent
13:57 jberger sri: I've actually thought about exposing a ping method to send a PING frame
13:58 sri jberger: i've thought about that too, but then you want to be notified of the PONG, and things get complicated
14:00 jberger Trelane: s/slace/slack/
14:00 worklapperl left #mojo
14:01 jberger And again, you don't need to build a POST you can just $ua->post(...)
14:01 batman Trelane: make it simple and easy.
14:02 batman Much easier to sell.
14:02 * sri agrees with jberger and batman
14:03 sri TIL this exists "use Regexp::Common qw(RE_profanity)"
14:03 jberger You could also simplify to:
14:04 jberger return if $already_replied{ $channel }++;
14:04 jberger But now I'm just golfing
14:04 sri we like golfing around here :)
14:05 jberger Yea
14:05 * pink_mist is pretty decent at getting to the green in few strokes, but putting is my bane
14:06 jberger The short game isn't for production code nor examples
14:07 jberger (*STORE,*TIESCALAR)=map{eval"sub{$_}"}qw'map{print&&sleep$|}split//,pop bless\$|++';tie$t,main;$t="Just another Perl hacker,\n"
14:08 sri you'd think there were more golf memes
14:09 sri but i've got nothing
14:09 jberger Dalai llama and Bill Murray at a computer with perl code
14:10 jberger "Big hitter the Lama"
14:11 jb360 joined #mojo
14:13 marty joined #mojo
14:13 marty joined #mojo
14:15 sri jberger: i mean, we could emit a pong event, but i'm not sure how useful that would be
14:16 jberger I mean rather than building a dummy json message
14:16 jberger If you could send a proper ping frame easily as a mechanism to keep the socket alive
14:17 sri how well is PING/PONG supported across browsers these days anyway?
14:18 jberger sri: in Trelane's article there is no browser involved
14:19 sri for the record, you can already do $c->send([1, 0, 0, 0, 9, 'Hello World!']);
14:19 sri which is a PING
14:19 jberger Sure, but who else knows that
14:19 jberger $c->ping
14:20 sri -1 then
14:20 sri it's not important enough for a controller method
14:20 jberger Hmmmm that's true
14:22 jberger Does mojo handle ping requests internally?
14:22 pink_mist $c->tx->ping? or is ->tx not the right place either?
14:22 jberger I guess that's why you mentioned the ping event
14:22 sri jberger: we send a PONG automatically
14:22 jberger Ok
14:22 jberger Good
14:22 sri i mentioned a pong event
14:23 sri nobody cares about the ping
14:23 sri pong is interesting for timing diagnostics
14:23 sri measuring latency
14:23 jberger Oh that's an interesting thought
14:26 sri jberger: btw. from the slack api spec "Not all web browsers support the WebSocket ping spec, so the RTM protocol also supports ping/pong messages. "
14:28 sri in fact, it's not even part of the websocket api spec
14:30 sri they leave handling of ping/pong frames completely up to the implementer
14:36 gryphon joined #mojo
14:43 cpan_mojo Test-Mojo-Plack-0.10 by NICOMEN https://metacpan.org/release/NICOMEN/Test-Mojo-Plack-0.10
16:41 ashimema Is there any advice on how to make sure at least one minion worker is running at an app startup?
16:41 ashimema 'an app startup' meaning a mojolicious full app, run either via morbo or hypnotoad (via toadfarm in my case)?
16:55 sri don't think i agree with this, but he makes a good point http://anticdent.org/persistent-irc-considered-harmful.html
16:55 sri we should encourage people to send questions to the list
16:55 sri especially longer ones
16:56 sri wouldn't it be nice if people linked a list thread here, we answered it, and they would then post the answer to the list? :)
16:57 sivoais joined #mojo
16:57 preaction yeah. i'm having the same problem with the $work slack. it's being used as a substitute for documentation and long-form discussion
16:59 jberger sri: true, though if I may play devils advocate, its hard to know when those longer questions will happen
16:59 jberger and I'll admit I'm quite terrible at keeping up with the mailing list
16:59 sri yea
16:59 sri reminds me that i wanted to prototype a real-time forum, with a more conversational thread style
17:00 Grinnz_ hmmm thats an interesting idea
17:00 sri a thread would be a mini chat room
17:00 sri been meaning to write that one for like 2 years :S
17:01 pink_mist jberger: his point is basically my reason for not wanting to be bugged about desktop notifications in convos :P
17:01 jberger that is a really cool idea
17:01 jberger pink_mist: yeah, I get that
17:02 jberger and I also get the idea of wanting to be away
17:02 jberger and yet de-facto there are enough irc channels that I follow, I don't want to miss things
17:02 ribasushi my solution to this is to work with IRC in read only mode most of the time
17:03 * jberger puts ribasushi back into read only mode :-P
17:03 ribasushi in a terminal that I check during downtime: watch 'grep -Hv "\*\*\*" .znc/logs/[ms][rac]*/*_20151221*.log | sort -t: -k2 | tail -n 50'
17:03 jberger ribasushi: o/
17:03 ribasushi had the unintended but in hindsight wonderful effect
17:03 ribasushi that whenever I see "the usual suspects" say something extraordinarily dumb
17:04 jberger wow, you really mean proper read only, cool
17:04 ribasushi the downside of launching a full blown irc client prevents me from reacting
17:05 ribasushi so most of the time I end up not engaging with the community best and brightest ;)
17:23 genio jeeze.  data transfer is still going fromt he old drive to the new
17:23 genio USB thingy is slow
17:23 melo joined #mojo
17:26 miller joined #mojo
18:02 human39 joined #mojo
18:29 buu left #mojo
18:33 jnbek joined #mojo
18:36 trone joined #mojo
18:38 genio 23 hours and countine
18:38 genio g
18:42 preaction "a thread would be a mini chat room" sounds like Google Wave
18:45 PryMar56 joined #mojo
18:50 Grinnz genio, hope for  no power loss... or that your devices are on a UPS...
18:52 genio ah, man.  I'd just cry a little bit if that happened at this point
18:52 genio machine is a laptop, but the USB dongle thingy is plugged directly into the wall
18:53 Grinnz ... and no battery failure...
18:56 genio "Drunk Florida Man Tried to Use Taco as ID After Accidentally Setting his Car on Fire"
18:56 genio only in FL
19:00 preaction Curse you Florida Man!
19:01 preaction Florida Man: The hero we neither need nor deserve!
19:10 buu joined #mojo
19:10 buu Is there some way to control which handler the renderer uses for template_for style checks?
19:11 buu Right now it just takes the first alphabetical handler
19:12 marty joined #mojo
19:12 meshl joined #mojo
19:21 marty joined #mojo
19:21 zivester joined #mojo
19:52 marty_ joined #mojo
19:58 irqq joined #mojo
20:17 irqq_ joined #mojo
20:22 jb360 joined #mojo
20:54 gryphon joined #mojo
22:37 damaya2 joined #mojo
22:37 damaya2 Hi all, is there any easy way to change subdomain of a Mojo::URL object? e.g., www -> touch
23:03 sri buu: http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering-templates
23:09 lsm joined #mojo
23:15 sue joined #mojo
23:26 buu sri: Sorry, I wasn't clear, I wanted to choose the handler the renderer wouldl look for first
23:32 sri don't think you can
23:34 buu oh
23:34 buu Why doesn't it try the default_handler first?
23:34 sri nobody ever proposed it i guess
23:35 buu oh
23:38 sri i'm indifferent towards the idea, if there's no performance loss or ugly code
23:44 buu Also is there some reason ojo::j doesn't call TO_JSON on refs?
23:44 buu er, blesseds
23:45 sri backwards compatibility i'd say
23:47 buu There are people relying on the backwards compatability of ojo?
23:47 sri doesn't matter, we have a policy
23:48 buu oh
23:48 sri if you really care about it, you're welcome to make a change proposal
23:50 buu ok
23:51 asarch joined #mojo
23:53 buu sri: So can I just change $renderer_self->{templates} to store a hash of handlers instead of an array
23:53 buu Then I can use a lookup in template_handler and template_name
23:53 buu 190       if @$handlers && !defined $handler || grep { $_ eq $handler } @$handlers;
23:53 sri buu: you tell me
23:54 buu ?
23:54 buu You're the one accepting the change request
23:54 sri nope, i'm just one vote
23:55 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Contributing#CONTRIBUTING-CODE

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary