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

IRC log for #mojo, 2016-09-27

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

All times shown according to UTC.

Time Nick Message
00:02 Lee joined #mojo
00:25 sri jberger: your recent political tweets seem a little preachy
00:25 sri i get it, trump is bad :)
00:28 genio I'd be way too afraid to post anything remotely political.  People from work see those things.
00:33 zivester joined #mojo
00:35 sri the results of the recent communal elections around here terrified me
00:35 nicomen genio: where do you live?
00:36 sri out of 12000 citizens almost 400 voted for a literal nazi party, and it's only worse in other regions
00:36 sri (actually a party worse than afd)
00:36 nicomen heard on the radio the other about a dedicated nazi town, that was ... interesting
00:36 nicomen *the other day
00:38 Grinnz sri: i think on average, more non-americans get that trump is bad than americans :P
00:38 vicash genio:  i agree. if Trump becomes president he might start doing witchhunts of people that type with larger hands than hsi
00:39 Grinnz stephen colbert makes a remark about his hands about every other night, and it's glorious
00:39 vicash Grinnz: no wonder Trump is so good at tweeting from his phone, he never fat fingers anything
00:39 Grinnz :)
00:39 nicomen I think it's harder to say one is worse than the other. One says stupid things, the other does stupid things :-/
00:39 * nicomen hides
00:40 * nicomen wishes Jill Stein 2% and Gary Johnson 9% was attending too
00:40 sri rigged system
00:40 vicash yea but they will barely get moderator time.. and the networks love ratings
00:41 Grinnz i don't like stein or johnson much either
00:41 vicash #Aleppo ;)
00:41 nicomen heard a talk on freakonomics about gary johsnon and his party the other day, _he_ didn't sound as bad as the party
00:43 nicomen oh well, time to get some sleep
00:44 * nicomen turns on the debate
00:44 genio nicomen: I live in FL.  About a week after I actively started using my twitter account, the chief legal counsel at work started following me.
00:44 nicomen haha, oops
00:45 Grinnz this is why i've been very careful to delete all of my tweets from like 8 years ago and try not to tweet anything... interesting
00:45 nicomen (so strange hearing old fat rich guys talk about social media)
00:46 Grinnz actually have stopped using twitter again mostly
00:47 vicash genio: follow him back.. remind him that you're watching him too
00:48 genio I don't use facebook at all.  I kind of don't use twitter except to keep up with what's going on in Perl.
00:48 genio The moment they start using IRC, I'm giving up on computers
00:48 * sri just tweets about tech stuff
00:48 * vicash just retweets tech stuff
00:49 genio in case you have all forgotten, XML is terrible and I hate it.
00:49 vicash genio: you can litter your account with all kinds of Kardashian and Kanye West stuff and your legal counsel will get suggestions for following them too
00:50 sri genio: unfollowed!
00:52 genio :)
00:52 sri heh, @opensuse followed me on twitter, guess i'm in trouble too
00:52 nicomen genio: judging by my last page on twitter, I would probably not have your job anymore
00:53 Grinnz genio: it's ok, they went directly to slack
00:53 genio Grinnz: HAHAHA.  I'm perfectly safe, then!
00:58 nicomen heh, now Turner/CNN is shutting down the bootleg youtube streams
00:59 Lee joined #mojo
01:04 Grinnz there's been commits to p5-mop ????
01:08 genio \o/
01:09 Lee_ joined #mojo
01:23 genio This is hard to watch
01:35 PryMar56 joined #mojo
01:44 jberger They might have been lately yes, sorry about that
01:46 jberger I'm a little scared
01:53 daemonic joined #mojo
01:58 mpapec https://www.youtube.com/watch?v=31FFTx6AKmU :o
02:08 noganex joined #mojo
02:28 bpmedley http://systemswe.love/ <-- Looks intriguing
02:41 bpmedley FatalNIX Have you seen Kendo UI Core with its Angular integration?
03:04 jberger bpmedley: i know you are a fan of kendo
03:04 bpmedley Yeah, it's works really well with Mojolicious
03:05 jberger Personally i find it pretty confusing
03:05 bpmedley Hrmm, that could be because the documentation is a giant reference.  May I ask what is confusing?
03:06 jberger I don't think I'd suggest it for a first reactive framework
03:06 jberger It is a huge toolkit, more on par with extjs
03:06 jberger It is for building giant web applications
03:07 jberger At least as far as I've seen
03:07 jberger I'm not saying that's bad
03:07 jberger But I think it isn't a first framework, at least as I see it
03:07 bpmedley I personally believe with all the demos and documentation that a newbie can pick up Kendo.  It's what I wish I had when I started, so that's why I'm referring them towards Kendo/Mojolicious.
03:08 jberger We don't need to agree on this either of course
03:08 jberger Your opinion is valued too
03:09 bpmedley I greatly admire your opinion, I have learned a lot from you.  What would do you wish you had as a newbie?
03:09 Grinnz https://github.com/Grinnz/Mojo-IOLoop-Subprocess-Sereal/commit/f7f467a373be90648f7de15e344487a0a4dd2d7e is this too cute :P tried to find a way to get the semantics of Mojo::IOLoop->subprocess without actually butting into Mojo::IOLoop
03:09 Grinnz too much of a risk of memory leaks if i only have the normal constructor
03:17 bpmedley Grinnz : I must be confused.  Can you redefine deserialize and serialize in Mojo::IOLoop::Subprocess for the same effect?
03:17 Grinnz they are attributes for the purpose of being overridden
03:21 jberger Grinnz: that's an interesting way to do it, the Safe::Isa approach
03:22 jberger bpmedley: to your question, are you asking about front end as far as what i would like to have had?
03:23 bpmedley Perhaps a different question: Looking over the code, it seems you're approach is creating a new method ($_subprocess) as opposed to overriding default behaviour of Mojo::IOLoop::Subprocess?  Is that correct?
03:23 jberger If that's the question, i think I'd still like better dependency management in the front end, that still confuses me
03:24 bpmedley jberger : Yuppers, for frontend view logic and client facing logic
03:25 bpmedley I agree lots of extra time spent in that realm.  I still manually download and integrate javascript in pages.
03:25 jberger Honestly i think that as es6 becomes more available i think newbies will have a much better experience
03:26 jberger That isn't a library answer
03:26 jberger I guess i feel like being able to crawl before you walk is important in any new thing you learn
03:27 jberger Perl does that well, i think vue does that better than most
03:27 bpmedley However, from a newbie's perspective, what would you relate that they should peruse starting today?
03:28 jberger You can build a small reactive widget from the basic html/js they already know
03:28 bpmedley And if they don't know js/html?
03:28 jberger Just like mojo, you need to know some basic foundation
03:29 jberger That's why we link to mdn and some perl documentation first
03:31 jberger Also, and as you say of kendo, vue has some good examples on its site
03:32 asarch joined #mojo
03:32 Grinnz bpmedley: right, i want to override the method of Mojo::IOLoop->subprocess specifically, but without actually overriding that method or adding anything to the Mojo::IOLoop class
03:32 bpmedley Grinnz : My only thought is that the $_subprocess method may be confusing.  I'm wondering if providing the exact same interface as Mojo::IOLoop::Subprocess would be desirable.
03:33 Grinnz that is the interface to Mojo::IOLoop::Subprocess
03:33 bpmedley Oh!  The wrapper function.  Duh.
03:35 bpmedley Then, my question is what about other types of serializations?  Should some consideration be thought of for them?  For example, what would a method look like for a Base64 encoded serialization?
03:36 jberger bpmedley: base64 is fire binary
03:36 jberger Errr
03:36 jberger For binary data
03:36 jberger It also isn't particularly efficient
03:37 jberger For Mojo core the options are basically json, data dumper or storable
03:37 bpmedley Sorry, I should have thought more before I said Base64
03:38 jberger Sereal is a good choice for an external encoder
03:40 bpmedley Also, does $_subprocess feel Mojo-like as a method name?
03:41 jberger I'd say that that method name takes its lead from Safe::Isa
03:41 jberger When you do that kind of trick you need to use a variable
03:42 jberger And it makes sense to try to keep it from clashing with variables that you might already have in scope
03:42 bpmedley That makes sense.
03:43 jberger Exporting package variables is weird but sometimes it's the only way
03:44 jberger File::chdir uses all caps variables to denote them but that carries the weight of being very global
03:45 jberger These ephemeral methods aren't global at all
03:45 jberger Indeed that's the point
03:52 Grinnz yeah, i'd rather it just be a normal method but it needs to be something you can call on Mojo::IOLoop the class or any Mojo::IOLoop object
03:52 Grinnz so a coderef works for that
03:53 Grinnz and Safe::Isa/Object::Tap are the only real precedent for this sort of thing I know of
03:53 jberger For modules yes
03:54 jberger But i use the pattern regularly rather than monkey patching
03:54 Grinnz it's definitely much nicer than monkey patching :P
03:56 jberger http://blogs.perl.org/users/joel_berger/2014/01/create-your-own-testmojo-method.html
03:56 jberger Before Test::Mojo::WithRoles but to the same end
04:05 bwf joined #mojo
04:07 bwf joined #mojo
04:08 inokenty-w joined #mojo
04:37 cpan_mojo Mojo-IOLoop-Subprocess-Sereal-0.002 by DBOOK https://metacpan.org/release/DBOOK/Mojo-IOLoop-Subprocess-Sereal-0.002
05:28 Grinnz in fact i think i might drop the subclass entirely. no reason to have that when i can just have the method set the attributes
05:51 polettix joined #mojo
05:56 Grinnz and done
05:58 cpan_mojo Mojo-IOLoop-Subprocess-Sereal-0.003 by DBOOK https://metacpan.org/release/DBOOK/Mojo-IOLoop-Subprocess-Sereal-0.003
05:58 dod joined #mojo
06:00 dod joined #mojo
06:04 dod joined #mojo
06:22 dod joined #mojo
06:25 jamesaxl joined #mojo
06:27 mbudde joined #mojo
06:27 salva joined #mojo
06:46 dod joined #mojo
06:48 dod joined #mojo
06:55 AndrewIsh joined #mojo
06:56 polettix joined #mojo
07:13 trone joined #mojo
07:14 Vandal50506 joined #mojo
07:46 jamesaxl joined #mojo
07:46 jamesaxl joined #mojo
07:53 cpan_mojo Mojolicious-Plugin-OpenAPI-1.02 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.02
08:22 Lee joined #mojo
08:40 Lee joined #mojo
08:42 rshadow joined #mojo
08:42 batman what's the downside with setting MOJO_REVERSE_PROXY=1 by default? just some minor overhead or is there any security risk?
08:42 batman i'm considering setting it in convos for easy setup behind reverse proxy, but i'm not sure what will happen if i do...
08:56 jamesaxl joined #mojo
08:57 oykha joined #mojo
09:00 rshadow joined #mojo
09:14 sri batman: security risk
09:14 batman sri: because you can manipulate the origin ip?
09:15 sri and the protocol
09:16 batman what happens if you change the protocol?
09:43 Lee https://www.youtube.com/watch?v=6bbIBs0P2t0
09:44 mpapec wild guess; client can force http response instead of https
09:44 mpapec not sure if that poses real security threat..
10:00 sri what could possibly go wrong with making downgrade attacks a feature
10:05 osfabibisi joined #mojo
10:08 * sri closes https://github.com/kraih/mojo/issues/1002
10:56 tchaves joined #mojo
11:06 dotan_convos joined #mojo
11:07 tchaves joined #mojo
11:15 blonewolfs joined #mojo
11:57 kaare joined #mojo
11:59 sri hope nobody here is using StartCom ssl certs https://docs.google.com/document/d/1C6BlmbeQfn4a9zydVi2UvjBGv6szuSB4sMYUcVrR8vQ/preview
11:59 sri there's some shady shit going on
12:08 blonewolfs i use it but, i can't see your link (corporate security).  can you give a summary?
12:25 bobkare blonewolfs: Mis-issuing certs, possible backdating and lying to mozilla about a number of issues. Looks like WoSign and StartCom are about to be removed from the trust store, at least for newly issued certs after some date
12:28 blonewolfs thanks.  i'll definitely look into that.
12:47 zivester joined #mojo
12:55 BinGOs the snake-oil salesmen of snake-oil salesmen
12:58 howitdo joined #mojo
13:07 gizmomathboy joined #mojo
13:29 vicash mpapec, batman: http content can be changed during a man in the middle attack by your internet provider or by some malicious hacker who is sniffing an open wifi in a starbucks
13:29 vicash always use https.. it is free now with letsencrypt
13:29 vicash batman: i never use the MOJO_REVERSE_PROXY variable for my reverse proxies.. so far have had no problem using Nginx to reverse proxy to a couple of mojo servers over an SSH tunnel
13:30 vicash batman: the only thing with that kind of setup is that i don't use AssetPack to supply large CSS/JS libraries .. i just use Nginx to do that
13:31 batman vicash: sorry. i fail to see how any of that is relevant.
13:32 vicash (04:42:08 AM)batman: what's the downside with setting MOJO_REVERSE_PROXY=1 by default?
13:33 arthas joined #mojo
13:35 sri https://en.wikipedia.org/wiki/Downgrade_attack
14:18 asarch joined #mojo
14:42 zivester joined #mojo
14:59 sri i assume nobody here has ever seen anything like this https://github.com/kraih/mojo/issues/1002
15:00 pink_mist iirc at one point I thought I had, but it was some bug in my own code
15:00 pink_mist too long ago for me to remember any details though
15:02 jberger I was going to say, what I assume is happening is that they have a global somewhere that leaks session information
15:03 jberger like a current user global that doesn't get cleared out correctly (vs a current user stash value)
15:03 jberger the only other thought I have is that they might be testing two different users in the same browser in different tabs
15:04 jberger yes, sigh, I have seen that and even been required to ensure that it works as they expected
15:04 jberger that was a fun day
15:06 itaipu joined #mojo
15:08 jberger I can summarize that on the issue
15:08 zivester joined #mojo
15:11 sri what's the best practice for two different users in two tabs?
15:12 genio Two browsers. :)  or an incognito window vs a normal window
15:12 khfeng joined #mojo
15:13 sri heh
15:15 sri i can only think of javascript shenenigans to store a unique id per tab
15:15 PryMar56 joined #mojo
15:16 jberger eyp
15:16 jberger yep
15:16 jberger what this place actually had was multiple user logins for what should have been roles
15:17 jberger they would log in as one user in one tab and another user in another tab to be able to perform different functionality (say they were both purchasing and finance roles, they would have me_purchasing and me_finance usernames)
15:18 jberger so what I did was every time they logged in the username was added to the cookie
15:18 jberger and it was associated with a role name that I gave the individual pages
15:18 jberger it was a nightmare
15:21 dabudabu Did the guy who posted the bug above actually get a bug report from his users?
15:21 jberger the way it had worked in their cgi days was every request reauthenticated itself via a header and the login information was stored in the javascript for use by api calls
15:22 Grinnz yeah you should definitely not have users logging into multiple accounts under normal operation
15:22 jberger they had some kind of session state that also got passed back and forth via another header
15:22 jberger but what it meant was that it actually did handle that situation kinda cleanly
15:22 jberger strangely enough
15:23 jberger well I came in and was porting the site to mojo (that was why I was there) and convinced them to go to cookies
15:23 Grinnz if you have to, you'll need to do it like Google where your session stores each account then the url or query specifies which one the tab is using
15:23 jberger and I was never told about the multiple user thing
15:23 jberger until the day before rollout when the one UAT user finally tried it
15:23 jberger but they could not delay the release for other reasons
15:24 jberger so I had to implement the switcheroo one evening in a mad rush
15:24 Grinnz ????
15:24 jberger yeah
15:26 jberger while it sucked big time, I was actually kinda proud that I solved it
15:26 genio ah, yea. I forgot about that.  Google does a pretty good job of multiple logins
15:27 dabudabu Tell them to use two different browsers instead :<
15:27 Grinnz I use incognito for that a lot
15:28 jberger chrome actually even has multiple personnas you can use, its rare to see it done but you can
15:29 dabudabu Firefox has profiles too... They were used more often in the Netscape days I think
15:40 PryMar56 joined #mojo
16:03 sri samsung is so screwed http://www.cultofmac.com/446897/galaxy-note-7-replacement-batteries-catch-fire/?utm_campaign=galaxy-note-7-replacement-batteries-catch-fire-too&amp;utm_medium=twitter&amp;utm_source=twitter
16:03 genio uh oh
16:03 jberger :o
16:15 itaipu joined #mojo
16:23 disputin joined #mojo
16:36 sri well, at least the samsung stores seem prepared :D http://i.imgur.com/Zj9G69P.jpg
16:48 dod joined #mojo
17:37 genio jberger: My trip to Chicago got nixed last night
17:45 sri no deep dish pizza for you
17:46 genio nope.  turned out to be too much of a hassle
17:47 abra joined #mojo
17:47 genio Mrs. genio would be in the conference from 7am-8:30pm, so I wouldn't really be able to see her.  The hotel is a ways from the city itself. The tickets are expensive (~$700). and I'd have to drive 1.5 hours each way to drop the puppies off with my parents today and sunday
17:48 genio and Thursday's my birthday.  So, lots of hassle for not that much time to actually get to be a tourist in Chicago
17:57 itaipu joined #mojo
17:59 itaipu joined #mojo
18:12 abra_ joined #mojo
18:26 jberger awwwww
18:29 genio This just means that I will spend my birthday in the middle of the Gulf of Mexico somewhere fishing. :)
18:30 jberger that sounds nice too, probably nicer than Chicago I'll guess
18:31 genio It's one of my more favorite things to do
18:31 itaipu joined #mojo
18:35 jberger the wife and I had fun about a year ago hanging out at dockside restaurants on the middle keys
18:35 jberger key west didn't do much for me
18:35 jberger I'm not a big partier
18:36 genio Yea, I'm too old for the partying thing too
18:43 arcanez joined #mojo
18:44 vmvm joined #mojo
18:46 itaipu joined #mojo
18:49 vmvm hello everybody ! it is possible use one ssl connection in non-blocking requests with mojo useragent ? I'm try to use soap service in which authorization is made in first request, and all following requests in one ssl connection is authorized (no cookies)
18:50 vmvm When I use blocking requests everything is fine
18:51 jberger is this that weird microsoft protocol that requires keep alive?
18:51 jberger I think we've generally said that we don't officially support that
18:55 vmvm its not microsoft, this is barco projector, I get wsdl file from it and try to communicate. if I use non-blocking requests, I have one ssl connection and everything ok, but when use non-blocking request I have new connection for each request ((
18:56 jberger vmvm: if you use non-blocking requests you can still keep-alive, you just have to wait for the first request to finish
18:56 jberger and keep-alive isn't guaranteed even if you did
18:57 jberger you don't get some token from the service to indicate that you have authenticated?
18:57 jberger anyway, there are some other protocols that require that you keep the same connection and we've said before that we don't support that
18:57 jberger it might work because of keep-alive
18:58 jberger but it isn't a feature
18:58 vmvm no tokens unfortunately (( stupid service ((
18:59 vmvm I was try to send second request from callback of first request, not working ((
19:00 jberger try wrapping that second request inside of a next_tick
19:00 jberger but again, you can see why this isn't officially supported
19:00 jberger http requests are connection pooled with a keep-alive optimization
19:01 jberger why do you want this to be non-blocking anyway?
19:01 jberger if the blocking form works as expected (usually)
19:02 vmvm I must controll 10 projectors at same time
19:03 vmvm ok, will use blocking requests. thank you
19:03 jberger you could rolling something yourself with Mojo::IOLoop::Client if you want
19:05 sri that actually shouldn't be too hard
19:06 vmvm ok, I will try
19:06 sri i imagine for a new connection you get auth failures you can react to
19:06 sri and just start follow-up requests in a next_tick like jberger said
19:08 vmvm a little example would be helpfull ))
19:09 sri don't think one exists for that
19:11 jberger vmvm: do you care about responses from the server?
19:11 jberger I guess you have to see authentication failures
19:13 vmvm yes, I have auth failure, I send login and receive response that I'm authentificated, but next request is in new ssl connection and I'm not logged in ...
19:14 vmvm I must send login command in every request ))
19:14 vmvm but I can't send everything in first request else
19:16 vmvm vicious circle ((
19:19 jberger I was just asking to see if you could skip all the boring parsing bits and just send two/multiple tcp messages
19:19 jberger but yeah, that's not going to work
19:21 arcanez is it possible to do real-time with websockets? or are all ->send()s done at once?
19:22 jberger arcanez: I don't understand your question
19:22 arcanez right now, all my ->send()s are showing up at the same time in the browser
19:24 arcanez basically, I'd like to ->send('grabbing foo...'); $foo = grab('foo'); ->send($foo); ->send('grabbing bar...');
19:24 arcanez where grabbing foo & bar are not instantaneous
19:28 arcanez I tried ->send('foo', sub { shift->send('bar')); but everything still shows up at once
19:28 pink_mist that way leads to callback hell
19:28 pink_mist perhaps try using a delay
19:28 arcanez I'm certain it does
19:29 sri ->send('foo', sub { shift->send('bar')) } is definitely async
19:30 sri maybe play with the chat app https://github.com/kraih/mojo/blob/master/examples/chat.pl
19:31 sri anyway, what the callback does is make sure the previous message has actually been written to the socket
19:31 sri no more, no less
19:31 sri ->send is always async
19:32 sri it just writes to a buffer, which gets emptied once the event loop is in control again
19:32 sri and the socket writable
19:34 genio Mock web servers in tests is such a pain when dealing with non-mojo apps.  Don't realize how good you have it until you're using something else
19:35 preaction there's a Test::WWW::Mechanize for Catalyst (and probably for Dancer as well). outside of that... you can wrap CGI in a Mojo app and use Test::Mojo ;) you can also wrap any PSGI in a Mojo app and use Test::Mojo ;)
19:36 jberger arcanez: sri makes a good point, do you have a lot of blocking going on during the multiple sends? meaning do you actually give control back to the loop between sends?
19:36 jberger preaction++
19:36 jberger Test::Mojo::Role::PSGI
19:37 arcanez jberger: is there a way to force control back to the loop? I'm relatively new to event loops
19:38 jberger the loop runs whenever you are done doing what you are doing
19:39 jberger so if your current set of instructions is sub { $c->send('one'); sleep 2; $c->send('two'); sleep 2; $c->send('three') } then they will show up all at once
19:39 genio preaction: https://github.com/libwww-perl/libwww-perl/blob/bb68942204ae8347d329375f79e409c2b2a53beb/t/robot/ua-get.t#L47-L52  makes me sad
19:41 preaction i don't see why. it's testing LWP, which is not async or otherwise, and needs some kind of backend process daemon to communicate with
19:42 genio The way it has to do it, I mean.  Running such a test with:   perl -Ilib t/foo.t    will fail when it executes forked daemon because it can't find the module you're testing, etc.
19:43 jberger why doesn't it just fork? fork emulation I guess?
19:43 arcanez jberger: I'm using SNMP::Info within my websocket. as part of the ->on(message => sub { .. }), I instantiate an SNMP::Info object and then ->send($info->query1()); ->send($info->query2())
19:44 arcanez so my guess is it is always blocking and not giving control back to the loop until after
19:44 jberger arcanez: have you tried Mojo::SNMP?
19:44 pink_mist running a subroutine always blocks until the subroutine returns
19:44 arcanez how'd I know that was coming ;)
19:45 arcanez jberger: Mojo::SNMP is more akin to SNMP::Effective (same author, actually).. SNMP::Info abstracts everything out, so I don't care about vendor specifics at the top level
19:46 arcanez but yes, I briefly looked at Mojo::SNMP (when looking at SNMP::Effective for a different purpose than this websocket code) and chose S::E over it, due to primarily not having Mojo in my chain
19:46 arcanez any previous async laying around is done in POE
19:46 arcanez for better or worse
19:47 jberger POE works as long as you have the right adapters in place
19:48 jberger I'm assuming you are making lots of snmp requests and sending the results back over the websocket when they are done?
19:48 arcanez that's the idea
19:48 arcanez initially, this webserver had SNMP access. that is not the case, so now I'm 'proxying'
19:48 jberger if that's the case then you can do the blocking request, send the websocket message, then don't start the next blocking snmp request until the drain callback in the first one
19:49 jberger ugh, a blocking websocket snmp proxy ... sounds like a bad idea
19:49 arcanez $ws->send($info->name(), sub { shift->send($info->layers()) });
19:50 jberger yeah, basically
19:50 jberger assuming I understand your snmp library's interface
19:50 arcanez I don't want it to be blocking, but given its current architecture, it is
19:51 arcanez for this specific instance, I'm not getting X and returning it specifically. I want to grab a bunch to provide a nice page. there is potential to take in a specific OID and return it
19:51 jberger also snmp is a request/response paradigm where a websocket isn't
19:52 jberger anyway, with the exeption of having to do the oids yourself, I think you'd have an easier time of it with Mojo::SNMP
19:52 jberger and yes, oids are a huge pain, so that's up to you
19:53 arcanez for the most part (if not all) I'm getting RFC ones
19:54 jberger with Mojo::SNMP it is trivial to fire off lots of parallel snmp requests to get lots of data "at once"
19:54 jberger does connection limiting etc
19:54 arcanez one downside to Mojo::SNMP is it uses Net::SNMP instead of SNMP.pm
19:54 jberger I don't know the ups and downs of each
19:55 arcanez think pure perl vs C wrapper
19:55 arcanez and SNMP.pm is written by the net-snmp (ucd-snmp) guys
19:55 arcanez s/guys/dev team/
19:55 jberger c vs pp doesn't make much difference when latency is going to be your bottleneck
19:56 jberger if you have to make all the requests sequentially blocking
19:56 jberger ¯\_(ツ)_/¯
19:56 arcanez fair, it's just odd he moved from one to the other (when going from SNMP::Effective to Mojo::SNMP)
19:57 jberger batman might be able to comment, though I know he hasn't used Mojo::SNMP in a while
20:00 jberger I rewrote our company's reverse dns extraction script (walking all of our switches for name information) using Mojo::SNMP
20:00 jberger it went from taking ~30m to ~30s
20:00 arcanez what'd you use before
20:00 jberger does it matter? parallelization was the key
20:00 jberger I could try to go back and check
20:00 arcanez not that important :)
20:01 jberger but I don't think that's the issue
20:01 arcanez going to be polling metrics on a few hundred network devices soon.. and was looking at SNMP::Effective and stumbled upon Mojo::SNMP in doing so
20:01 arcanez but I'm not sure how well that'll fit in with POE
20:02 jberger https://metacpan.org/pod/Mojo::Reactor::POE
20:03 arcanez ah yes Grinnz showed me this
20:03 jberger Grinnz++
20:05 arcanez Mojo::IOLoop->one_tick(); seems to help me
20:08 jberger yeah, you are basically spinning the loop yourself
20:08 jberger ala http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Web-server-embedding
20:09 sri which is a really really bad idea ;p
20:10 sri maybe subprocess would work if you want to keep using a blocking snmp api
20:10 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Subprocesses
20:11 sri it's a new experimental thing though
20:11 jberger if you already have a POE loop why not just use the POE reactor?
20:11 sri right, if you have POE just go that direction
20:11 arcanez this is standalone, no POE here
20:11 arcanez brand new code
20:12 sri we also have this kinda stuff http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Event-loops
20:12 sri lots of options :)
20:13 jberger arcanez: then definitely just use the built in loops rather than one tick
20:13 sri oh look, Grinnz  also owns POE:➿:EV
20:14 sri oh, ddos attack on freenode?
20:15 sri was wondering why my irccloud got so slow again :S
20:15 jberger is that :Loop: ?
20:16 sri lol
20:16 sri irccloud replaces that with a unicode loop
20:16 sri ????
20:17 sri that's gonna get annoying
20:17 jberger right, it did on ours too, for POE :: Loop :: EV
20:51 CW joined #mojo
20:53 batman jberger: we need to fix that...
20:55 sri well, irccloud has a setting :)
20:55 sri POE::Loop::EV
20:55 sri \o/
20:56 Grinnz you can disable it entirely, but then you don't get autocomplete emoji :(
20:56 Grinnz oh i guess you do
20:56 batman oh! cool, so it was irccloud that did that and not convos :)
20:57 Grinnz it's just not autoconverted if you don't select it
20:57 sri :wink:
20:57 sri hmm
20:57 Grinnz :loop: :loop:
20:57 Grinnz nope doesn't work :(
20:58 pink_mist POE::colon:Loop:colon::EV
20:59 Grinnz that's not considered an emoji so much :P
21:00 pink_mist . o O ( a :colon: emoji ... yeah, no thanks )
21:01 batman arcanez: so Mojo::SNMP is very capable.
21:02 batman i've actually not used it myself, but colleagues of mine and other people i know do use it with great success
21:02 batman it's not slow, as i suspected it would be.
21:16 PryMar56 joined #mojo
21:35 sri btw. mst brought up the unix domain socket thing again earlier in #catalyst, and how he uses horrible hacks to make hypnotoad use unix domain sockets
21:36 sri i'd still accept a patch https://github.com/kraih/mojo/issues/883
21:36 sri if anyone feels like working on it
21:49 * sri wonders what mechanical keyboard might be best for programming
21:50 bpmedley https://elitekeyboards.com/products.php?sub=pfu_keyboards,hhkbpro2&amp;pid=pdkb400b <-- These are popular, I believe
21:50 sri guess i want red or brown cherry switches
21:51 pink_mist http://imgur.com/gallery/sbipG gives some nice info about that kind of thing (though it's focused a bit much on gaming I guess)
21:51 sri have heard of the happy hacking keyboards
21:51 sri and of the daskeyboard :)
21:51 lluad I like the realforce with the topre. But there isn't a fraction of the hobbyist third-party vendor ecosystem for them, so if you need mario figures on your escape key they're not for you.
21:52 Grinnz i have reds, but that keyboard is mostly for gaming :P
21:52 * vicash has been using the same Das Keyboard Ultimate for 11 years now
21:52 Grinnz i hear people like reds for typing as well, though
21:52 Grinnz keys just bottom out with no bump
21:53 sri both reds and browns seem great for hybrid use
21:53 Grinnz i havent used browns much to compare them honestly
21:53 jberger Phil21 probably has opinions here
21:53 jberger I think you all are crazy
21:53 Grinnz lol
21:53 sri lol
21:53 * jberger goes for definitive click, very short throw
21:53 jberger <3 the magic keyboard from apple
21:53 Grinnz either of them is still kind of too loud for in the office here
21:54 sri i guess keyboard hipsters will laugh at me for wanting backlighting
21:54 Grinnz i don't mind backlighting, but it serves no purpose for me :P
21:54 Grinnz my last keyboard had it
21:54 Grinnz but it wasn't mechanical
21:54 pink_mist I really love backlighting
21:55 pink_mist my current keyboard (with blue mx switches) has 5 levels of backlighting =)
21:55 polettix joined #mojo
21:55 vicash i think the monitor provides enough light on my keyboard ;)
21:55 sri aren't blues super loud?
21:55 pink_mist yeah they are
21:55 bit_shifter yes
21:55 pink_mist but I like it
21:56 bit_shifter I have blues too
21:56 bit_shifter WASD CODE
21:56 Grinnz sri: you want this one ;) https://www.amazon.com/Razer-Overwatch-BlackWidow-Mechanical-Keyboard/dp/B01DXVKETE
21:56 Grinnz the pictures don't really do it justice, the lighting responds in various colors to different heroes and ultimates etc
21:57 sri oh hey, a razer keyboard that doesn't look like a toy ;p
21:58 Grinnz https://www.youtube.com/watch?v=8_x9B5yp420 the video i saw about it
21:58 sri hahaha, they used a nice font because it's a special edition
21:59 Grinnz 14 min in
21:59 sri kinda like this one, if only it had backlighting http://www.daskeyboard.com/daskeyboard-4C-professional/
22:00 sri looks like daskeyboard now use chinese switches for everything
22:01 cpan_mojo Mojolicious-Plugin-OpenAPI-1.03 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.03
22:01 Phil21 Grinnz: I hear you need keyboard options
22:02 Grinnz sri not me :P
22:02 sri me :)
22:02 sri Grinnz: that is so pretty
22:04 Phil21 oh
22:04 * Grinnz is quite happy with his CM Storm Quickfire XT with reds
22:04 * Phil21 reads backscroll
22:04 Phil21 yeah, the quickfire is a great board
22:04 Phil21 best bang for buck by far
22:04 sri think i kinda know what i want, no numpad, red or brown switches, backlighting,  high quality materials, not looking like a toy (hello razer!)
22:05 Phil21 Filco Majestouch II TKL w/ keyswitches of your choice
22:05 Phil21 for the high-end
22:05 Phil21 otherwise yeah, CM storm is very similar for a better price but you get to deal with some shitty branding
22:05 Grinnz some of the Quickfires have backlighting, but don't know if any of the ones without numpads do
22:05 Phil21 http://www.keyboardco.com/product-images/filco_majestouch_tenkeyless_yellow_keys_usa_keyboard_large.jpg
22:05 sri Phil21: doesn't look very high end
22:06 Phil21 that's my daily driver
22:06 Phil21 filco is about the highest quality mechanical board you'll get until you get into the insane custom stuff
22:06 Grinnz Quickfire Pro and Ultimate are the ones with backlighting and those are both full size
22:06 arcanez and here I am, using http://www.logitech.com/en-us/product/wireless-solar-keyboard-k750-mac
22:06 Phil21 I mean, at this end of the market most stuff is pretty good :)
22:06 sri i like how the daskeyboard is made from aluminium
22:06 Grinnz arcanez: lol
22:07 Phil21 daskeyboard is pretty much all marketing at this point, I haven't kept up on it but not a big fan
22:07 sri arcanez: haha
22:07 Phil21 they used the same factories as some cheaper boards at least a couple years ago, was easy to get a clone for less
22:07 Phil21 otherwise solid boards
22:08 Grinnz Quickfire Rapid is the one without a numpad, Quickfire TK doesn't have the keys between the letters and the numpad (i guess since the numpad sort of has those keys already?)
22:08 Grinnz kind of weird
22:08 arcanez keyboard doesn't really matter to me *shrug*
22:08 Phil21 Quickfire Rapid is made by the same factory Filco uses (again, a couple years dated info but I believe it to be current)
22:08 sri corsair k70 seems also extremely popular
22:08 Phil21 so it's definitely the best deal if you don't mind the keycaps/logos/etc.
22:08 arcanez batman: did you think Mojo::SNMP would be 'slow' due to the pure perl translation? the docs mention using Net::SNMP::XS
22:09 Phil21 yeah, corsair k70 is solid
22:09 Phil21 I also like varmillo
22:09 arcanez Grinnz: I use it to code and play League of Legends :)
22:09 arcanez Grinnz: so nothing crazy
22:09 Grinnz oh here https://www.amazon.com/QuickFire-Mechanical-Keyboard-ActivLite-Technology/dp/B00JM61264/ref=sr_1_1?ie=UTF8&amp;qid=1475014171&amp;sr=8-1&amp;keywords=quickfire+rapid-i
22:09 batman arcanez: i just did the code as an experiment, and it worked out nicely. i don't know much more than that
22:09 Grinnz Rapid-i has backlighting but it's just white
22:09 Phil21 sri: too bad you're not in my office, I have a dozen or so loaners floating around here
22:10 Phil21 just brought in a TKL red :)
22:10 vicash What do you guys use to implement Single Sign On ? Is there some standard Perl module that does it or does everyone roll their own ?
22:10 Phil21 oh, yeah backlighting makes it harder
22:10 Phil21 maybe look at Ducky Shine
22:11 Phil21 although I honestly didn't care for my ducky shine I, it seemed poor build quality to me
22:11 Phil21 keys were very inconsisent
22:12 sri bummer, corsair also uses a toy font
22:13 arcanez batman: it looks like more fun to use than PoCo::SNMP, but may not more fun than SNMP::Effective *shrug*
22:14 batman it's a lot more *fun* than SNMP::Effective
22:14 batman SNMP::Effective makes no sense compared to Mojo::SNMP
22:14 batman imho
22:14 arcanez not a fan of callbacks?
22:14 sri this one kinda looks interesting, but chinese switches again https://www.amazon.com/Das-Keyboard-Division-Mechanical-DKDIVZX40SFT/dp/B01ABQONY6/
22:15 Phil21 I really haven't kept up on daskeyboard at all, but it's kinda been considered the Bose of keyboards for a while :)
22:15 sri lol
22:15 Phil21 and yeah, I'd go with gateron or cherry switches
22:15 vicash at least it's not the Beats of keyboards
22:15 sri i'm german, i want cherry switches!
22:16 batman arcanez: i need to get some sleep. sounds like you want to figure this out by yourself anyways
22:17 sri reds are really hard to find
22:17 sri most keyboards come in blue and brown versions
22:20 Grinnz i noticed that too, i would have gotten one with browns but reds were on sale at the time
22:22 jberger arcanez: I had that keyboard, still do for emergencies, but the keys are too squishy and the throw is too long after a macbook pro/magic keyboard
22:23 arcanez jberger: I think I have the magic keyboard @ work
22:24 arcanez magic mouse leaves a little be desired imho.. https://smile.amazon.com/Etekcity-Scroll-Gaming-Programmable-Buttons/dp/B00MQWOPA6 is my mouse, which I care about more than my keyboard
22:24 Grinnz magic like smartmatch, or magic like Variable::Magic ;)
22:24 sri on top of finding a keyboard i like, i also have to find one that is being sold in germany with a us layout :S
22:25 sri you'd think there were more programmers demanding us keyboards
22:27 jberger sri: that's less of a problem, you know people in the US
22:27 pink_mist can just order from amazon.com instead of amazon.de :P
22:28 batman joined #mojo
22:29 arcanez is 'batman' JHTHORSEN?
22:29 sri jberger: heh :)
22:30 sri pink_mist: i actually can't
22:31 pink_mist 0_o
22:31 sri just tried, they reject german addresses at amazon.com
22:31 pink_mist huh, weird
22:31 sri my account works, but no shipping here
22:31 arcanez nein!
22:31 pink_mist guess I'm lucky there isn't an amazon.se, so I can choose any amazon.* shop to shop from
22:32 sri likely
22:32 pink_mist have had no problem getting from .de, .com, .uk, .jp
22:32 sri i can order from all the european amazons
22:32 batman joined #mojo
22:33 jberger arcanez: yes
22:33 batman arcanez: yeah, i'm jhthorsen
22:33 disputin joined #mojo
22:35 disputin joined #mojo
22:36 arcanez batman: so you wrote Mojo::SNMP as an experiment moreso than an actual use case? (since you had already written S::E)
22:36 batman arcanez: i haven't used snmp since around 2007
22:37 bit_shifter If I'm using "under", redirecting to a login page if the user isn't authorized to view the page, then posting the login info... what's the best way to forward/redirect the user to their intended destination?
22:38 arcanez batman: lucky you, nothing has changed except more vendors screwing up support
22:39 pink_mist bit_shifter: personally I tend to do it by not redirecting at all, but just render the login page instead of the one they asked for, and have that page post to the same url, which gets checked by the under again and passes
22:39 Grinnz bit_shifter: https://metacpan.org/pod/Mojolicious::Controller#redirect_to
22:39 pink_mist (or doesn't pass)
22:40 Grinnz and yeah we just render the login page
22:40 pink_mist (in which case, again, just render error + login)
22:40 sri pink_mist: how anti-REST of you
22:40 Grinnz the under route makes that pretty simple to do
22:41 pink_mist sri: oh yeah, this isn't a REST setup at all :P
22:41 Grinnz "login form" isn't a very REST thing to do anyway :P
22:41 sri well
22:42 sri ¯\_(ツ)_/¯
22:43 bit_shifter my $auth = $r->under('/' => sub {
22:43 bit_shifter my $c = shift;
22:43 bit_shifter return 1 if defined $c->session('userid');
22:43 bit_shifter $c->render(controller => 'main', action => 'login');
22:43 bit_shifter return undef;
22:43 bit_shifter });
22:44 bit_shifter That's what's happening currently.  Is that what you guys are referring to?
22:44 jberger bit_shifter: please don't paste code into the channel
22:44 bit_shifter Sorry
22:44 jberger please use a paste site
22:45 jberger no worries, everyone gets one :-P, in the future though it is much appreciated
22:45 bit_shifter http://sprunge.us/FEKa?pl
22:46 pink_mist bit_shifter: the under should also be checking credentials and setting the session userid if they check out as it'd be POSTed to the same route
22:47 sri bit_shifter: it's actually a topic in the growing guide http://mojolicious.org/perldoc/Mojolicious/Guides/Growing
22:47 marty joined #mojo
22:49 bit_shifter pink_mist: The main#login has that logic currently, which might explain why it's not working as I expect?
22:49 pink_mist it depends on where you're POSTing it to, which I suggested should be the original route
22:51 bit_shifter pink_mist: If I end up with dozens of pages "under" $auth, how do I manage POST routes for all of them?  Am I understanding you correctly?
22:51 pink_mist depends if you can get away with using ->any for them or not :P
22:53 Grinnz ->under effectively acts as an ->any, there is no restriction on the method of the routes underneath
22:55 sri this one doesn't look like a toy https://www.amazon.de/Gaming-keyboard-Razer-BlackWidow-Tournament/dp/B01CVOLFUG/
22:56 pink_mist ->any(['GET', 'POST'], ... should work in place of the regular ->get(...,
22:57 Grinnz we solve this by doing login via a javascript API call, rather than a POST to the page :P
22:57 Grinnz then the javascript just essentially reloads on success
22:57 pink_mist ah yeah, that's a good way too; I just need stuff to work even without js =)
22:58 * Grinnz has always felt weird about HTML POST
23:01 pink_mist in fact, considering going 'back' in the browser to that page might get annoyed with the POST, the js solution has some advantages
23:01 Grinnz right, that's one of the main things that annoys me
23:01 disputin joined #mojo
23:02 Grinnz javascript can certainly mess up the back button, but it can also make it work more sensibly if you do it right
23:02 pink_mist yeah
23:02 pink_mist I think I'll actually implement that on my site, only using the POST if JS is unavailable
23:03 pink_mist thanks for the idea Grinnz++
23:03 bit_shifter Thanks for the insight, everyone.  I'm going to have to play around with this some more to see what will work for me.  This whole thing is a lot to take in as someone who's not a web developer.
23:05 Grinnz pink_mist: the other main benefit of doing it by JS is that the session cookie is set immediately by the response to the JS, avoiding the need for an "intermediate" logging-in page that you used to see a lot
23:05 pink_mist Grinnz: yeah, but if you set it in the under before it's being checked, that doesn't happen anyway already :P
23:06 Grinnz it depends how you manage the session cookie
23:07 Grinnz i don't recall the exact issue, its been a while :P
23:07 pink_mist right =) I must have sidestepped that issue somewhen :)
23:08 zivester joined #mojo
23:24 arcanez huh, batman wrote Mojo::Redis2 as well.
23:25 pink_mist he's prolific =)
23:27 arcanez looks good to use for pubsub
23:28 sri hmm, this one is not too bad either http://www.corsair.com/en/corsair-gaming-k65-rgb-compact-mechanical-gaming-keyboard
23:28 sri finally cherry red switches
23:29 arcanez I find it hard to believe you don't already have a nice keyboard
23:29 sri i work mostly on a macbook at the moment
23:30 arcanez <3 my macbook pro, but I also like a mouse, keyboard and big screens
23:30 sri so i have tons of apple equipment
23:30 sri including a magic keyboard
23:31 sri but now i'm rebuilding my setup for linux
23:37 arcanez funny, he wrote a chat.pl for Mojo::Redis2 :P
23:38 Grinnz that example was basically just copied from Mojo::Pg to Mojo::Redis2 and Mojo::mysql and Mojo::SQLite :P
23:38 sri yea, it's nice to have one example translated for all backends
23:39 sri and a chat is pretty much the canonical real-time web example
23:39 disputin joined #mojo
23:41 arcanez does Mojo have something akin to POE::Wheel::FollowTail?
23:41 sri yea, i guess the corsair k65 rgb is exactly what i want :o
23:42 Grinnz arcanez: i only remember seeing a gist somewhere... probably from jberger
23:42 Grinnz i dont know if anyone's written a real Mojo equivalent to that and IO::Async::FileStream yet
23:43 Grinnz it definitely should be doable with Mojo::IOLoop::Stream
23:44 arcanez Mojo::IOLoop::Tail does exist
23:44 Grinnz oh yeah, bpmedley did release that
23:47 arcanez Mojo::IOLoop::Stream would probably be best for reading stdin
23:52 jberger sri: you can keep using your magic keyboard
23:52 jberger arcanez: i have an unreleased module on github
23:53 jberger https://github.com/jberger/Mojolicious-Plugin-TailLog
23:53 jberger It is specifically for tailing the log file of the application which has some oddities
23:54 jberger Abs it only works on platforms with tail -f as a result
23:54 jberger *and
23:55 jberger Which is why i never released it as it happens
23:55 pink_mist Mojo::IOLoop::Tail is insufficient?
23:57 sri jberger: stop being reasonable...
23:57 sri rebuilding my setup is fun!
23:57 jberger Hahaha
23:58 jberger pink_mist: well ...
23:58 jberger My biggest concern is that it uses seek a lot, which if the file is open elsewhere is an issue
23:58 jberger Since the seek pointer is global to a process
23:59 jberger This is the same problem i had with my module
23:59 jberger And why i had to use tail -f
23:59 pink_mist surely global per process -- per filehandle?
23:59 jberger New seek pointer
23:59 jberger Yes
23:59 jberger Well no
23:59 jberger Per file
23:59 pink_mist 0_o

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