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

IRC log for #mojo, 2015-07-02

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

All times shown according to UTC.

Time Nick Message
00:31 zivester joined #mojo
00:34 punter joined #mojo
00:35 davido_ joined #mojo
00:41 gtodd joined #mojo
01:23 mattastrophe joined #mojo
01:26 neilhwatson joined #mojo
01:40 jnbek joined #mojo
01:54 Grinnz you know i just realized something
01:54 Grinnz i might be able to push "reliable migrations" as another reason to switch to postgres
01:54 Grinnz not like it'll get anywhere, but hey
01:55 Grinnz i'm sure management would love to hear "zero downtime upgrades"
01:57 hshong joined #mojo
02:03 noganex_ joined #mojo
02:07 hshong joined #mojo
02:15 esh joined #mojo
03:02 bpmedley joined #mojo
03:10 good_news_everyon joined #mojo
03:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vtAhh
03:10 good_news_everyon mojo/master ac3ef4f Sebastian Riedel: we use $app in examples now
03:10 good_news_everyon left #mojo
03:11 * sri hopes this new minion example brings the point across https://github.com/kraih/minion/commit/1de619fc6f9ffaa5885c562e5d9c794008d9db55
03:12 mattastrophe joined #mojo
03:16 sri oooh, a new episode of mr robot \o/
03:19 dave__ really? I thought that wasn't till august?
03:35 Adura joined #mojo
03:49 kaare joined #mojo
03:50 jberger I do love the elegant simplicity of mojo plugins
04:42 bpmedley jberger: Would you consider Rex instead of ansible?
04:43 melo joined #mojo
05:06 dustinm joined #mojo
05:39 bpmedley CandyAngel: Did you get your stuff working the way you wanted?
05:57 bpmedley https://www.youtube.com/watch?v=WI25DmCoWvI <-- I will never lie
06:08 bpmedley joined #mojo
06:11 dod joined #mojo
06:13 dod1 joined #mojo
06:17 dod1 joined #mojo
06:59 AndrewIsh joined #mojo
07:00 punter joined #mojo
07:01 dotandimet joined #mojo
07:06 dotandimet joined #mojo
07:08 arpadszasz joined #mojo
07:09 eseyman joined #mojo
07:13 CandyAngel bpmedley: Yeah, I don't have any outstanding "wantMojoToDoThis" things
07:20 dave__ joined #mojo
07:26 dod joined #mojo
07:55 dp_ joined #mojo
08:04 dod joined #mojo
08:10 Vandal joined #mojo
08:12 _dave_ joined #mojo
08:32 Dandre joined #mojo
08:33 dod joined #mojo
08:56 jontaylor joined #mojo
08:57 bin_005 joined #mojo
09:00 amon joined #mojo
09:29 abracadaniel Hi everybody! when serving an attachment using $c->res->headers->content_disposition('attachment; filename='.$filename.';'); how can i specify the content of the file? it doesnt seem correct doing it with $c->render(text => $data);
09:32 bin_005 joined #mojo
09:36 CandyAngel abracadaniel: I'm pretty sure render(text=> does character escaping anyway, so it'd mangle it
09:37 CandyAngel Are you not using Mojolicious::Static for a reason?
09:38 abracadaniel im not using Mojolicious::Static
09:38 CandyAngel http://stackoverflow.com/questions/14618442/how-can-i-make-a-mojoliciouslite-static-file-downloader
09:38 abracadaniel i dont need to serve static content based of files, i need to serve files with dynamic content
09:39 CandyAngel Ahh
09:39 abracadaniel :P
09:39 abracadaniel i got the static files working
09:39 abracadaniel but im not sure what the best way to do serve dynamic content  is
09:40 CandyAngel Hmm
09:40 CandyAngel If I were to do it, I'd try putting the content into the stash, then have a simple template with
09:40 CandyAngel %== $content
09:41 CandyAngel No idea if that would even work, let alone be a decent way of doing it..
09:41 CandyAngel Or
09:41 CandyAngel http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Adding-a-handler-to-generate-binary-data
09:41 CandyAngel This sort of thing?
09:45 abracadaniel %== $data; works
09:45 abracadaniel thanks CandyAngel
09:48 CandyAngel ^_^
09:48 CandyAngel My pleasure, glad I could help
09:56 dotan1 joined #mojo
10:00 ashimema joined #mojo
10:13 trone joined #mojo
10:56 ToApolytoXaos joined #mojo
10:59 kaare joined #mojo
11:04 eitz joined #mojo
11:11 CandyAngel Feature request: $backend->list_jobs(grep => sub {..}); where the callback is passed $job->job_info and returns the job if callback returns true
11:12 neilhwatson joined #mojo
11:12 CandyAngel Example use case: Fetching jobs with multiple states (or negating)
11:13 CandyAngel my $nonfinished = $backend->list_jobs(grep => sub{ $_->{'state'} ne 'finished'; });
11:44 mattastrophe1 joined #mojo
11:55 PotatoGim^Home joined #mojo
12:05 absolut_todd joined #mojo
12:17 zypper joined #mojo
12:29 Mikey joined #mojo
12:39 jberger abracadaniel: render(data => $data) is easier than building a template for it
12:40 harry joined #mojo
12:42 jberger abracadaniel: even better would be these http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Serving-static-files
12:49 ajr_ joined #mojo
12:52 sri CandyAngel: that's incompatible with the postgres backend
12:53 CandyAngel sri: That's unfortunate
12:56 sri oh, we've reached 500 reverse dependencies on cpan \o/ https://metacpan.org/requires/distribution/Mojolicious?sort=[[2,1]]
12:58 CandyAngel Congratulations :D
12:59 eseyman Congrats !
12:59 Grinnz abracadaniel, like in the secton below what jberger linked, you can use the asset helper to serve dynamic content: $c->reply->asset($asset), see Mojo::Asset::Memory for how to build a dynamic asset from scalar data
13:01 Grinnz you can specify content type with $c->res->headers->content_type()
13:04 gryphon joined #mojo
13:14 zivester joined #mojo
13:23 CandyAngel sri: I'm coding this project without the whitespace and it looks cramped up :|
14:06 chenri joined #mojo
14:22 jberger bpmedley: I did try Rex, and while I like the idea of using Perl for everything, I kinda like that ansible is configuration only
14:22 jberger Rex felt very "roll it yourself"
14:22 jberger which is fine, TIMTOWTDI, except that I'm not an ops guy, so the less I have to know what I'm doing the better
14:24 jberger http://www.memecreator.org/static/images/memes/2725833.jpg
14:31 hahainternet quick slightly off topic question, we're opening temp files from a mojo app and we're a little concerned about race conditions, is there any simple file locking module i can show to my intern? :D
14:31 Grinnz_ flock
14:32 Grinnz_ it's used for Mojo::Log, at least... dunno where else
14:32 noganex joined #mojo
14:32 hahainternet Grinnz_: just the syscall or there's a module called that? thanks for the pointer
14:32 hahainternet hadn't thought of looking in Log
14:32 Grinnz_ hahainternet: it's from the Fcntl module
14:32 Grinnz_ https://metacpan.org/source/DBOOK/Mojolicious-6.12/lib/Mojo/Log.pm#L30
14:33 Grinnz_ (core module)
14:33 hahainternet yeah it's probably a straight syscall bridge
14:33 hahainternet was hoping there was a nice example i could give him, but that's fine
14:33 hahainternet cheers for your help
14:39 mst jberger: ansible is turing complete executable YAML
14:39 jberger sure, and that's useful, but for the most part its just YAML
14:39 mst right, but calling it 'just configuration' is roflcopter
14:39 jberger I also like the 'changed_when'
14:39 jberger very handy
14:40 mst right, we tend to recommend ansible for customers without a proper sysadmin to learn a real tool
14:40 jberger well that's me/us
14:45 * Grinnz_ still has no idea what ansible even is
14:50 jberger Grinnz_: deploy tool
14:50 Grinnz_ ah
14:50 jberger like Rex, Chef, Puppet etc etc
14:50 genio real time communications from Ender's Game, of course.
14:51 Grinnz_ yeah, i dont know much about any of those either :)
14:51 jberger Grinnz_: didn't you see me say: http://www.orangedonkey.net/wp-content/uploads/2012/04/I-Have-No-Idea-What-I-am-Doing-2.jpg
14:53 sri so much hype around ansible
14:54 sri at least in my twitter stream it looks like Chef and Puppet are already dead
14:54 btyler or 'in heavy use by stable companies', which is pretty much dead :)
14:54 eseyman
14:54 jberger btyler++
14:55 btyler (not that I'm drawing any kind of analogy there. nope)
14:55 Grinnz_ heh
14:58 sri even perl people are only talking about ansible
14:58 jberger I think I'd want to use Rex, but it just wasn't easy to understand
14:58 jberger docs were too sparse
14:58 genio This is the first I've heard anyone speak of it.  Most people I know are still all Puppet Puppet Puppet
14:58 mst I know a few people who've gone ansible to rex because the rex team are more responsive
14:59 jberger admittedly I have only done about a day in each
14:59 jberger but I got farther in my ansible day than in my rex day
15:00 jberger I really don't like to be in "I've got to just cobble shit together" mode, I hate it and it never works for me
15:00 jberger I want to get to deeply understand a tool
15:00 jberger but deadlines
15:00 purl I love the wooshing sound deadlines make as they fly by
15:00 Grinnz_ ^
15:00 jberger botsnack
15:00 purl :)
15:02 al joined #mojo
15:03 CandyAngel al: Why am I here?
15:04 jberger CandyAngel: you want philosophy or technical?
15:04 CandyAngel Ziggy usually gives the technical answer
15:04 jberger when a mommy and a daddy love each other very much ...
15:04 CandyAngel :P
15:05 CandyAngel Wait
15:05 CandyAngel I thought i was an only child!
15:05 CandyAngel Also, how do you be a mommy/daddy before you have children?
15:05 CandyAngel I see a bootstrapping problem
15:05 * jberger sets CandyAngel on fire
15:06 * jberger sets tianon on fire too, its been a while
15:06 CandyAngel D:
15:07 * sri hands out marshmallows
15:07 CandyAngel Not sure if I am being set on fire for pointing out a problem or for making a Quantum Leap reference
15:07 * jberger hands the europeans sno-cones, they deserve them
15:07 jberger CandyAngel: if you don't know that, then the answer is yes
15:08 CandyAngel Thanks for the insight into my current predicament
15:09 sri oh my, quantum leap... that's been a few decades :o
15:09 doby joined #mojo
15:09 CandyAngel I'm on season 4 :P
15:11 sivoais joined #mojo
15:11 CandyAngel Not sure if it was an 80s thing or not but the intro is approx. 3 years long
15:11 Grinnz_ yes, 80s shows had long intros
15:11 jberger I always appreciate when a show shortens its intro after the first few seasons
15:12 Grinnz_ around the 2000s is when they started having 2-10 second intros (i.e. LOST)
15:12 CandyAngel I think QL made it longer :|
15:12 jberger long intros weren't designed for the binge watch generation
15:12 CandyAngel Yeah, I know
15:12 mst right, QL put the entire premise into the intro in case you'd just flicked across channels
15:12 Grinnz_ it gets annoying when you watch 10 epsidoes on netflix in one day
15:12 mst also to give people a chance to settle down in the living room
15:12 CandyAngel And tune the telly? :P
15:13 sri lol
15:13 Grinnz_ i dont remember much from quantum leap, but i remember that it's scott bakula
15:13 Grinnz_ because he has a funny name and is in star trek enterprise
15:13 CandyAngel It is an interesting name, yeah
15:14 CandyAngel As soon as I saw it, I remembered it forever
15:14 CandyAngel But not Dean Stockwell
15:14 * jberger never watched enterprise, the only one I haven't seen an episode of
15:14 jberger did I miss anything?
15:14 sri it's already been 10 years since the last star trek show :(
15:14 jberger sri: I was 20 years since best of both worlds part 1
15:14 Grinnz_ sri: there is a new one planned
15:14 Grinnz_ i dont know if theyve released any details
15:14 jberger s/I/it/
15:15 jberger Michael Dorn has been pushing pretty hard for a Captain Worf show
15:15 Grinnz_ hmm worf would make a cool captain
15:16 sri jberger: i would watch enterprise, some of it is pretty good
15:16 coolo jberger: the first 2 seasons were great - they had an interesting plot. After that it went into a war with some green race and my interest faded out
15:17 Grinnz_ yeah some of enterprise is cool
15:17 Grinnz_ i only saw one eepisode but i intend to watch the rest of it
15:17 coolo the last 2 rows at the right are from Enterprise: http://gallery.kulow.org/index.php/Trexels/20130711-016 (selfmade artwork in my living room :)
15:18 coolo (ok, 1 1/2 - the first half is the first contact movie)
15:18 Grinnz_ nice
15:19 Grinnz_ hah, sherlock-data
15:20 sri haha, there's the lizard guy that kirk is fighting all the time
15:21 * tianon basks in the raging inferno
15:25 PryMar56 joined #mojo
15:40 Kogurr joined #mojo
15:56 disputin joined #mojo
16:03 mishanti1 I am trying to figure out if a mojo app will ever have headers->header('x-forwarded-for') undefined. Any of you guys know if it is always set, or if it might be empty?
16:04 mishanti1 So far I have been unable to provoke a scenario where it is not empty.
16:04 Grinnz_ mishanti1: that is only set by a server that proxies to the mojo app
16:04 Grinnz_ it would not be set if you connect to the mojo app directly
16:05 spicyjack Grinnz_: s/would/should/
16:05 spicyjack Grinnz_: if it is, Houston, you have a problem
16:05 Grinnz_ :)
16:05 mishanti1 Grinnz_: Oh ok. What kind of server would that be? I have been checking by running tests with Test::Mojo, running with hypnotoad and through morbo.
16:05 Grinnz_ Test::Mojo runs the server itself so it should not set it
16:06 Grinnz_ but if you're running hypnotoad/morbo behind a proxy, you'd have to connect to their port directly instead of the server that's proxying
16:06 mishanti1 With Test::Mojo I get the first ip of eth0
16:08 mishanti1 But ok, the take-away from this is that I _should_ be able to provoke a situation in which x-forwarded-for is not set. I'll dig further. :) Thanks for the input.
16:11 sri mishanti1: you might want to read up on what X-Forwarded-For is actually used for
16:12 jberger mishanti1: I use mojo behind a reverse proxy almost all the time, I never need to worry about X-Forwarded-For, mojo handles it all for me
16:16 jberger or put it another way, if you have to care about it, you're probably doing it wrong
16:31 Grinnz_ that too :)
16:33 tyldis joined #mojo
16:38 mudler joined #mojo
16:40 lluad joined #mojo
16:47 jberger joined #mojo
16:54 juikuen joined #mojo
16:56 sh4 joined #mojo
17:05 chenri left #mojo
17:22 cfedde The funny thing is that those who commit it think they are doing it for good reasons.
17:23 cfedde bah
17:23 * cfedde crawls back under his rock.
17:24 dod joined #mojo
17:25 Grinnz_ commit what? treason?
17:25 * jberger commits cfedde
17:25 * Grinnz_ pushes cfedde to origin
17:25 kaare joined #mojo
17:25 jberger actually, cfedde would also be a valid sha commit marker
17:26 Grinnz_ heh
17:26 sri /me rolls back cfedde
17:26 * sri rolls back that sentence
17:26 * jberger rolls back the channel
17:28 sh4 joined #mojo
17:30 sh4 joined #mojo
17:31 cfedde eval: 0xCFEDDE
17:32 berov joined #mojo
17:32 jberger 0xCFEDDE & 0xDEADBEEF
17:33 disputin joined #mojo
17:34 cfedde 0x8DACCE
17:34 jberger hahaha "|" is funnier
17:35 jberger 0xDEEFFFFF
17:37 cfedde perl -e 'printf("0x%X\n", 0xCFEDDE ^ 0x632300)'
17:37 cfedde 0xACCEDE
17:38 sh4 joined #mojo
17:43 cfedde one time pad trick for the win.
17:49 ajr_ joined #mojo
17:55 bin_005 joined #mojo
17:57 Kogurr joined #mojo
18:00 jberger joined #mojo
18:21 dotandimet joined #mojo
18:27 amon joined #mojo
18:37 dod joined #mojo
19:06 dotandimet joined #mojo
19:19 genio mst: https://www.youtube.com/watch?v=HxSLbpAwibg  your cure for the heat wave
19:29 sri but it's too hot to build stuff!
19:29 * sri keeps melting
19:30 genio haha
19:31 jberger sri: did my sno-cone make it there? maybe it melted en-route
19:34 noganex_ joined #mojo
19:48 dotandimet joined #mojo
20:34 Snelius joined #mojo
20:34 bin_005 joined #mojo
20:35 disputin joined #mojo
20:36 mattastrophe joined #mojo
20:54 tempire enterprise was the worst
20:54 * tempire throws the gauntlet
21:00 ToApolytoXaos joined #mojo
21:06 Snelius joined #mojo
21:08 mishanti1 jberger: wrt xff; the question was related to logging calls to the webapp in an env where there may or may not be zero or more proxies. And there is a need to log which "route" a request took coming in.
21:09 jberger ah, logging your proxies makes a bit more sense
21:10 mishanti1 :)
21:10 mishanti1 But yeah, figured out why I was seeing the strangeness earlier. Guess what? PEBKAC :p
21:10 disputin joined #mojo
21:59 ToApolytoXaos joined #mojo
22:23 punter joined #mojo
22:47 disputin joined #mojo
23:23 bpmedley jberger: I understand the need to mind-meld with the tool being used.  Does ansible have quite a few pre-built recipes?
23:33 jb360 joined #mojo
23:53 bpmedley I'm naming three random things I like about Mojolicious: a) Documentation; b) Minion command line use; c) under.  Thanks for the project.

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