00:43:14  <rphillips>kostco: https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/blob/refactor/hostinfo2/hostinfo/iptables.lua
00:43:36  <rphillips>so I made the HostInfo object sublcass from a Transform Stream
00:44:27  <rphillips>it's on the refactor/hostinfo2 branch
00:44:48  <rphillips>you should be able to take the autoupgrades module and use an inline _transform now
01:00:26  <kostco>+1 for inline transform
01:02:11  <kostco>rphillips: ill let you hammer out on the refactor branch for now, since im really just slowing you down atm.
01:02:11  <kostco>take a look at passwd.lua, the asyncspawn func in misc imo is a waste since its not used in a lot of places so im curious how youll do that
01:02:51  <kostco>another thing is that its be awesome if a any of the checks could, even the ones not relying on hostinfosubproc could declare a Info:restrictedplatforms
01:03:01  <rphillips>hahaha. you wanted the _transform function within the class... now you get to try it out
01:03:09  <kostco>and not worry about the whole los.type() ~= linux
01:03:16  <kostco>man i love it! i need to type less code!
01:03:47  <kostco>so what i did here https://gist.github.com/kaustavha/7ff3f649ed5a90968b2b#file-base-lua-L49-L58
01:03:52  <kostco>i think thats a good idea
01:04:03  <kostco>but im unsure how to make that work everywhere
01:04:20  <rphillips>getPlatform() is the new function
01:04:25  <rphillips>and it's a whitelist
01:04:35  <rphillips>'linux', 'darwin', 'freebsd', win32'
01:05:13  <kostco>goddamit man did you rebase
01:05:17  <kostco>why would you rebase
01:05:20  <rphillips>yep
01:05:27  <rphillips>to squash all the commits
01:05:34  <kostco>sigh alright ill go through 18 files not seperated by commits
01:06:29  <kostco>rphillips: have you tried refactoring any of the fs using checks yet?
01:06:40  <rphillips>fs using checks?
01:07:36  <kostco>have you seen my gist? i was using it to figure out what to work on
01:07:49  <kostco>https://gist.github.com/kaustavha/f8a43d219377d78a19c6
01:09:29  <rphillips>i havne't seen that gist in a while, but I don't understand the 'have you tried refactoring any of the fs using checks yet'
01:09:53  <kostco>what i mean is the checks that rely on fs, i think its group three in that girst
01:10:10  <kostco>rphillips: convert passwd.lua that uses fs and requires a whole bunch of spawned proccess running "passwd -S <uname>' after running fs.read
01:10:37  <kostco>and fileperms
01:10:43  <kostco>im curious how itll look after
01:11:05  <kostco>itll be easier for me to work off your example than trying to figure out how to make it look like what youd make it look like
01:11:08  <rphillips>https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/blob/refactor/hostinfo2/hostinfo/pam.lua
01:21:08  <kostco>anyhoo im gonna get back to ipa day here at rssf, pam looks good although having to declare readstreams is a small nit, theres a few other checks that require fs utils so need to figure out how to abstract that and id definitely replace the los.type check thingy with the self:isRestrictedPlatform from my gist or whatever name makes sense tomorrow with your
01:21:08  <kostco>self:getPlatform()
02:36:26  * rphillipsquit (Quit: ZNC - http://znc.in)
02:40:51  * rphillipsjoined
02:56:12  * hdms_joined
02:57:51  * hdmsquit (Ping timeout: 260 seconds)
02:57:52  * hdms_changed nick to hdms
03:10:23  * rphillipsquit (Quit: ZNC - http://znc.in)
03:10:37  * rphillipsjoined
03:25:15  * hdmsquit (Quit: hdms)
03:27:28  * dan336joined
03:50:56  * hdmsjoined
04:14:47  * rphillipsquit (Quit: ZNC - http://znc.in)
04:15:06  * rphillipsjoined
04:16:01  * dan336quit (Quit: Leaving.)
05:08:02  * SkyRocknRolljoined
06:50:34  * hdmsquit (Quit: hdms)
08:41:18  * yperezjoined
08:41:34  * yperezchanged nick to yagop
08:44:01  <yagop>Hi, I recently discovered Luvit and fucking love it. Thanks a lot for the work!
09:00:32  * jreekjoined
09:04:19  <jreek>Hello. Luvit behaviour differs from Lua: http://pastebin.com/1wbU0bH1
09:04:46  <jreek>Is it a bug? How can I create global variable using Luvit?
09:13:35  * SkyRocknRollquit (Ping timeout: 244 seconds)
09:13:36  * yagopquit (Remote host closed the connection)
09:21:43  * jreekquit (Ping timeout: 246 seconds)
10:35:19  * SkyRocknRolljoined
10:45:04  * torquequit (*.net *.split)
10:49:09  * torquejoined
11:12:02  * SkyRocknRollquit (Ping timeout: 246 seconds)
11:17:03  * jreekjoined
11:24:02  * jreekquit (Quit: Page closed)
12:02:16  * hdmsjoined
14:12:23  <rphillips>good morning
14:26:29  * dan336joined
14:26:49  <creationix>rphillips: did you see jreek’s question? I didn’t realize we block global leakage
14:27:02  <creationix>I guess that’s a side effect of using setfenv in the require system
14:27:03  <rphillips>saw that
14:27:12  <rphillips> I think _G works though
14:27:20  <creationix>yep,
14:59:08  <coderkevin>creationix: Thanks for the info. I heard before that Luvit can work on the normal Lua interpreter without LuaJIT. Is that true?
14:59:27  <creationix>coderkevin: at some level
14:59:38  <creationix>the low-level luv binding is fully supported with normal lua
14:59:51  <creationix>luvi still has some work left to make portable and luvit depends on luvi
15:00:00  <coderkevin>creationix: I was wondering if it might be easier to bootstrap without LuaJIT first, then implement LuaJIT after it's up and running.
15:00:20  <creationix>coderkevin: for a new hardware platform right?
15:00:28  <coderkevin>creationix: It's for an ARM-based QNX platform.
15:00:48  <creationix>right https://github.com/luvit/luvi/issues/109
15:01:59  <coderkevin>We've already got Lua 5.2 running on this platform, I'm just trying to figure out the quickest way to get Luvit up and running to get our other devs going on top of it.
15:02:44  <coderkevin>LuaJIT is based on 5.2 still, right?
15:02:51  <creationix>coderkevin: 5.2ish
15:03:01  <creationix>it’s 5.1 with backwards compatible 5.2 features
15:03:47  <coderkevin>I see. I'll have to check what 5.2 features we're using, but it sounds like a move to LuaJIT for our existing code could be easier than a move to 5.3 even.
15:03:53  <creationix>coderkevin: so by “luvit” you mean the whole system including lit, luvi based apps with bundled zips and the luvit standard library?
15:04:24  <coderkevin>Well, I'm not 100% sure I need lit. This is an embedded system, so I'm not sure that I really need a package manager.
15:04:29  <creationix>if you don’t care about the luvit ecosystem, using luv directly is very easy
15:04:48  <creationix>and most luvit libraries can be ported to work directly on luv easily
15:04:58  <coderkevin>Right. I figured on libuv/luv first. I've looked into libuv enough to become familiar with what will have to be done there.
15:05:07  <creationix>does you system have libuv working yet?
15:05:24  <coderkevin>That's not on QNX yet. So I'll have to port it first, I figure.
15:05:43  <coderkevin>Should be fairly straightforward from Linux, except QNX doesn't have epoll or eventfds.
15:05:56  <creationix>I see
15:06:11  <coderkevin>But that part I'm comfortable with.
15:06:16  <creationix>so lua + libuv (via luv) is a pretty nice and very simple platform
15:06:30  <creationix>it’s not “luvit” per se, but has the core primitives
15:06:33  <coderkevin>Hmm, I wonder if maybe that's the way I should go instead of full-blown Luvit.
15:06:45  <coderkevin>Primarily what we need is the lua-based libuv event loop.
15:06:51  <creationix>and like I said, most the luvit libraries can be ported fairly easily
15:07:06  <coderkevin>We want to be single-threaded on the event loop with the ability to put in async events from other threads.
15:07:14  <creationix>luvi adds bundles (zip or folder) for asset bundling
15:07:14  <coderkevin>Secondary to that is D-Bus and http support.
15:07:19  <creationix>and lit adds package management
15:07:39  <coderkevin>We're already using l2dbus for other things, what would you recommend for http in a luv setup?
15:08:00  <creationix>my http-codec library in luvit will work almost out of the box on plain lua = luv
15:08:14  <coderkevin>Does it to TLS too?
15:08:25  <creationix>no, we use openssl for that
15:08:39  <coderkevin>We may want to use TLS at some point for our http requests.
15:08:48  <creationix>do you prefer coroutine or callback style code?
15:09:25  <coderkevin>I think we're trying to stay on the main event loop as much as possible, so async/callback would probably be best.
15:09:53  <coderkevin>But coroutines for situations where that's not feasible would be fine, I think.
15:11:37  <coderkevin>Communicating back to the main thread from a coroutine would be done through a uv_async event, right?
15:11:49  <coderkevin>Or would you do it some other way?
15:12:30  <coderkevin>Sorry, I haven't done much with coroutines in Lua, so my understanding isn't very clear.
15:12:42  <creationix>coroutines are on main thread
15:12:43  <creationix>they are green threads
15:12:47  <creationix>but they let you do blocking I/O without actually blocking the thread
15:13:13  <creationix>result = someAction(arg1, arg2) vs someAction(arg1, arg2, function (err, result) end )
15:13:35  <creationix>libuv is always callbacks, but using lua coroutines I’ve made it look blocking
15:14:02  <coderkevin>I see.
15:14:13  <coderkevin>How do you communicate between the threads?
15:14:20  <creationix>I don’t have threads
15:14:29  <coderkevin>Or well, between coroutines.
15:14:34  <creationix>they all share the same context
15:14:41  <creationix>so via closures the same as callbacks
15:15:09  <coderkevin>passing values through yield?
15:15:10  <creationix>I can write up an example and port a few of my libraries if you’d like
15:15:29  <creationix>the yield is hidden in the wrapper code that adapts between callbacks and coroutines
15:15:42  <creationix>user code looks like `result = someAction()`
15:15:42  <coderkevin>It sounds interesting, I'd like to take a look.
15:15:51  <coderkevin>Functionally though, it's basically the same, right?
15:15:55  <creationix>more or less
15:16:10  <coderkevin>Since it's all on the same main thread, no locking is required, right?
15:16:15  <creationix>right
15:16:27  <coderkevin>As long as you don't yield in a critical section.
15:16:39  <creationix>true
15:16:52  <creationix>so the hazard with my coroutine style is any function call can potentially cause you to yield
15:17:04  <coderkevin>Cool, yeah I'd like to take a look.
15:17:09  <creationix>but it’s not as bad as true threading since it’s not every statement that can pre-empt you
15:17:19  <coderkevin>That's true.
15:17:35  <coderkevin>One thing we care a lot about on this project is speed, so no thread-locking.
15:17:41  <creationix>so I’ll see if I can port coro-http and dependencies to plain luv
15:17:55  <creationix>that gives you a nice coroutine based http client and server
15:18:16  <creationix>and then you could port the weblit framework if you want a higher-level http framework
15:18:21  <coderkevin>We'll be running straight C code on the libuv event loop outside of Lua for higher performance code, but we want it interleaved with Lua-based events as well.
15:18:29  <coderkevin>Okay, that sounds great.
15:18:45  <creationix>but if you want https client, you’ll need to provide some sort of tls
15:19:00  <creationix>if you’re able to build openssl and lua-openssl (the bindings luvi uses) it will make porting much easier
15:19:08  <coderkevin>So just to be clear, you recommend that I run luv directly for this project since I don't really need package management so much, right?
15:19:26  <creationix>yea, it’s faster, simpler and doesn’t require porting luvi to lua
15:19:40  <coderkevin>That's great advice, thanks!
15:19:40  <creationix>and if you already use and know the libuv API it will feel natural
15:20:13  <coderkevin>We won't need an http client straight away, maybe later down the line, though.
15:21:26  <coderkevin>Well thanks for the help. If you get that coroutine code up, I'd like to see it. Thanks again!
15:22:30  <creationix>coderkevin: will you be on here or shall I email you?
15:22:44  <coderkevin>I'll be here.
15:23:11  <creationix>so a basic http server serving up static files and maybe some REST endpoints would be a good example?
15:23:12  <coderkevin>But my email is kevin.killingsworth@garmin.com in case something happens.
15:23:34  <coderkevin>Yeah, that would be cool.
15:23:42  <creationix>will you be needing websockets?
15:23:50  <coderkevin>Eventually, but not right away.
15:24:12  <coderkevin>We're just getting http up first, then we'll worry about server push later.
15:24:18  <creationix>I’ve been meaning to make such an example for a while anyway. People often ask how to use luv without luvit
15:24:34  <coderkevin>It sounds like for a controlled embedded system, it's a really good fit.
15:25:03  <creationix>right, and you can use git submodules for dependency management anyway
15:25:26  <creationix>that’s how we did it with luvit before I wrote lit
15:26:36  <creationix>coderkevin: I’ll push it here https://github.com/creationix/luvweb
15:27:14  <coderkevin>watched and starred. :)
16:23:44  <creationix>rphillips: turns out using luv directly with lua isn’t that painful https://github.com/creationix/luvweb
16:23:58  <creationix>one-line require system https://github.com/creationix/luvweb/blob/c6a86ebbeb8c8116e2ea3c238c82903dd7931b3d/src/main.lua#L5-L7
16:24:19  <creationix>all deps are now a flat list of local submodules in ‘lib’
16:24:49  <creationix>of course if a package wants internal requires, it will need to prefix everything with it’s name like in normal lua
16:32:09  <rphillips>that is slick
16:44:37  <kostco>gday folks
17:00:50  <creationix>heh, coroutines are less powerful in stock lua
17:00:56  <creationix>you can’t use require from inside a coroutine
17:01:10  <creationix>and would make porting lit to plain lua rather difficult
17:01:34  <creationix>or rather, you can’t require a file that then yields
17:01:46  <creationix>no yielding across C boundaries
17:11:01  <rphillips>limiting
18:07:13  <rphillips>kostco: perhaps you could take a stab at refactoring the fs tests
18:16:53  <rphillips>creationix: which ssh key can I use
18:17:01  <rphillips>i want to give you access to justin's box as well
18:17:31  <creationix>sent to pm
18:28:48  <kostco>sure rphillips to start ill take a stab at refactoring fstab
18:44:22  * travis-cijoined
18:44:23  <travis-ci>luvit/luv#51 (master - 73bd9dc : Tim Caswell): The build passed.
18:44:23  <travis-ci>Change view : https://github.com/luvit/luv/compare/13a5e6be0944...73bd9dc5c497
18:44:23  <travis-ci>Build details : https://travis-ci.org/luvit/luv/builds/74615357
18:44:23  * travis-cipart
18:56:15  <coderkevin>creationix: I tried out the luaweb, but it failed on the make step, in luv, on 'find_package("Lua")'
18:56:47  <coderkevin>I looked all over for a LuaConfig.cmake or Lua-config.cmake file, but didn't find one around. I wonder what I'm missing.
18:56:52  <creationix>I just got that working on my ubuntu box, pull again?
18:57:16  <creationix>I’m still trying to fix it for OSX, bitlib and lua-openssl are harder on macs
18:57:31  <coderkevin>Ah, okay. I'm on ubuntu as well.
18:58:08  <creationix>coderkevin: you need https://github.com/creationix/luvweb/commit/fa4bc8147b424b7c4412e1aff3d39dd0f3e82ec0 to use system lua for luv
18:58:24  <creationix>My test machine had system lua and /usr/local lua so I didn’t notice at first
18:59:04  <coderkevin>ah
18:59:29  <creationix>As soon as I get it building on OSX, I’ll port weblit now that all it’s dependencies are sastified
19:04:10  <coderkevin>Looks like the .so's are built after the change you suggested.
19:09:25  <coderkevin>How do I get coro-http? I see it in lit, but not in luarocks.
19:16:29  <creationix>coderkevin: I’ve packaged them as git repos
19:16:35  <creationix>all submodules in the sample
19:16:49  <creationix>https://github.com/creationix/luvweb/tree/master/src/lib
19:17:15  <creationix>it’s almost identical to the lit version, but packaged differently for normal lua require
19:17:43  <coderkevin>Yeah, I just noticed that, and where you set it up in boot.lua
19:17:49  <creationix>you can probably use luarocks modules too, just make sure to add their path in boot.lua in the sample
19:18:06  <coderkevin>However, when I run "lua main.lua" it doesn't find coro-http. Is it actually running boot.lua?
19:18:15  <creationix>you need to run boot.lua
19:18:24  <creationix>it sets calls main
19:18:27  <coderkevin>Ah, that's what it is.
19:18:43  <creationix>I need to update the README
19:18:47  <coderkevin>Sorry, I was going off the README.
19:19:35  <creationix>I fixed the “run” target in the makefile, but forgot to update the README
19:19:37  <creationix>https://github.com/creationix/luvweb/commit/206d05a2e4f3d2e65afdafbd50d09349a17c8d69
19:19:50  <coderkevin>Nice, I think it worked!
19:20:47  <coderkevin>So, does this use libuv tcp sockets?
19:20:51  <creationix>yep
19:20:57  <coderkevin>Nice.
19:21:05  <creationix>coro-net wraps libuv tcp and pipe into coroutine friendly read and write functions
19:21:17  <creationix>it also uses libuv getaddrinfo to resolve hostnames to ip addresses
19:21:32  <coderkevin>Hmm, so you can feel like you're writing synchronous code, right?
19:21:39  <creationix>exactly
19:21:59  <creationix>to read a stream, you can simply do: for chunk in read do … end
19:22:03  <coderkevin>Sort of like async & await in JS, without having to actually call await.
19:22:08  <creationix>exactly
19:22:28  <coderkevin>That's really cool.
19:23:05  <coderkevin>Well, I've got it all running on ubuntu, I guess the next step is getting libuv running on QNX on our HW target.
19:23:08  <creationix>so this sample has all the primitives used by weblit, my express-like framework
19:23:28  <creationix>right, you’ll need luv, lua-openssl, and bitlib building on your hardware
19:23:38  <creationix>bitlib is pretty small, that should be easy
19:23:49  <creationix>surely there is openssl already ported
19:23:55  <creationix>so libuv is probably the hardest part
19:24:23  <coderkevin>Right. I've dug into the guts of libuv a few times over the last few months and have a fairly good feel for it by now, so I'm not too scared about it.
19:24:40  <coderkevin>Biggest thing is to use pipes instead of eventfds, and to not use epoll.
19:24:41  <creationix>though I’m still unable to build lua-openssl on osx. luvi does it, but with a huge cmake script and lots of assumptions
19:24:58  <coderkevin>Ohm, hmm.
19:25:19  <creationix>that’s just because osx comes with a really old system openssl
19:25:25  <coderkevin>Well, I personally don't need OSX support for what I'm doing, so don't worry about it on my account.
19:25:46  <coderkevin>I wonder if you could use a homebrew install of openssl.
19:25:46  <creationix>I just want the sample easy to test. Many devs looking at this will be on macbooks
19:26:01  <coderkevin>Yeah, I've got a macbook I do work on too.
19:26:12  <creationix>perhaps. Luvi just includes openssl in a submodule and includes it statically
19:26:34  <coderkevin>Hmm, with all the security patches for openssl, might want to have it dynamic.
19:27:19  <coderkevin>Otherwise you'll have to bump version for Luvi every time a new security patch is released for openssl, right?
19:28:42  <creationix>we release luvi pretty often
19:28:49  <creationix>same day as every openssl release so far
19:28:58  <creationix>or libuv release or luajit release
19:29:24  <creationix>rphillips: watches the openssl lists for important updates
19:29:38  <coderkevin>Yeah, I'm guessing someone has to!
20:04:05  <kostco>rphillips: https://github.com/virgo-agent-toolkit/rackspace-monitoring-agent/commit/4e5cdb0a7b2a0f1d419983c773d8aaba4c5e0e1e
20:04:05  <kostco>I took a stab at the fstab thing, still wip, gonna see what i can do with reducing the load inside base.lua and with async fs fun. But yeah take a look, leave notes
20:04:43  <kostco>and yea ill fixer up the pr when i have a good idea of where i wanna go with it
20:07:54  <rphillips>i don't think you need to registered platforms anymore
20:07:59  <rphillips>the*
20:15:48  <rphillips>kostco: that looks good
20:15:53  <rphillips>minor comments
21:32:27  <creationix>coderkevin: alright, got it building on both ubuntu and osx. Had to switch to cmake for everything
21:32:47  <coderkevin>Oh, that makes sense.
21:33:05  <creationix>it builds static openssl on osx and windows, but uses the system openssl on linux
21:33:31  <creationix>most everyone wanting to use luv without luvit is probably on linux and doesn’t want static openssl
21:33:32  <creationix>just a guess
21:35:25  <coderkevin>fair enough, I suppose. Although we'll be on qnx. :)
21:36:03  <creationix>well, you’ll have custom build scripts anyway :)
21:36:14  <creationix>this is just an example of how to use the code
21:37:58  <coderkevin>That's true. I've started on libuv today, getting it in our build system. Thanks for the help!
22:26:04  <kostco>rphillips: can you take a stab at refactoring passwd.lua?
22:26:04  <kostco>I'm curious how you envision these hostinfo sub classes working when it needs to deal with a list
22:26:53  <rphillips>let me see
22:27:06  * piernovquit (Ping timeout: 250 seconds)
22:27:28  * piernovjoined
22:31:44  <creationix>rphillips: luv port of weblit uses only 1.6mb for a server
22:31:52  <rphillips>nice!
22:31:55  <creationix>though I am having some strange behaviors with it
22:33:38  <rphillips>kostco: async.map
22:33:42  <rphillips>i think is the way to go
22:34:50  <rphillips>there isn't a lua example
22:35:46  <rphillips>https://github.com/caolan/async
22:35:52  <rphillips>will have the javascript prototype
22:48:01  <kostco>rphillips: yep read that, give it a shot, see if you like what it looks like in passwd at the end, ill see if i cant use it to refactor pam.lua, still unsure though since the hostinfofs class is currently inited with the filepath, lemme see what i can do
22:49:05  <creationix>weird, lua: /home/tim/luvweb/src/lib/coro-net/init.lua:91: EADDRINUSE: address already in use
22:49:07  <kostco>rphillips: lua has a async.map function in the async library,
22:49:19  <creationix>there is no lua process running and according to netstat nothing has that port
22:49:47  <creationix>the first time I ran the app, it didn't complain about a busy port, but nothing could connect either and the process didn't respond to SIGINT
22:49:53  <kostco>ive sometimes had things close but block the port, ps aux couldnt find them, had to eventually reboot
22:50:08  <kostco>i think killall solved the issue once
22:50:09  <creationix>don't know if it's lua's coroutines or what, but luv on lua with coroutines is weird
22:50:33  <creationix>yeah, killall doesn't help, there is no lua process
22:50:45  <kostco>ive had the eaddrinuse error pop up in node soo many times, i blame libuv
22:50:57  <rphillips>kostco: right... it's just not documented... so look at the node doc
22:51:15  <kostco>ah that what you meant
22:53:01  <creationix>aha!, found a unix socket file named "" in my directory
22:53:12  <creationix>it's interpreting my ip address as a file path
22:54:04  <creationix>which explains why the tcp client and netstat never saw it, but the second run thought the server was still running, even after a reboot
22:54:11  <creationix>those files are rather persistent sometimes
22:56:06  * dan336quit (Quit: Leaving.)
23:01:34  <creationix>it works great now!
23:01:56  <creationix>I successfully ported weblit and all it’s dependencies all the way down to run on lua 5.2
23:07:41  <kostco>bleh i cant figure out how to make this pam.lua thing work with the new conventions, ill circle back to it
23:14:03  <creationix>coderkevin: I’m all done with the sample
23:14:17  <creationix>it has two sample mains. One using coro-http directly and one using the higher-level weblit framework
23:14:30  <creationix>weblit has websockets that should work out of the box