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

IRC log for #mojo, 2014-04-11

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

All times shown according to UTC.

Time Nick Message
00:03 asarch joined #mojo
00:26 cpan_mojo Mojolicious-Plugin-Piwik 0.13 by Nils Diewald - http://metacpan.org/release/AKRON/Mojolicious-Plugin-Piwik-0.13
00:37 shmuel joined #mojo
00:41 shmuel I still need help with encodings... anyone?
00:44 jberger mojo handles just about all of the web facing encoding for you
00:44 firnsy shmuel: have you read https://github.com/kraih/mojo/wiki/Utf-8-manipulation?
00:45 jberger so just remember to decode at the other boundaries of your app and all will be fine :-P
00:45 shmuel well, it is data that comes from the DB
00:46 shmuel wait, I'll try to put some unicode in the template itself..
00:47 shmuel hmmm... unicode in the template works ok.
00:47 jberger be sure to tell your db about the encoding
00:47 jberger most drivers will do the right thing if you do
00:48 shmuel the thing is, when I print to STDERR, I see the japanese.
00:48 jberger never trust the shell when doing encodings
00:48 shmuel true that...
00:49 shmuel I'll experiment more with the DB.
00:50 firnsy shmuel: i was having encoding issues caused by the default language and collation of the db being in latin1
00:50 jberger Best is to write some tests which go through the db and prove that new data can correctly make the round trip
00:50 firnsy jberger++
00:50 firnsy tests FTW!!
00:50 jberger TEST ALL THE THINGS!!!
00:51 shmuel :-)
00:51 jberger I see that there will be lots of crab at mojoconf :-P
00:54 jberger seriously though, there is almost no visual way to ensure that encoding is correct
00:55 jberger every step along that path can lie to you
00:55 shmuel Encode::is_utf8 reports that the string is indeed not encoded.
00:56 jberger as I discovered with Galileo, talking sri's ear off along the way
00:56 sri do the snowman test
00:56 sri input \x{2603} and make sure it comes out again
00:57 sri coincidentally Mojo::Util::dumper now escapes all special characters
01:03 laouji joined #mojo
01:07 hotsnow joined #mojo
01:20 klapperl_ joined #mojo
01:34 punter joined #mojo
01:38 laouji joined #mojo
01:46 punter Could someone please make a Minion-based Cron replacement?
01:57 laouji joined #mojo
02:05 d4rkie_ joined #mojo
02:24 d4rkie joined #mojo
02:37 russum joined #mojo
02:54 hesco joined #mojo
03:42 d4rkie joined #mojo
04:24 davido___ joined #mojo
04:35 dj_goku so I am trying to setup a mojo lite GET route like this /customer/:id but I want to return JSON, $self->respond_to() with json isn't returning.
04:37 crab you must be doign something wrong
04:38 dj_goku well one way to "fix it" is do this $self->render(json => data)
04:40 shmuel does the call ends with .json?
04:40 shmuel i.e. /customer/5.json ?
04:43 dj_goku hmm
04:43 dj_goku nope
04:43 dj_goku weird.
04:43 dj_goku so anything that returns json needs to have json...
04:43 dj_goku ok
04:44 shmuel or you can tell mojo to return json
04:44 dj_goku with render?
04:44 shmuel just stash format => json
04:45 dj_goku hmm
04:46 shmuel but it is better just make the url end with .json
04:46 shmuel make the request explicit.
04:50 dj_goku yeah
04:51 dj_goku makes sense both ways
04:51 dj_goku /customers/5.json means the customer # 5
04:51 dj_goku data
04:54 cpan_mojo Mojolicious-Plugin-Nour 0.05 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-Nour-0.05
05:00 cpan_mojo Mojolicious-Plugin-Nour 0.06 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-Nour-0.06
05:01 dj_goku shmuel: thanks.
05:01 shmuel :-)
05:05 dj_goku still trying to figure out have to make a RESTful like API.
05:11 laouji joined #mojo
05:14 laouji_ joined #mojo
05:36 russum left #mojo
05:36 russum joined #mojo
05:38 russum left #mojo
05:38 russum joined #mojo
05:38 Eke- joined #mojo
05:43 russum left #mojo
05:43 russum joined #mojo
06:01 sujithm joined #mojo
06:05 val40 joined #mojo
06:09 val40 joined #mojo
06:42 cmihai Hi. Is it possible to render the running script (lite app) with PODRenderer?
06:48 cmihai Hm.. I suppose I could set PERL5LIB to include .
06:49 cmihai Yep, that did it, hah! Mojo <3
06:49 cmihai Self document code and APIs, mwhahahaha.
06:50 cmihai Mojo is pure awesome.
06:51 Vandal joined #mojo
06:52 rem_lex|pivo joined #mojo
06:55 dod joined #mojo
06:58 eseyman joined #mojo
06:58 laouji joined #mojo
07:00 sujithm_ joined #mojo
07:05 rawler joined #mojo
07:11 cmihai joined #mojo
07:22 crab cmihai: :-)
07:28 denis_boyun joined #mojo
07:32 trone joined #mojo
07:38 basiliscos joined #mojo
07:52 cmihai joined #mojo
08:05 dwierenga joined #mojo
08:18 fhelmber_ joined #mojo
08:31 sujithm joined #mojo
08:36 oliver1 joined #mojo
08:38 laouji joined #mojo
08:42 oliver1 Hi! I have a question regarding a route condition / route cache. I'm using Mojolicious::Plugin::AccessControl to restrict my app to a certain IP range. That condition plugin arguments contain an anonymous sub reference to code that is executed when access is denied. The sub reference is available to the condition plugin upon first executing the route, but on the second request, it is missing from arguments in what I assume originates from the ro
08:46 oliver1 I've created a minimal example here: https://gist.github.com/oliverguenther/10450816
08:46 oliver1 The first execution of this app gives me the expected 'Forbidden' output, the second a route not found.
08:47 Sontan joined #mojo
08:47 oliver1 [mojo version 4.92, AccessControl from cpan / 0.03]
08:50 oliver1 Looking into the AccessControl plugin, the essential issue is at the given arguments of the condition (after line 18 of https://github.com/hayajo/Mojolicious-Plugin-AccessControl/blob/master/lib/Mojolicious/Plugin/AccessControl.pm). On first execute, $args is   [ {'on_deny' => sub { "DUMMY" } }, 'deny', 'all' ]; Upon reloading the request, 'on_deny' is missing.
08:50 marty_ joined #mojo
08:51 malikai i don't know much about the accesscontrol plugin, but it seems counter-intuitive to do IP filtering in your application
08:51 malikai hosts.(allow|deny) died in the early 90s
08:52 malikai it died then for a reason :)
08:58 oliver1 What other options do I have for restricting a route to our /16 ? Apart from mounting the route as another application, perhaps
09:01 malikai that's a tough question..
09:01 * crab looks suspiciously at this access control plugin
09:02 malikai i take it you can't firewall because you have legitimate clients in that /16
09:02 malikai ?
09:04 crab oliver: you can always use a bridge, but i see no reason why a condition should not work
09:04 crab so whatever's going wrong, it's in that plugin i would think
09:14 rawler does anyone know anything similar to this; http://search.cpan.org/~miyagawa/LWP-Protocol-PSGI-0.06/lib/LWP/Protocol/PSGI.pm for Mojo::UserAgent?
09:14 Lee joined #mojo
09:15 rawler I'm hacking on a two-split backend/frontend application with a Rest-API in between, both built in Mojolicious.. for Frontend testing, it would be immensely useful to be able to load the Backend and hook it up to the Frontend, in-process without having to deal with port-state and similar.. any ideas?
09:21 rawler oh, reading Test::Mojo, it seems I should simply be able to set $user_agent->server->app to an instance of my app and be done with it?
09:26 oliver1 crab: A bridge would have been my first choice, but then I've found that plugin. And on the first execution, it works fine ;-)
09:26 crab ok, so all you have to do is only ever make one request to your app. problem solved.
09:28 crab rawler: you don't even need to do that, just Test::Mojo->new("AppName")
09:30 laouji joined #mojo
09:31 laouji joined #mojo
09:33 laouji joined #mojo
09:36 Guest-quest joined #mojo
09:37 sujithm_ joined #mojo
09:40 Guest-quest hello, i have script that detach from tty, but within mojolicious controller the system('this_script') still wait the return
09:42 Guest-quest I tried hohup also
09:43 Guest-quest *nohup
09:44 Guest-quest I tied fork == 0 && exec 'this_script' also
09:45 * nic is introduced to PERL5OPT='-MCarp=verbose' and gives it a big hug
09:45 Guest-quest how to run and no wait external program?
09:48 nic Guest-quest: https://metacpan.org/pod/Mojo::IOLoop::ForkCall
09:48 Guest-quest nic: nice
09:52 laouji joined #mojo
09:57 oliver1 crab: Of course it was the plugin: it shifts from the condition array ref. It of course shifts the next call from the same ref. I wonder whether that ever worked correctly or the author only checked the plugin once
09:58 laouji joined #mojo
10:03 laouji joined #mojo
10:10 Sontan joined #mojo
10:11 laouji joined #mojo
10:13 denis_boyun joined #mojo
10:14 batman anyone with ideas on how to solve this: https://github.com/marcusramberg/mojo-redis/issues/24 ?
10:15 batman solve = which solution would be most intuitive
10:15 batman i often forget that blpop blocks other commands...
10:39 sujithm joined #mojo
10:53 Eke|| joined #mojo
10:55 amirite joined #mojo
11:04 cmihai joined #mojo
11:04 diegok batman: I like your idea of an API where you subscribe to blpop... I guess internally it should create a new connection.
11:05 batman yeah, it has to for that to work.
11:05 batman thanks for the support. i'm working on that now :)
11:09 cmihai_ joined #mojo
11:20 Adurah https://github.com/Lekensteyn/pacemaker Interesting.
11:20 Adurah Reverse Heartbleed.
11:21 punter joined #mojo
11:24 malikai heh
11:25 Adurah It's likely Net::SSLeay's fault, but Mojo suffers because of it.
11:27 amirite what's the shortcut to the 'to' parameters in ? $r->get( '/foo/bar' )->to( controller => 'FooBarBaz' => action => 'bozfaz' );
11:27 amirite what's the shortcut to the 'to' parameters in ? $r->get( '/foo/bar' )->to( controller => 'FooBarBaz::Boo::Boo::Bobo' => action => 'bozfaz' );
11:27 amirite i.e. camel case and nested namespace
11:27 amirite it's not example#welcome
11:29 malikai i'm wondering how long until ssl-slammers start showing up in the wild
11:29 amirite what's an ssl-slammer
11:29 malikai 2003 all over again..
11:30 malikai see: SQL slammer
11:30 mire joined #mojo
11:30 amirite it's only a matter of days before we hear about catastrophic leaks of private information and banking/credit card data to organized cyber-crime
11:30 amirite on account of companies like target with poorly managed IT
11:31 malikai heh.. don't forget - various .govs have had and likely been exploiting this vulnerability themselves
11:31 malikai cybercrime isn't just for criminals.. unless you place .gov where they belong..
11:32 amirite yeah of course, but the difference is govs do it to spy, hackers in russia working for the mob do it to steal from you
11:32 malikai what makes you think the government doesn't steal from you? :)
11:32 amirite and americans don't care if they're spied on, they like to "wage war" on the rest of the world -- they only care if it affects them
11:37 cmihai joined #mojo
11:41 neilhwatson joined #mojo
11:47 oliver1 left #mojo
11:52 aleksey joined #mojo
11:53 batman marcus and diegok: https://github.com/marcusramberg/mojo-redis/pull/25
11:56 diegok batman++
11:57 batman hm... i'm not sure if ++ is the right response :(
11:57 diegok makes sente to have that unsubscribe semantics while there is no way to subscribe more than once
11:57 batman i'm really not sure about the on() and unsubscribe() behavior
11:57 diegok but it should be nice to subscribe more times to the same "queue"
11:58 batman why? what if i extend this to also do $redis->on(message => "pub:sub:channel", sub { });
11:58 batman exactly.
11:58 batman then my api doesn't work
11:58 batman it won't even work if i extend it with $cb
11:58 * batman will fix it
11:58 diegok shure, that was exactly what I was thinking on :)
11:58 batman s/shure/sure/
11:58 diegok thanks :)
11:59 batman shure++ # awesome headphones
11:59 diegok yup!
12:02 d4rkie joined #mojo
12:08 malikai wait, you can subscribe to lists w/redis?
12:08 malikai wtf?!
12:09 * malikai tries to imagine the possibilities
12:10 batman malikai :)
12:11 malikai time to revisit redis docs :)
12:13 malikai is there some ambiguity w/r/t blocking with what you're doing there?
12:13 malikai or do you just send an unsubscribe and then be done with it?
12:14 malikai don't you need to clean up the socket?
12:14 batman are you asking about how BLPOP is working, or what i'm trying to do?
12:14 malikai what part of it you're implementing
12:15 batman i'm implementing recurring BLPOP
12:15 batman and BRPOP
12:15 batman blocking left/right pop = emit an event when something is pushed to the list
12:21 malikai i don't know it looks fine with me.. but seems like the callback must be required for that anyway, no?
12:21 batman pretty useless to do BLPOP without a receiving callback, but the next commit will allow it...
12:21 batman no, sorry. it won't
12:22 batman pretty useless to do BLPOP without a receiving callback <--
12:22 batman :)
12:22 malikai no callback, no event :)
12:22 batman right
12:23 punter I need a Cron system for my site, but I don't want the same task to run more than once concurrently, if the previous run hasn't finished yet. Do you have something to suggest for me?
12:23 punter I guess I should ask #perl-help
12:25 malikai heh.. that blocking lpop could probably do some pretty cool stuff
12:26 malikai that's a market data day there for a small market at least
12:26 malikai or a data day for a whole bunch of other soon-to-be realtime applications
12:27 malikai (network monitoring)
12:30 eugen joined #mojo
12:31 cpan_mojo Mojolicious-Plugin-Nour 0.07 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-Nour-0.07
12:37 batman malikai, marcus, diegok: "Can now subscribe to blpop/brpop as many times as you like"
12:59 malikai i'm not sure why i ever would subscribe more than once..
13:00 malikai wouldn't that mean fetching everything all over again?
13:01 sujithm joined #mojo
13:01 amirite should i use JSON::XS or Mojo::JSON
13:01 amirite json xs would be faster right
13:08 batman malikai: it means exactly the same as on(finish => ..) or what you would do with any other event
13:08 batman you're not doing LPUSH once more, you're just getting the LPUSH response in more callbacks
13:09 batman how many times you actually do that is up to you
13:10 batman https://github.com/marcusramberg/mojo-redis/pull/26 # $redis->on(message => @channels => sub { ... }); :)
13:11 malikai yea i think i see what you're saying
13:11 batman marcus: i really want the Mojo::Redis changes /now/ :)
13:14 cmihai joined #mojo
13:14 malikai i always try to keep subscribers as subscribers and send messages to a list.. arbitrary numbers of callbacks scares me
13:14 batman what do you mean about "send messages to a list" ?
13:15 batman subscribers are already a list.
13:15 malikai i don't let them make callbacks :)
13:15 malikai i let them join arrays
13:15 batman sounds awful :(
13:16 batman but whatever helps you float the boat
13:16 malikai lol
13:17 malikai i just couldn't see the use that i couldn't manage that way.. on the admin side callbacks are necessary, but they don't get streams too much..
13:20 malikai also, edge servers should never touch a database or file, so there's rarely a need for a callback..
13:22 batman that doesn't make any sense to me
13:35 malikai maybe we're both thinking about different things or i just suck at explaining things :)
13:35 cmihai joined #mojo
13:35 batman probably one of them :)
13:35 malikai i normally do suck at explaining things
13:36 malikai hence why they keep me in chains in the cages with the rest of the animals
13:37 batman haha. i've escaped the chains! :)
13:37 malikai i've found a place where the chains are forever..
13:38 malikai that place is worse than vendor perl..
13:39 batman sounds like where i work. protip: trick people into believing you're still in chains, while you're actually crafting a masterplan.
13:40 batman that's how i survive.
13:44 malikai lol.. yea.. same here
13:45 malikai i have found access to the power house, of sorts :)
13:45 dotandimet joined #mojo
13:52 bluescreen joined #mojo
13:54 sh4 joined #mojo
13:55 mire joined #mojo
13:59 btyler joined #mojo
14:19 gryphon joined #mojo
14:35 Akron joined #mojo
14:35 cpan_mojo Mojo-Redis 0.9923 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Redis-0.9923
14:35 batman marcus: thanks for the review :)
14:39 cpan_mojo Mojolicious-Plugin-Args 0.01 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-Args-0.01
14:45 ladnaV joined #mojo
14:48 cmihai joined #mojo
14:51 meshl joined #mojo
14:54 odc joined #mojo
15:00 marty joined #mojo
15:02 cpan_mojo Mojolicious-Plugin-PDFRenderer 0.01 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-PDFRenderer-0.01
15:39 hesco joined #mojo
15:44 cmihai joined #mojo
15:58 gryphon joined #mojo
16:00 beyondcreed joined #mojo
16:20 cpan_mojo Mojolicious-Plugin-PDFRenderer 0.03 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-PDFRenderer-0.03
16:28 denis_boyun joined #mojo
16:31 mire joined #mojo
16:34 cpan_mojo Mojolicious-Plugin-PDFRenderer 0.04 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-PDFRenderer-0.04
16:35 amirite today is crazy plugins day
16:36 cpan_mojo Mojolicious-Plugin-DumpyLog 0.01 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-DumpyLog-0.01
16:46 sujithm joined #mojo
16:54 asarch joined #mojo
17:04 asarch Task::Mojolicious?
17:27 hesco joined #mojo
17:39 cpan_mojo Mojo-Redis 0.9924 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Redis-0.9924
17:42 denis_boyun_ joined #mojo
18:04 hummeleBop joined #mojo
18:11 cmihai joined #mojo
18:12 klapperl joined #mojo
18:20 punter joined #mojo
18:27 disputin joined #mojo
18:33 disputin joined #mojo
18:42 dod joined #mojo
18:42 meshl I need to switch to a faster, more responsive webserver (using Shared Hosting plan right now). Will go for some kind of VPS. Any suggestion?
18:42 meshl Should I go for Cloud VPS?
18:43 genio AWS is always a good option.  Check out the pricing and see if it's right for you.
18:43 meshl So many options... Rackspace, Dreamhost, AWS... I am lost
18:43 genio linode also comes to mind
18:43 doby linode or digitalocean are excellent
18:44 genio I've had less than stellar experience with Rackspace.  No experience with Dreamhost though
18:45 meshl So you're all saying Cloud VPS rules nowadays... What about something like MochaHost (http://www.mochahost.com/vps.php) <- are such plans totally obsolete now?
18:45 bluescreen_ joined #mojo
18:45 mire joined #mojo
19:02 neilhwatson AWS, no ipv6, thumbs down for me.
19:05 genio https://aws.amazon.com/about-aws/whats-new/2011/05/24/elb-ipv6-zoneapex-securitygroups/
19:07 dod joined #mojo
19:08 neilhwatson Very limited. You can't get any other aws hosts with ipv6.
19:12 genio Is there a reason you'd need IPv6 past the ELB?  I can't think of a need for an EC2 instance to need IPv6 (we don't make any instances directly available to the world)
19:20 moritz genio: here in Germany, some ISPs don't give you a proper IPv4 address anymore, but do that freaky DSLite IPv4 carrier-level tunneling for accessing IPv4 addresses
19:20 gryphon joined #mojo
19:20 moritz genio: in such a case, direct IPv6 address is certainly preferable
19:25 cstamas joined #mojo
19:25 genio moritz: I haven't tried this myself, but wouldn't you just point your IPv6 to the load balancer.  Load balancer talks to the EC2 instances over v4.  foo.com IPv6 -> AWS Elastic Load Balancer -> bunch of ec2 instances on ipv4 to serve out your apps behind the scenes through the load balancer
19:27 moritz genio: not if you want to log into to individual instances from within such a network
19:27 moritz like, you're an ops team, and some of the folks work from home
19:28 neilhwatson NAT like, which is something we all want to see the back end of.
19:28 moritz aye, s/tunneling/NAT/ would have been more correct
19:29 moritz also, my hoster doesn't account IPv6 traffic yet, so it's cheaper for me to use IPv6 from some of my servers :-)
19:30 moritz I have other reasons to use IPv6; for example at $work port 25 is blocked for outgoing connections, but only via IPv4
19:53 amirite guys check out this plugin i made today
19:53 amirite 11:33 <+cpan_mojo> Mojolicious-Plugin-PDFRenderer 0.04 by AMIRITE - http://metacpan.org/release/AMIRITE/Mojolicious-Plugin-PDFRenderer-0.04
19:53 amirite you have a route, /foo/bar/baz and it's pretty and fancy
19:53 amirite you go to /foo/bar/baz.pdf and it becomes a pdf
19:53 amirite rendered with webkit
19:53 amirite omg
19:56 sri too bad you can't actually use it
19:56 amirite yeah too bad for you
19:56 amirite works perfect for me
19:56 sri instant DoS attack
19:56 amirite it's for internal shit nigga
19:57 amirite imagine a company who wants to automate print production for newspapers
19:57 amirite thats why i'm doing it btw
19:57 amirite was kicked by sri: that kind of language is unacceptable
20:01 sri i knew i remembered him being banned before... http://irclog.perlgeek.de/mojo/2012-08-30#i_5945265
20:04 marty i think his name says it all
20:04 marty ^humble
20:05 marty oppps !humble
20:07 sri reminds me that i've seen a code of conduct for this irc network somewhere if i remember correctly
20:09 sri http://www.irc.perl.org/rules.html
20:10 sri purl: code of conduct?
20:10 purl well, code of conduct is more than just inappropriate and unwelcome sexual conduct.
20:11 sri purl: code of conduct is also http://www.irc.perl.org/rules.html
20:11 purl okay, sri.
20:25 jberger_ joined #mojo
20:26 jberger_ " We have never received any requests for user information and would probably wet ourselves laughing if we did."
20:26 jberger_ :-)
20:26 jberger_ That is all
20:26 sri a wild jberger appears
20:28 jberger_ joined #mojo
20:28 * jberger_ throws a water balloon at sri, and escapes!
20:28 sri :O
20:41 Adurah Looks like the overzealous plugin guy stopped.
21:23 klapperl_ joined #mojo
21:28 denis_boyun joined #mojo
21:36 meshl joined #mojo
22:22 dotandimet joined #mojo
22:34 d4rkie joined #mojo
22:40 neilhwatson joined #mojo

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