« first day (1247 days earlier)      last day (3775 days later) » 

5:00 AM
I'm still pretty sure I don't require any Java 7 features, but if it's not too painful or if CentOS already ships JDK7, grab that
or you can just replace "1.7" with "1.6" in build.xml and try that
 
I installed 1.7 anyway
just cloning now
 
oh, perfect
then you don't have to care about 1.6 compat ;p
 
[root@srv01 so-chatbot-driver]# ant ./build.xml
Buildfile: build.xml

BUILD FAILED
Target "./build.xml" does not exist in the project "Create Runnable Jar for Project so-chatbot-driver".

Total time: 0 seconds
[root@srv01 so-chatbot-driver]#
what am I doing wrong now?
 
get rid of the ./build.xml -- not necessary
 
5:01 AM
just run ant
 
ok building
got my bin/jar
 
the output file should be so-chatbot-driver.jar
 
cool, I found java -jar so-chatbot-driver.jar --help
 
I wrote a bunch of scripts on my server to do administration on this stuff; I'm going to post them on git gist after sanitizing passwords and let you tune them to your needs
there are actually a good number of command line parameters to the program
while you wait, install the screen package if it isn't already
 
already installed
is there a quick command I can run your modifications on master.js with?
I'm still not really in the loop with Git
still using SVN
 
5:05 AM
@DannyBeckett don't look at that commit; you'll want to pull SO-ChatBot from my github repository, and then follow the "Way 2" instructions at the bottom of the readme
 
ah ok!
 
what you'll need: an installation of NodeJS, and npm (which is the NodeJS package manager command), and then run npm install uglify-js2 -- that Node package is needed for minifying the javascript to produce the file master.min.js
.min.js is slightly better performance, and moreover, running node build.js produces an error if you don't have uglify-js2 installed
 
ok I've got all that stuff already done
 
oh okay
 
not sure why... did that first
kinda install-happy
 
5:07 AM
well if you already applied all the manual steps to make SO-ChatBot compatible with phantomjs 1.9.x, then all you need to do is write some maintenance scripts to glue it all together, which I'll handle 85% of for you once I post them
 
is that all your fork is?
 
no, I have a few other commits that differ from master
there are about 5 commits in my tree that Zirak hasn't had a chance to pull into master yet, but we submitted pull requests and I'm pretty certain they'll be pulled
 
ok great
 
and I removed a few commands that I really disliked
for example, !!urban for urban dictionary
that can be super NSFW
 
5:08 AM
@allquixotic Did you hear about Watson and the urban dictionary?
 
yes
 
I would have loved to hear a computer call something bullshit
 
ok so I've deleted Zirak's SO-ChatBot, cloned yours, ran npm install uglify-js2, ran ./publi.sh......
ran node build.js (the same as ./publi.sh?)
 
don't run publi.sh, lol, that's just for zirak
 
ok
what am I missing here now?
I've cloned your driver too
just run that?
sorry to bug you @allquixotic - what's the bot script?
java -jar so-chatbot-driver.jar --phantomjs --bot-script ????? --chat-url chat.stackexchange.com/rooms/12036/aviation  --username daniel.beckett+aviationbot@gmail.com --password xxxxxxx
 
5:19 AM
hang on, getting all the scripts together
 
thanks!!
 
two versions of the scripts, you only need the ones ending in "pjs" suffix if you don't care to try running it under firefox
 
redirects to gist homepage
perms?
 
no, it's public
 
oh wait, its working this time
 
5:23 AM
the same so-chatbot-driver and SO-ChatBot code can be used interchangeably with either Firefox or PhantomJS as the driver, but if you wanted to use Firefox, you'd need to give it access to an X11 server, which imho reduces performance, adds memory overhead, and is harder to administer
 
yeah of course
 
the only difference between the two as far as the driver is concerned are the command line arguments
hence why I have two sets of scripts
 
no point sticking X11 and Firefox on a CLI server
 
typically I deploy everything except startff.sh and startpjs.sh into the ~/dev directory of a non-root user
then I put startpjs.sh and/or startff.sh in the so-chatbot-driver directory with the jar file
 
I hope this next question doesn't throw everything out of whack...
I did all of the cloning, building etc as root
Everything is in /root
 
5:25 AM
all of that is fine, but I really would recommend that you not run it as root; if you don't have a user account, make one
 
is that ok, presuming I run your scripts as root too?
sure I can create another user
 
running a bot as root that has a command like !!eval that could in theory lead to security vulnerabilities is a huge problem
definitely, do not run this as root at all
 
is it ok to just mv the dirs though?
and chown
 
@DannyBeckett mv, chown, and it should just work
 
ahhhhh, good point on !!eval
ok
 
5:26 AM
they found some security vulnerabilities in !!eval and fixed them earlier
so it's not impenetrable
and I didn't write the driver with security in mind either
although it doesn't do much that could be a security issue
the scripts tend to call each other, in a hierarchy, so you can control how "much" you want to do
the hierarchy is this: rebuild goes all the way out to github, downloads the latest SO-ChatBot code, then recompiles the code and restarts the bot
reload doesn't fetch any new code, it just rebuilds whatever code is there
restart simply kills the running process and starts it anew
and start simply runs a new instance of the bot
so: rebuild > reload > restart > start
where > means "does more than"
 
ok, user created, everything mv'd and chown'd
ok great!!
 
you can probably just do restartpjs.sh once you have everything in the right place -- if you aren't working out of ~/dev, you should edit basedir in ... restart.sh, I think
and reload too
you will need to edit ~/dev/so-chatbot-driver/startpjs.sh in any case
and if your bot account isn't logging in using StackExchange's own credentials (if it uses, for instance, Google OpenID), then I don't believe the driver will handle it properly
the driver definitely can be enhanced to support credential providers besides the basic StackExchange Account one, but I haven't written it that way
 
yeah, no, that's fine
it's a normal SE account
 
perfect!
by the way, the manual changes you applied to patch in the ES5 shims, etc. for PhantomJS 1.9.x, can also be done on Zirak's upstream source code; it's just that... well... right now I think my fork of his code is a little bit better in terms of its featureset :P
if you don't like something I did, you can either patch it out in your local branch, or fork my repo, or fork Zirak's, or just use Zirak's
Zirak is the "official" maintainer of SO-ChatBot and I ultimately attempt to sync up with him whenever it makes sense to
my fork is heavily tailored to the policies and decisions of people in this chatroom
(we tend to be a little more work and family-friendly than JavaScript chat)
 
I didn't apply those changes actually
I forked your repo
doesn't that include those changes?
 
5:35 AM
@DannyBeckett No, it doesn't. I backed out those changes a long time ago, because PhantomJS 2.0 and Firefox don't need them.
 
ah right
 
 
the instructions are there for anyone to use, but I figured I wouldn't be using them again, so I took them out -- they actually cause bugs in newer browser JS engines
 
Reading interesting unix.SE questions =p
 
@DannyBeckett really, all you need to do is successfully build master.min.js, then paste in the several codeblocks I refer to here
I don't believe the order matters, but if it does, doing it in the order I gave in the instructions should work
 
5:38 AM
ok great
sorry, I was just cleaning up the server a bit
 
actually, crap
 
your scripts presume everything's in the same dir?
 
that very last codeblock involves a replacement of existing code... that might be a little complicated for you; let me whip that up real quick for you
 
I'm just using vim
 
@DannyBeckett my scripts presume that the following directories exist: ~/dev/SO-ChatBot and ~/dev/so-chatbot-driver
 
5:41 AM
maybe it's because it's almost 6am, but
$SCREENCMD java -jar so-chatbot-driver.jar -b master.min.js
master.min.js is in the same dir as so-chatbot-driver.jar?
this is how I have it atm:
 
@DannyBeckett it should be -- one of the scripts copies it to be
reloadpjs.sh does
 
ok that makes sense
 
here, make this the contents of your master.js -- gist.github.com/allquixotic/8252154
don't worry about minifying it for now, you can edit startpjs.sh to just run master.js
and put that copy of master.js from the url above into ~/dev/so-chatbot-driver/master.js
click view raw to make sure you get all the data at full fidelity
then Ctrl+A, CtrlC
 
ok got it
 
then paste into your editor
 
5:45 AM
and prepend?
or append?
oh
n/m
 
just replace the contents
:P
 
you did it for me :)
 
yeah, I did all the patching
just be sure not to run reload.sh, because it will wipe out the modified master.js -- ideally we'll get you running on PhantomJS 2.0 once you get it compiled for CentOS 6, and then you can not worry about the shims and just run master
 
vim's going crazy
 
compiling PhantomJS is pretty tricky though
 
5:47 AM
 
did you hit insert first before you started?
 
yeah
I
just gonna FTP it instead
 
there is some zalgo text in there
it will probably go pretty crazy on that
might even mess it up
!!zalgo THE HV HE COMES
 
@allquixotic T̴̞̼̘̬̝͚͇̜̲̦̣̠͎̀͑ͪ̈̔̊̓̓̉ͮ̕͟͟Ĥ̸̸̭̟͇̠͈̜̳̺̩̭̘̣̥̩̳͍̜̑̌ͮ̃͒̆̿̍ͤ̉̔̿͛͆̂ͣ̚Ę̸̢ͣͩ͑͛̈̏ͨͮ͟͟‌​̗͍̩̲̼̠̙͚͕̺̣̦͓̟̹̭ ͕̤͕͈̻͍̼͉̞̒ͭ̅̒͛ͧ̿ͫ̌ͮ͞H̢̟̹̰̺̘̣̗͇͉͓̬̹͕̪̅ͦ́͑̾ͫ̔̈́ͦ̒̍̈̏ͪ͌̚͢͠ͅͅͅV̶̧̢͉̦̟͕̝͍̟̿̉ͣͥ͒̚ ̸̻̫̗̣͇̞̹̯̰̯̙̰̤͈̫̤ͨ̃ͥͧͩͭ͊͛ͬͥͧ̅̀̄̈́ͣ̓́̚͘͟Ḫ̳̞̩̘̱̮̬̤̯͓͍̌ͦ̅ͥ̉ͣ̐̊̇͐ͪ̚͘͞͝E͋̍̎͆̅͋̈́̅̓ͮ͛̄̆‌​̷̢̨̱̥̗̦̗̮̙̥͌̓ͧ̔̍̚͞ ̡͎̤̭̮͓̯͍͌̿̍ͤ͛ͨͭ͆ͣͧ͆̈̊̆̐ͯ̊͗́́͠Ĉ̍̅̓̏̓̋ͤ̎̈́̃͑҉̷̳͍͇̠͈̺̳̝̪̱̩̞̖̮̼O̺̺̬̯̘̿ͯ̿̉̽̓̆͆̏͂ͤ̕͠ͅM‌​̵͗̂̐̐͏̺̘͓̯͓̬͖̦̱͇E̸ͭ͂́̊ͮ͆̐͑͌̏ͩ͛ͣ̀͘͡҉̘͚͉̘̜͉̦̼̭͕̦̦͖̘S̵͔̲̜̙͎̤̯̺̮͑ͨ͒̽͐͌̄̚͟͡
 
right that's uploaded
gonna edit startpjs now
done
 
5:50 AM
you should be able to use restart or start (the former is safer) to get it running, but when you want/need to modify the code of the bot (for instance, to pull from upstream), you'll have to re-apply the changes I made to master.js
 
which isn't hard, but the last part involves commenting out or deleting two lines of existing code and inserting some new ones
all that's left to do now is try it
 
[root@srv01 so-chatbot-driver]# ./restartpjs.sh
./restartpjs.sh: line 8: cd: /root/dev/so-chatbot-driver: No such file or directory
phantomjs: no process killed
java: no process killed
firefox: no process killed
./restartpjs.sh: line 12: cd: /root/dev: No such file or directory
[root@srv01 so-chatbot-driver]#
 
I can't think of anything that we've missed
 
ah cos I'm logged in as root
 
5:52 AM
you're still running as root...
 
lets try again
also need to move everything to ~/dev
-sh-4.1$ ./restartpjs.sh
phantomjs: no process killed
java: no process killed
firefox: no process killed
-sh-4.1$
 
Once you get it working, success, at least on the surface, should have the following symptoms: (1) no output or just kill complaining that it can't find any processes to kill; AND (2) java should still be running more than a few seconds after you run the script
like that, basically
now ps -ef | grep java
 
nope
:(
 
java -version?
 
-sh-4.1$ ps -ef | grep java
505      10170 10051  0 00:53 pts/0    00:00:00 grep java
-sh-4.1$ java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.4.el6_5-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
-sh-4.1$
 
5:54 AM
does ~/dev/so-chatbot-driver/so-chatbot-driver.jar exist?
if it's in the bin folder, copy it to ..
 
yeah it does
outside bin
 
ok, all the scripts that don't begin with the word start need to be in ~/dev itself
that's the way I've designed them
 
91
Q: What's the story behind Super Cow Powers?

derobertAs we know, apt-get has Super Cow Powers and aptitude does not: $ apt-get --help | grep -i cow This APT has Super Cow Powers. $ aptitude --help | grep -i cow This aptitude does not have Super Cow Powers. and of course, APT has an Easter egg to go with i...

 
the bottom line of startpjs is
$SCREENCMD java -jar so-chatbot-driver.jar -b master.js -c "http://chat.stackexchange.com/rooms/12036/aviation" -u "daniel.beckett+aviationbot@gmail.com" -p "xxxxx" -j
 
that looks correct
 
5:56 AM
ah ok I'll move them
they're in so-chatbot-driver
 
yeah, the scripts are just in the wrong dir
leave startpjs.sh where it is now
 
ah ok
funny
ok it's back to as before now
no proc killed - all good
 
if it doesn't work, you can always remove the screen wrapper and run the java command directly, by commenting out the line that sets SCREENCMD
 
still nothing in ps
 
that will run it synchronously on the console
you may get output to stdout from the program
 
5:59 AM
good idea
 
oh -- is your PhantomJS binary phantomjs on your $PATH?
you need to be able to start phantomjs by typing phantomjs in any directory
 
exception
 
the GhostDriver expects it to be on $PATH
 
exactly
 
you can put phantomjs (the binary) into /usr/bin
 
6:00 AM
-sh-4.1$ ./startpjs.sh
Arg processing finished; instantiating Driver object
Instantiating PhantomJSDriver
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the phantomjs.binary.path capability/system property/PATH variable; for more information, see github.com/ariya/phantomjs/wiki. The latest version can be downloaded from phantomjs.org/download.html
        at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
 
that will guarantee that it gets picked up
yeah, I figured
 
I'd like to keep it in /home/aviationbot/dev
just need to set PATH
one sec
 
I think if you append the argument -Dphantomjs.binary.path=/home/aviationbot/dev/phantomjs to the java invocation, it'll work
I don't set that variable in my code at all, which means that you can override it
the -D.... argument should go before the -jar argument though :P
 
ok even better
 
maybe I should've said prepend
 
6:03 AM
since I'm struggling to set the path var
 
yeah, don't worry about PATH; you can tell Java to set a system property with the -D argument, but you have to make sure that it gets passed to the Java runtime and not to my code, by supplying -Dblahblahblah before -jar
$SCREENCMD java -Dphantomjs.binary.path=/home/aviationbot/dev/phantomjs -jar so-chatbot-driver.jar -b master.js -c "http://chat.stackexchange.com/rooms/12036/aviation" -u "daniel.beckett+aviationbot@gmail.com" -p "xxxxx" -j
 
$SCREENCMD java -Dphantomjs.binary.path=/home/aviationbot/dev/phantomjs-1.9.2-linux-x86_64/bin/phantomjs -jar so-chatbot-driver.jar .....
 
yeah, whatever works
 
looks much better now
it's doing something
ok logged in
:)
 
you can probably Ctrl+C and uncomment the SCREENCMD now and let it run
 
6:06 AM
oh it died
 
oh?
 
hit an exception after auth
 
well, let's see it
 
bad xpath
here's it scrolled up a bit:
 
yikes. and you login with this account using this method?
 
6:09 AM
yeah
I just created the account a couple of hours ago
 
try running it again (still with SCREENCMD commented out) and see if it works -- if the login worked the first time but it hit a weird exception, it should notice the second time that it's already logged in (cookie), and skip the login step
 
the cookies and HTML5 storage are stored in ~/.local somewhere
 
> Crap. We need to login
 
6:11 AM
I see it showing up in the user list over on aviation
 
ok, so this time I ran restartpjs and got this output
> ERROR - blah blah.... Sweet! We're logged in!
 
@DannyBeckett Sweet! We're logged in! -- authentication is no longer a problem you will be seeing
 
the error is that master.js is in the wrong place, apparently
 
:S
aint moved it
 
6:13 AM
is master.js in ~/dev/so-chatbot-driver ?
 
!!no
 
no it's in the original SO-ChatBot folder
 
29 mins ago, by allquixotic
and put that copy of master.js from the url above into ~/dev/so-chatbot-driver/master.js
 
6:14 AM
damnit, must've missed that
 
so: cp -f ~/dev/SO-ChatBot/master.js ~/dev/so-chatbot-driver
 
I did mv master.js master.js.original
then copied it there
ok
lets try again
 
!!help no
 
@allquixotic no: User-taught command: <>http://i.stack.imgur.com/M0Ngk.png
 
logging in..
hmmmmmm
zalgo
 
6:16 AM
SR4 is.... wierd
 
@JourneymanGeek ya
 
@JourneymanGeek Saints Row 4?
 
fun tho
yeah
 
@DannyBeckett I guess it spewed the entire contents of the master.js file, but not sure why it decided to "shut down" >>
 
@JourneymanGeek yeah you're right... really different to #3
 
6:17 AM
I do wonder if they'll make another sequel. its pretty damned hard to outwierd.
 
try this: ./restartpjs.sh >& output.txt
 
@allquixotic gonna print the wholeout to a file
 
then pastebin or gist the output.txt
............yeah
 
@DannyBeckett: the super-powers totally broke the need to ever drive
 
6:18 AM
@JourneymanGeek except in quests, where they pretend that vehicles are somehow more useful than going around on foot with superpowers
 
which is silly because you can be killed by staying in an exploding vehicle
but you can walk away from a heavy knock by an enemy and be fine
 
and the alien weapons are better at the start of the game
until you get unlimited ammo, in which case oldschool guns outclass em
 
i loved the automatic shotgun
 
I'm a handgun/rifle guy
 
6:19 AM
 
I also tend to try to headcap tho
 
you can kill those annoying spinning/jumping boss lava golems with like 3 shots from the auto shotgun
 
wtf... looks like it's a problem with those manual fixes?
org.openqa.selenium.WebDriverException: Error Message => ''undefined' is not a function (evaluating 'call.bind(prototypeOfObject.hasOwnProperty)')'
 
freeze. RPG. Rinse and repeat
and freeze is kinda borkedly powerful
 
6:21 AM
@DannyBeckett yeah, that's what I'm reading, too
did I do it wrong?? checking..
 
gonna double check I used the right master.js
think I did
 
and loved the parodies ;p
hiding in a box and 'romance' ;p
was hillarious
 
you did
I did it wrong, and the readme seems to be out of date. frick. sorry about that
 
np @allquixotic
you've helped me a lot tonight, and I've screwed up once or twice too ;)
.....does the bot user normally stay logged in to the room after it dies?
just going for a quick smoke, brb
 
@DannyBeckett here, I did it as a patch, this way you can actually apply it when you grab new code from upstream, too (it should apply)
what you do is download that file (the raw version, not the formatted version) to something like pjs19.patch. Put the file in ~/dev/SO-ChatBot. Then run git apply pjs19.patch
if you ever want to pull fresh code from git, do git stash && git pull && git apply pjs19.patch
Step 2: Since master.js is no longer being modified, edit ~/dev/so-chatbot-driver/startpjs.sh to replace "master.js" with "master.min.js"
then to try the fix, run cd ~/dev; ./reloadpjs.sh
 
6:34 AM
ok..
ok it's logging in again
 
cool
 
woohoo!
hehehe, it works! :D
so moving forwards, in terms of keeping everything up to date...
 
@DannyBeckett try to avoid using !!eval or !!>; it won't necessarily crash the bot, but it can't be good for it by confusing it that badly
 
the git stash && git pull && git apply pjs19.patch command will take care of everything?
+ reload
and when Phantom 2 is released, reconfigure
 
moving forwards, my first goal in your shoes would be to get vitallium's phantomjs-qt5 repository ("PhantomJS 2.0 Technology Preview" a.k.a. beta) built for CentOS 6.4, and then forget about and drop the 1.9 patch
also, since your git remote for SO-ChatBot is my repository, you'll only receive changes from Zirak either (1) when I merge his repository into mine, which is about weekly; or (2) when you run git pull https://github.com/Zirak/SO-ChatBot (if you need/want a specific commit)
 
6:40 AM
ok fantastic
 
once you perform any git pull command, from my repo or his, as long as you run PhantomJS 1.9, you need to run the git stash && git pull && git apply pjs19.patch sequence
 
just gonna bring down the bot and put it in screen mode
 
yeah, uncomment SCREENCMD and re-start it
 
done
waiting for it to come back up
 
if the stability is particularly horrible, that's just even more motivation to run PhantomJS 2.0, which is reasonably stable in my testing
even running it under Firefox it eventually dies because the websocket or something hiccups, so you might want to run a cron job or something that automatically restarts it every 48 hours or something
although I've seen it remain up without a crash for 3 weeks before
 
6:42 AM
ok good to know
just so I've got the .sh file saved, from ~/dev, this is correct, right?
cd SO-ChatBot && git stash && git pull && git apply pjs19.patch && ../restartpjs.sh
 
yes
no
!! s/restart/reload/
 
@allquixotic cd SO-ChatBot && git stash && git pull && git apply pjs19.patch && ../reloadpjs.sh (source)
 
ah shit thx
 
the reload just runs node build.js again
 
ok good stuff
 
6:44 AM
gotta amalgamate master.js and master.min.js from the source files when you change anything under source
(which is what reloadpjs.sh does)
 
 
2 hours later…
@Bob Bauhn?
 
Bob
@Boris_yo Aldi.
 
@Bob I would by only from brands. Nexus 4 is my next purchase.
 
Bob
@Boris_yo Aldi is a pretty big store.
(understatement of the century)
Sure, the phone is probably a rebadged Chinese cheapie.
But buying from Aldi would guarantee at least some support.
 
@Bob Problem but at least you have local warranty, unlike buying directly from chinese websites and hope for best.
 
Bob
8:57 AM
e.g. at least one year warranty by Australian law
@Boris_yo they also have a 60-day no questions asked return policy
I might pick one up just to play with, and keep if it's good
 

« first day (1247 days earlier)      last day (3775 days later) »