code logs -> 2014 -> Sun, 09 Nov 2014< code.20141108.log - code.20141110.log >
--- Log opened Sun Nov 09 00:00:53 2014
01:52
<&ToxicFrog>
So I have a Python question.
01:52
<&ToxicFrog>
I have a tty python program that expects to be invoked via ssh or telnet.
01:53
<&ToxicFrog>
This means that at any time it could lose its controlling terminal when the network goes boom.
01:53
<&ToxicFrog>
There is some cleanup that needs to happen when this occurs.
01:53
<&ToxicFrog>
How do I do this?
01:53
<&ToxicFrog>
What does a python program see when its controlling terminal goes away?
01:53
<&Derakon>
Um.
01:53
<&Derakon>
At a guess, EOF on STDIN?
01:53
<&Derakon>
I have no idea though, really.
02:01
<&Derakon>
Hm, no, that doesn't seem to happen.
02:03
<&ToxicFrog>
I'm having a great deal of trouble figuring this out because of course once the controlling terminal is gone I can no longer see the program's output.
02:04
<&ToxicFrog>
And redirecting stderr just gets me an empty file.
02:04
<&ToxicFrog>
I would say "ok, it's eating a SIGPIPE and exiting immediately", but the python docs explicitly call out SIGPIPE as having a custom signal handler that turns it into a Python exception.
02:05
<&Derakon>
Here was my approach: http://pastebin.com/CBwGjNZ9
02:05
<&Derakon>
Writing the program's output to a file would avoid the "can't see its output" problem, so long as you properly close the file when you're done.
02:05
<&ToxicFrog>
I ended up using strace.
02:05
<&ToxicFrog>
It looks like it gets SIGHUP, not SIGPIPE.
02:05
<&Derakon>
(Or at least periodically call flush(); the one call to flush() in that pastebin is kind of pointless though. Man my Python is rusty)
02:06
<&ToxicFrog>
Which makes sense.
02:09
<&ToxicFrog>
So I need to install a signal handler that traps SIGHUP, does cleanup, and then exits.
02:34 * iospace runs SIGKILL on ToxicFrog
02:34
<@iospace>
o:
02:45 Derakon is now known as Derakon[AFK]
03:32 Derakon[AFK] is now known as Derakon
03:53 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
04:08 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:15 Kindamoody[zZz] is now known as Kindamoody
04:19
<&ToxicFrog>
Recording and spectation are both working! \o/
04:24
<&Derakon>
Nice.
05:03
<&ToxicFrog>
And the merged high scores list.
05:13 Derakon [chriswei@Nightstar-5fqf0m.ca.comcast.net] has quit [[NS] Quit: Leaving]
05:18 Thalass|afk [thalass@Nightstar-cdvd7b.bigpond.net.au] has quit [Ping timeout: 121 seconds]
05:34 Thalass|afk [thalass@Nightstar-cdvd7b.bigpond.net.au] has joined #code
05:34 Thalass|afk is now known as Thalass
05:34 mode/#code [+o Thalass] by ChanServ
05:50 mac [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
05:50 mode/#code [+o mac] by ChanServ
05:52 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
05:54 Thalass [thalass@Nightstar-cdvd7b.bigpond.net.au] has quit [Ping timeout: 121 seconds]
05:57 Harlow [harlow@Nightstar-04f.4po.201.71.IP] has joined #code
06:19 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
06:19 mode/#code [+o macdjord] by ChanServ
06:21 mac [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
06:33 * macdjord snerks at http://www.foxtrot.com/2014/10/12/baking-f/
07:17 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
08:23 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
08:29 Orthia [orthianz@Nightstar-hfd.d04.98.101.IP] has quit [Connection closed]
08:29 Orthia [orthianz@Nightstar-hfd.d04.98.101.IP] has joined #code
08:29 mode/#code [+o Orthia] by ChanServ
09:35 macdjord is now known as macdjord|slep
10:29 Harlow [harlow@Nightstar-04f.4po.201.71.IP] has quit [[NS] Quit: BED]
10:57 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
10:58 mode/#code [+o Checkmate] by ChanServ
11:01 Kindamoody is now known as Kindamoody|afk
11:24 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
13:12 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [[NS] Quit: If I had a world of my own, everything would be nonsense. Nothing would be what it is because everything would be what it isn't. And contrary-wise; what it is it wouldn't be, and what it wouldn't be, it would. You see?]
14:27 Checkmate [Z@Nightstar-ro94ms.balk.dk] has joined #code
14:27 mode/#code [+o Checkmate] by ChanServ
15:06 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code
15:06 mode/#code [+o celticminstrel] by ChanServ
15:12 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
15:12 mode/#code [+qo Vornicus Vornicus] by ChanServ
16:15 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
16:39 celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code
16:40 mode/#code [+o celticminstrel] by ChanServ
16:57
<@Turaiel>
Is there something wrong with this mysql syntax? If so, I can't see it. ...if ABS(price - thePrice) <= ABS(price - closest) then...
16:59
<~Vornicus>
I don't see anything wrong with it
16:59
<~Vornicus>
What's the error message, and what's the full query?
17:00
<@Turaiel>
The full query is very long. I'm making a stored procedure.
17:00
<@Turaiel>
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end if; if ABS(price - thePrice) <= ABS(price - closest) then set closest = theP' at line 1
17:01
<~Vornicus>
I'm going to pin it on something before the end if
17:01
<~Vornicus>
I'm absolutely stonking amazed at how bad the syntax checking is on mysql
17:02
<~Vornicus>
I don't think it was expecting the end if
17:02
<@Turaiel>
You're right
17:03
<@Turaiel>
The powerpoint for class did not say a semicolon was necessary after LEAVE priceLoop
17:06
<@Turaiel>
That only took forever
17:07
<@Turaiel>
http://i.imgur.com/87omaDf.png T.T
17:07
<~Vornicus>
T.T
17:30
<@Turaiel>
Welp, turns out I'm supposed to be using a function and not a procedure. Whoops.
17:35 mac [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
17:35 mode/#code [+o mac] by ChanServ
17:37 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
17:38
<~Vornicus>
uh huh.
17:42
<@Turaiel>
Do you happen to know why it's trying to find a declared variable within a field list from a query?
17:43 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
17:44
<@Turaiel>
Killed him
17:44
<@Turaiel>
Oops
18:11
<@iospace>
gg
18:14
<@gnolam>
https://twitter.com/zapjackson/status/530941076492648448
18:41
<@iospace>
gnolam: see my comments on #Fleet =P
19:13 Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has quit [Ping timeout: 121 seconds]
19:13 Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has joined #code
19:13 mode/#code [+o Ogredude] by ChanServ
19:39 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:50 Derakon [chriswei@Nightstar-5fqf0m.ca.comcast.net] has joined #code
19:50 mode/#code [+ao Derakon Derakon] by ChanServ
20:29 Kindamoody|afk is now known as Kindamoody
20:42 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
20:42 mode/#code [+o macdjord|slep] by ChanServ
20:44 mac [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
21:09 Kindamoody is now known as Kindamoody[zZz]
22:01 RchrdB [RichardB@Nightstar-v5j366.understood.systems] has quit [[NS] Quit: WeeChat 1.0.1]
22:02 RchrdB [RichardB@Nightstar-v5j366.understood.systems] has joined #code
22:28
<&ToxicFrog>
So I have a pager question.
22:28
<&ToxicFrog>
I want people using this frontend I'm writing to be able to view large text files in a non-horrible manner.
22:28
<&ToxicFrog>
less(1) is the obvious answer to this.
22:28
<&ToxicFrog>
However, less has commands that can be used to read arbitrary files and execute arbitrary shell commands.
22:28
<&ToxicFrog>
Is there a "safe" version of less?
22:31
<@Tamber>
export LESSSECURE=1; less <whatever>
22:32
<@Tamber>
See the 'Security' section of the less manpage for the list of things it disables. :)
22:32
<&ToxicFrog>
Aah!
22:32
<&ToxicFrog>
I was looking at the command line flags and didn't thinkk
22:32
<&ToxicFrog>
to check for an envar
22:32
<&ToxicFrog>
alex says hu
22:32
<&ToxicFrog>
hi
22:33
<@Tamber>
:)
22:33
<@Tamber>
I just figured it had to be the sort of thing that would be included somewhere.
22:35 Omega [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
22:35 mode/#code [+o Omega] by ChanServ
22:36 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
22:47 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
22:48 Omega is now known as Alek
23:25 Checkmate [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds]
23:29 Checkmate [Z@Nightstar-ro94ms.balk.dk] has joined #code
23:29 mode/#code [+o Checkmate] by ChanServ
23:32 Red_Queen [Z@Nightstar-ro94ms.balk.dk] has joined #code
23:32 mode/#code [+o Red_Queen] by ChanServ
23:33 Checkmate [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds]
23:59
<@[R]>
ToxicFrog: you shouldn't be calling less specifically, under normal circumstances, should be calling $PAGER (though that does make it harder to secure)
--- Log closed Mon Nov 10 00:00:09 2014
code logs -> 2014 -> Sun, 09 Nov 2014< code.20141108.log - code.20141110.log >

[ Latest log file ]