mynameisdebian

Activity Graph

Page 1 of 3 | Next »

2019-08-20

[00:24:44] mynameisdebian: Ping timeout: 272 seconds
[02:18:06] mynameisdebian: has joined #ruby
[02:54:12] mynameisdebian: Ping timeout: 272 seconds
[04:34:40] mynameisdebian: has joined #ruby
[04:45:28] mynameisdebian: Ping timeout: 245 seconds

2019-08-19

[20:22:45] mynameisdebian: has joined #ruby
[20:26:52] mynameisdebian: havenwood: A while back I was having an issue where my Apache server was failing to respond to a Slack message quickly enough, and you advised me to do a Process.detach fork{}, and put the code that was taking a long time inside of the braces. However, I am finding that my Apache server is still waiting for the child process to complete before closing the connection, even though the script itself continues processing immediately without waiting for
[20:26:53] mynameisdebian: the code in the block to complete. I am wondering if you have any ideas why that is happening or how I might be able to fix it?
[20:38:53] mynameisdebian: If I have some JSON that I would like to be the body of an HTTP request, I can I pass that JSON to curl via a system call?
[20:39:01] mynameisdebian: "how can I pass"
[22:02:17] mynameisdebian: Ruby to exit before sending the response. I've tried this numerous way but I don't believe it will work any other way (besides worker queues like you suggested, but I'm trying to avoid that)
[22:02:17] mynameisdebian: ramfjord, the issue is that in order to push my code I have to request a merge and wait like a day, which makes it difficult at this stage to break up my program into worker queues. The reason I'm shelling out instead of just using an HTTP library for this is that it is a CGI script running on Apache that is supposed to receive Slack messages. Slack throws an error in the channel if a response is not received within 3 seconds, and Apache waits for
[22:32:45] mynameisdebian: How can I execute a shell command in my Ruby CGI script without Apache waiting for the shell command to finish? My CGI script receives messages from Slack and must respond with "200 OK" within 3 seconds, but Apache waits until everything has resolved before sending the 200 message.

2019-08-10

[07:02:28] mynameisdebian: has joined #ruby
[07:43:22] mynameisdebian: Ping timeout: 245 seconds
[13:39:31] mynameisdebian: has joined #ruby
[13:44:32] mynameisdebian: Ping timeout: 272 seconds

2019-08-09

[18:05:29] mynameisdebian: has joined #ruby
[21:15:51] mynameisdebian: from script A to script B?
[21:15:51] mynameisdebian: I have a Ruby CGI script (A) that receives a JSON message from Slack that is retrieved as a Hash via cgi.params. That script then makes an HTTP request to a script (B) that needs to be able to receive either the exact Hash or the Hash parameters. When I try converting it to JSON in script A, then POST the JSON to script B, the message ends up with a bunch of extra commas and script B cannot decipher it. How can I correctly pass the CGI parameters
[21:16:58] mynameisdebian: Should have said, "the message ends up with a bunch of extra backslashes"
[21:40:38] mynameisdebian: json.decode or json.parse?
[22:16:51] mynameisdebian: Is there a way to make a "detached" HTTP request with Ruby, so that the script makes the call and does not wait for it to return?
[22:17:58] mynameisdebian: havenwood, no :(
[22:18:28] mynameisdebian: havenwood, can you fill me in briefly?
[22:32:12] mynameisdebian: havenwood, thank you. I will try to work on that, but I'm under a deadline that I may very quickly be fired over, and I may not get the chance. So, please forgive me if I don't make it back to discuss my results
[22:32:38] mynameisdebian: havenwood, there's no good way over IRC to properly convey one's appreciate for another's time
[22:35:38] mynameisdebian: havenwood, it did what I think you were expecting, but it will take me some time to wrap my head around the correct way to use that for my situation
[22:37:41] mynameisdebian: the last command didn't quite do what was intended because the script is responding to a Slack message, not a browser
[22:37:47] mynameisdebian: but I will try to read up on that
[22:38:08] mynameisdebian: got about 20 minutes to compile my work from last month to prove I'm worth a paycheck, wish me luck
[22:38:29] mynameisdebian: havenwood, I'll be in touch
[23:48:19] mynameisdebian: Ping timeout: 248 seconds

2019-08-08

[22:11:19] mynameisdebian: has joined #ruby
[22:12:21] mynameisdebian: I have an Apache script serving a CGI script that responds to Slack events. Apache always takes several seconds to respond with "200 OK", and because of it Slack is throwing a message. How do I respond with 200 and send it right away with Ruby?
[22:37:23] mynameisdebian: I have an Apache server running a Ruby CGI script. The CGI script receives a message from Slack, responds to Slack with "HTTP OK", then does a bunch of other stuff. It seems like the Apache server does not send 200 until the CGI script completes. Is there any way to make Apache return 200 without waiting for the script to complete?
[22:56:05] mynameisdebian: SeepingN: Thank you for the reply. Is that a common solution, and this a common problem? Can you elaborate on "wait for child to finish or just let it go unattached"? What do you mean by those two options there?
[22:56:37] mynameisdebian: If I call the child script from the parent, won't the parent still take a long time to finish, and I'll still get the timeout error?
[23:03:22] mynameisdebian: SleepingN, I just want to make sure because I am almost sleeping myself, is there any reason this solution would not work on Ruby without Rails?
[23:12:37] mynameisdebian: havenwood, I just need a way to send the 200 response and still run some code. Having a second script seems ok, but I'm trying to understand rack. Do you have a second to kind of explain those short examples on that page for me?
[23:19:45] mynameisdebian: Does the Rack app contain the other code I want to run?
[23:21:25] mynameisdebian: so, all I'm doing here is receiving a JSON message from Slack and responding with 200 OK, then taking information from that message and using it to place a call to another API. That API returns some data that is used to generate a Slack-formatted message, and then that message is posted back to a Slack endpoint
[23:25:18] mynameisdebian: havenwood, I'm confusing myself a little bit here. In this scenario is my Apache server still running on the server, serving the config.ru file?
[23:27:28] mynameisdebian: and in this case the Ruby webserver is always running, or does it have to be run on demand?
[23:29:38] mynameisdebian: It's a company webserver and I have to go through some admins to get anything done. I'm thinking it might be less complex in this case to have first script return 200 and make a system call to the other
[23:29:56] mynameisdebian: havenwood, I appreciate your time
[23:30:08] mynameisdebian: I'm going to re-read what you said and try to get a better grasp of it later on
[23:30:33] mynameisdebian: havenwood, thank you
[23:34:59] mynameisdebian: Ping timeout: 248 seconds

2019-07-25

[19:49:23] mynameisdebian: has joined #ruby
[19:50:04] mynameisdebian: How can I change all newlines (\n) to double newlines (\n\n), without converting double-newlines to quadruple newlines (\n\n => \n\n\n\n) ?
[19:56:23] mynameisdebian: wildtrees, I could just do the gsub and then do another gsub to convert the quadruple-newlines back to double, but I know I can do it with a regex somehow
[19:57:34] mynameisdebian: havenwood, do you have a link?
[20:06:53] mynameisdebian: sorry was afk for sec
[20:16:08] mynameisdebian: havenwood thanks
[20:16:11] mynameisdebian: wildtrees thanks
[20:16:13] mynameisdebian: also anyone else
[21:21:26] mynameisdebian: Read error: Connection reset by peer

2019-07-19

[02:28:18] mynameisdebian: Ping timeout: 248 seconds
[04:14:07] mynameisdebian: has joined #ruby
[04:17:47] mynameisdebian: Remote host closed the connection
[04:18:09] mynameisdebian: has joined #ruby
[05:40:05] mynameisdebian: Read error: Connection reset by peer
[05:40:28] mynameisdebian: has joined #ruby
[07:20:49] mynameisdebian: Remote host closed the connection
[07:21:14] mynameisdebian: has joined #ruby
[08:14:17] mynameisdebian: Ping timeout: 258 seconds
[08:19:39] mynameisdebian: has joined #ruby
[08:24:34] mynameisdebian: Ping timeout: 246 seconds
[15:18:43] mynameisdebian: has joined #ruby
[15:45:47] mynameisdebian: Ping timeout: 244 seconds

2019-07-18

[20:22:00] mynameisdebian: has joined #ruby
[20:22:42] mynameisdebian: How do I text-join all members of an array with a comma, except those members that are nil?
[20:37:12] mynameisdebian: ramfjord, it does, thanks!
[20:37:58] mynameisdebian: definitely cleaner than .reject(&:blank?).join
[22:18:15] mynameisdebian: I use blocks = Array.new(20, {})
[22:18:16] mynameisdebian: and blocks is now an array of 20 Hashes, each Hash being {"type" => "context"} Any idea what's going on?
[22:18:16] mynameisdebian: to generate an array of empty Hashes, then blocks[0]["type"] = "context"
[22:23:34] mynameisdebian: thanks, that works but I don't really get why

2019-06-25

[14:23:44] mynameisdebian: has joined #ruby
[14:30:31] mynameisdebian: Ping timeout: 244 seconds
[15:12:00] mynameisdebian: has joined #ruby
[15:18:32] mynameisdebian: line "puts 'HTTP/1.0 200 OK'" ngrok is still sending a 500 Internal Server Error. I fumbled around to handle the challenge token and I don't know any way to "respond" with 200 OK other than printing it. Can anyone help me with this?
[15:18:32] mynameisdebian: Has anyone here ever built a Slack app in Ruby? I am trying to do an unfurl. Here is my code: https://dpaste.de/F6mW I am testing on my local machine running Apache and ngrok. When I receive the verification challenge event it runs the first condition and I ngrok tells me it is sending a 200 response. However, when I receive an unfurl it runs the second conditional and it tells me it is sending a 500 Internal Server Error. Even if I only run the
[16:02:27] mynameisdebian: How can I simply make a Ruby CGI script (with "cgi" gem) respond to a request with HTTP 200?
[16:54:36] mynameisdebian: adam12: I just want it to be simple. I'm trying to write a Slack app. I get an event in JSON and I'm supposed to immediately respond with HTTP 200, then POST some data to an API endpoint. At this point I would just be happy to figure out how to generate the HTTP 200 response
[16:58:38] mynameisdebian: ytti: is that a Rails thing?
[17:53:46] mynameisdebian: Remote host closed the connection

2019-06-21

[01:54:06] mynameisdebian: has joined #ruby
[03:28:22] mynameisdebian: Ping timeout: 245 seconds
[04:10:09] mynameisdebian: has joined #ruby
[16:20:21] mynameisdebian: Ping timeout: 268 seconds
[17:52:06] mynameisdebian: has joined #ruby
[18:30:18] mynameisdebian: Ping timeout: 272 seconds
[18:48:13] mynameisdebian: has joined #ruby
[18:53:06] mynameisdebian: Ping timeout: 272 seconds

2019-06-20

[18:05:04] mynameisdebian: has joined #ruby
[19:48:15] mynameisdebian: I'm stupid. What is a type checker?
[19:51:14] mynameisdebian: Link is a lefty.
[21:23:35] mynameisdebian: Ping timeout: 244 seconds
[22:13:41] mynameisdebian: has joined #ruby
[22:18:44] mynameisdebian: Ping timeout: 272 seconds

2019-06-19

[23:24:12] mynameisdebian: has joined #ruby
[23:32:41] mynameisdebian: Net::HTTPBadRequest . Can anyone tell me the correct way to form this request, with net/http or another library?
[23:32:41] mynameisdebian: I am trying to set up unfurls for a Slack app. To do so I POST to the unfurl API endpoint. I am following the "Pure JSON Example" at https://api.slack.com/docs/message-link-unfurling#unfurls_parameter . My code is at https://dpaste.de/spra . My JSON that I am passing into the function is '{"channel":"CKKF5EV1D","ts":"1560985906.010200","unfurls":{"https://app.diffbot.com":{"text":"output_from_kg_call"}}}' . When I submit my request I get
[23:42:47] mynameisdebian: leftylink: I really appreciate the reply, let me look into that
[23:47:42] mynameisdebian: leftylink: THANKS!
[23:56:17] mynameisdebian: Ping timeout: 245 seconds

2018-12-01

[00:28:40] mynameisdebian: has joined #ruby
[01:07:29] mynameisdebian: Ping timeout: 256 seconds

2018-09-20

[00:52:31] mynameisdebian: has joined #ruby
[01:07:30] mynameisdebian: Remote host closed the connection

2018-09-19

[16:30:58] mynameisdebian: has joined #ruby
[16:34:30] mynameisdebian: Remote host closed the connection
[17:36:02] mynameisdebian: has joined #ruby
[17:46:18] mynameisdebian: Remote host closed the connection
[20:18:58] mynameisdebian: has joined #ruby
[20:23:31] mynameisdebian: Ping timeout: 260 seconds

2018-09-18

[03:22:01] mynameisdebian: has joined #ruby
[03:37:08] mynameisdebian: has joined #ruby
[23:14:45] mynameisdebian: has joined #ruby
[23:24:29] mynameisdebian: has joined #ruby
[23:41:53] mynameisdebian: has joined #ruby
[23:43:27] mynameisdebian: Remote host closed the connection

2018-09-16

[23:06:09] mynameisdebian: has joined #ruby
[23:07:43] mynameisdebian: Remote host closed the connection

2018-09-07

[21:07:48] mynameisdebian: has joined #ruby
[21:54:26] mynameisdebian: Remote host closed the connection
[21:58:13] mynameisdebian: has joined #ruby
[22:16:51] mynameisdebian: Remote host closed the connection

2018-08-21

[14:35:45] mynameisdebian: has joined #ruby
[14:51:01] mynameisdebian: Remote host closed the connection
[17:51:40] mynameisdebian: has joined #ruby
[17:55:18] mynameisdebian: Remote host closed the connection
[19:58:50] mynameisdebian: has joined #ruby
[20:03:38] mynameisdebian: Remote host closed the connection
[20:19:04] mynameisdebian: has joined #ruby
[20:23:26] mynameisdebian: Ping timeout: 244 seconds
[20:53:00] mynameisdebian: has joined #ruby

2018-08-09

[15:38:33] mynameisdebian: has joined #ruby
[16:28:45] mynameisdebian: Remote host closed the connection

2018-08-08

[15:07:04] mynameisdebian: has joined #ruby
[15:21:08] mynameisdebian: Ping timeout: 256 seconds

2018-07-25

[00:01:48] mynameisdebian: has joined #ruby
[02:40:21] mynameisdebian: Remote host closed the connection
[02:41:22] mynameisdebian: has joined #ruby
[04:30:35] mynameisdebian: Read error: Connection reset by peer
[06:34:38] mynameisdebian: has joined #ruby
[06:38:57] mynameisdebian: Ping timeout: 240 seconds
[07:14:39] mynameisdebian: has joined #ruby
[07:19:33] mynameisdebian: Ping timeout: 264 seconds
[08:08:41] mynameisdebian: has joined #ruby
[08:13:22] mynameisdebian: Ping timeout: 268 seconds
[09:02:46] mynameisdebian: has joined #ruby
[09:07:39] mynameisdebian: Ping timeout: 260 seconds
[09:39:39] mynameisdebian: has joined #ruby
[09:44:09] mynameisdebian: Ping timeout: 264 seconds
[10:33:45] mynameisdebian: has joined #ruby
[10:38:05] mynameisdebian: Ping timeout: 240 seconds
[11:08:37] mynameisdebian: has joined #ruby
[11:12:57] mynameisdebian: Ping timeout: 240 seconds
[12:02:40] mynameisdebian: has joined #ruby
[12:07:19] mynameisdebian: Ping timeout: 260 seconds
[12:56:44] mynameisdebian: has joined #ruby
[13:01:21] mynameisdebian: Ping timeout: 248 seconds
[13:50:47] mynameisdebian: has joined #ruby
[13:55:13] mynameisdebian: Ping timeout: 244 seconds
[15:27:16] mynameisdebian: has joined #ruby
[15:31:03] mynameisdebian: Remote host closed the connection

2018-07-24

[02:06:12] mynameisdebian: Remote host closed the connection
[03:32:56] mynameisdebian: has joined #ruby
[03:37:49] mynameisdebian: Ping timeout: 256 seconds
[03:46:40] mynameisdebian: has joined #ruby
[04:14:59] mynameisdebian: Remote host closed the connection

2018-07-23

[02:20:09] mynameisdebian: has joined #ruby
[02:32:21] mynameisdebian: Remote host closed the connection
[22:15:13] mynameisdebian: has joined #ruby

2018-07-22

[00:08:54] mynameisdebian: has joined #ruby
[00:13:34] mynameisdebian: Ping timeout: 260 seconds
[01:02:59] mynameisdebian: has joined #ruby
[01:07:42] mynameisdebian: Ping timeout: 260 seconds
[01:38:20] mynameisdebian: has joined #ruby
[01:43:13] mynameisdebian: Ping timeout: 265 seconds
[02:04:14] mynameisdebian: has joined #ruby
[02:08:50] mynameisdebian: Ping timeout: 260 seconds
[02:58:19] mynameisdebian: has joined #ruby
[03:02:58] mynameisdebian: Ping timeout: 260 seconds
[03:35:02] mynameisdebian: has joined #ruby
[03:39:50] mynameisdebian: Ping timeout: 260 seconds
[04:13:18] mynameisdebian: has joined #ruby
[04:21:45] mynameisdebian: Ping timeout: 265 seconds
[06:34:08] mynameisdebian: has joined #ruby
[07:47:09] mynameisdebian: Remote host closed the connection
[16:19:19] mynameisdebian: has joined #ruby
[16:46:05] mynameisdebian: Remote host closed the connection

2018-07-21

[02:24:41] mynameisdebian: Read error: Connection reset by peer
[02:25:07] mynameisdebian: has joined #ruby
[08:32:05] mynameisdebian: Remote host closed the connection
[08:46:29] mynameisdebian: has joined #ruby
[09:15:39] mynameisdebian: Remote host closed the connection
[09:24:47] mynameisdebian: has joined #ruby
[10:09:34] mynameisdebian: Remote host closed the connection
[10:12:37] mynameisdebian: has joined #ruby
[12:37:10] mynameisdebian: Remote host closed the connection
[19:54:02] mynameisdebian: has joined #ruby
[22:03:00] mynameisdebian: Remote host closed the connection
[23:29:36] mynameisdebian: has joined #ruby
[23:34:22] mynameisdebian: Ping timeout: 260 seconds

2018-07-20

[00:15:30] mynameisdebian: has joined #ruby
[00:23:09] mynameisdebian: Remote host closed the connection
[00:40:33] mynameisdebian: has joined #ruby
[00:43:21] mynameisdebian: Remote host closed the connection
[01:01:11] mynameisdebian: has joined #ruby
[01:29:41] mynameisdebian: Remote host closed the connection
[01:34:51] mynameisdebian: has joined #ruby
[01:56:16] mynameisdebian: Remote host closed the connection
[02:09:42] mynameisdebian: has joined #ruby
[02:49:09] mynameisdebian: Remote host closed the connection
[02:49:44] mynameisdebian: has joined #ruby
[02:54:53] mynameisdebian: Ping timeout: 276 seconds
[03:51:25] mynameisdebian: has joined #ruby
[03:55:02] mynameisdebian: Remote host closed the connection
[15:14:27] mynameisdebian: has joined #ruby
[15:33:49] mynameisdebian: Remote host closed the connection
[22:44:31] mynameisdebian: has joined #ruby
[22:44:51] mynameisdebian: Remote host closed the connection
[22:45:27] mynameisdebian: has joined #ruby
[23:45:30] mynameisdebian: Remote host closed the connection
[23:58:55] mynameisdebian: has joined #ruby

2018-07-19

[01:05:20] mynameisdebian: Remote host closed the connection
[01:05:37] mynameisdebian: has joined #ruby
[01:58:30] mynameisdebian: Remote host closed the connection
[02:39:37] mynameisdebian: has joined #ruby
[03:06:34] mynameisdebian: Read error: Connection reset by peer
[05:03:26] mynameisdebian: has joined #ruby
[05:03:56] mynameisdebian: Remote host closed the connection
[23:29:49] mynameisdebian: has joined #ruby
[23:30:35] mynameisdebian: Remote host closed the connection
[23:31:07] mynameisdebian: has joined #ruby

2018-07-18

[23:46:08] mynameisdebian: Remote host closed the connection
[23:46:42] mynameisdebian: has joined #ruby