« first day (3331 days earlier)      last day (1608 days later) » 

12:02 AM
@Wietbot listcommands
 
evalJs, evalGroovy, evalKotlin, evalNode, listCommands, join, leave, shutdown
 
@Wietbot evalNode 1 + 2
 
3
 
@Wietbot evalNode process.exit()
 
me.wietlol.aws.lambda.LambdaException(Runtime.ExitError: RequestId: 2c190495-6e75-40aa-927b-5ae751f29c60 Error: Runtime exited without providing a reason[])
 
12:05 AM
@Wietbot evalNode "but I am still working"
 
but I am still working
 
@JBis ^
security++
just let it crash
lets go through the Test My Bot logs
@Wietbot evalNode const foo = require('exec')
 
{"code":"MODULE_NOT_FOUND","requireStack":["/var/task/handler.js","/var/runtime/UserFunction.js","/var/runtime/index.js"]}
 
@Wietbot evalNode const foo = require('child_process')
oh ye, same message
@Wietbot evalNode const config = require('../../platform/StackExchange/config.example.json'); console.log(config.plugins)
 
{"code":"MODULE_NOT_FOUND","requireStack":["/var/task/handler.js","/var/runtime/UserFunction.js","/var/runtime/index.js"]}
 
12:11 AM
@Wietbot evalnode const fs = require('fs')
@Wietbot evalnode module
 
{"code":"MODULE_NOT_FOUND","requireStack":["/var/task/handler.js","/var/runtime/UserFunction.js","/var/runtime/index.js"]}
me.wietlol.aws.lambda.LambdaException(Runtime.UnhandledPromiseRejection: Error: Unable to stringify response body[])
 
okay
@Wietbot evalnode module.parent
 
me.wietlol.aws.lambda.LambdaException(Runtime.UnhandledPromiseRejection: Error: Unable to stringify response body[])
 
@Wietbot evalnode {}
@Wietbot evalnode 1 + 2
 
3
 
12:14 AM
@Wietbot evalnode {}
@Wietbot evalnode {}
@Wietbot evalnode (() => {}).toString()
 
() => {}
 
@Wietbot evalnode {}
@Wietbot evalnode console.log(2)
 
Result: undefined
Output:
2
 
@Wietbot evalnode {}
 
@Wietbot evalNode Array(1e9).fill(0)
 
12:23 AM
me.wietlol.aws.lambda.LambdaException(unknown: 2019-11-29T00:23:32.723Z 5ecafc24-ef01-4d03-8981-9607ec220954 Task timed out after 10.00 seconds[])
 
> if (result === "")
return {result: "<empty result>"};
 
@Wietbot evalNode return 5
 
{}
 
why the heck doesnt this work?
 
@Wietlol if you get it working I can implement into my bot
 
12:24 AM
what?
get what working?
on a side note... I understand what the undefined;\n prefix is
if your code is empty, it will at least say "undefined"
@Wietbot evalnode ""
 
<empty result>
 
@Wietbot evalnode
oh wait, that was SO chat preventing double messages
@Wietbot evalnode
 
<empty result>
 
I suppose this works too
@Wietbot evalnode return 4
 
{}
 
12:30 AM
@Wietbot evalnode console.log(5); 6
 
Result: 6
Output:
5
 
@Wietbot shutdown
 
laytar
 
@Wietbot ohai
 
ohai
 
12:32 AM
next up: C#
 
 
2 hours later…
2:08 AM
me.wietlol.aws.lambda.LambdaException(LambdaException: Could not find the LambdaSerializerAttribute on the assembly 'Core' or method 'EvalCSharpPrivate' while attempting to deserialize input data of type 'Core.Api.Models.EvalRequest'. To use types other than System.IO.Stream as input/output parameters, the assembly or Lambda function should be annotated with Amazon.Lambda.LambdaSerializerAttribute.[])
me.wietlol.aws.lambda.LambdaException(unknown: 2019-11-29T02:12:59.837Z e757d604-1d38-4924-8a48-ab7edeba18a6 Task timed out after 10.01 seconds[])
me.wietlol.aws.lambda.LambdaException(AggregateException: One or more errors occurred. (Attempt by method 'Submission#0..ctor(System.Object[])' to access type '<>f__AnonymousType0`1<System.IO.TextWriter>' failed.)[
at at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification),
at at lambda_method(Closure , Stream , Stream , LambdaContextInternal ),
TypeAccessException: Attempt by method 'Submission#0..ctor(System.Object[])' to access type '<>f__AnonymousType0`1<System.IO.TextWriter>' failed.[
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException(Unrecognized field "Result" (class me.wietlol.wietbot.commands.evalcsharp.core.api.models.EvalResponse), not marked as ignorable (one known property: "result"])
at [Source: (byte[])"{"Result":"Hello from Dotnet"}"; line: 1, column: 12] (through reference chain: me.wietlol.wietbot.commands.evalcsharp.core.api.models.EvalResponse["Result"]))
 
2:25 AM
great...
 
Hello from Dotnet
 
@Wietbot shutdown
 
laytar
ohai
 
@Wietbot evalcsharp Environment.Exit(0);
 
me.wietlol.aws.lambda.LambdaException(AggregateException: One or more errors occurred. ((1,1): error CS0103: The name 'Environment' does not exist in the current context)[
at at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification),
at at lambda_method(Closure , Stream , Stream , LambdaContextInternal ),
CompilationErrorException: (1,1): error CS0103: The name 'Environment' does not exist in the current context[
at at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter),
 
2:34 AM
@Wietbot evalcsharp Environment.Exit(0);
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0103: The name 'Environment' does not exist in the current context)
 
@Wietbot evalcsharp System.Environment.Exit(0);
 
me.wietlol.aws.lambda.LambdaException(unknown: RequestId: 1efd6fba-3b91-456c-98d0-0e823cacb2a3 Process exited before completing request[])
 
that will do
@Wietbot listcommands
 
evalJs, evalGroovy, evalKotlin, evalNode, evalCSharp, listCommands, join, leave, shutdown
 
2:48 AM
@Wietbot evaljs "ok"
 
ok
 
3:35 AM
!~google meow
!~google meoww
[Meoww - YouTube]
https://www.youtube.com/watch?v=pKepCKNwEq8
Apr 19, 2013 ... Published on Apr 19, 2013. Category. People & Blogs. Loading... Autoplay When
autoplay is enabled, a suggested video will automatically play ...
[Susie Meoww (@susiemeoww) • Instagram photos and videos]
https://www.instagram.com/susiemeoww/?hl=en
376.8k Followers, 996 Following, 563 Posts - See Instagram photos and videos
from Susie Meoww (@susiemeoww)
27imdb 31developer.mozilla.org 33msdn 50xkcd 51youtube
!~imdb terminator
[Terminator: Dark Fate (2019) - IMDb]
https://www.imdb.com/title/tt6450804/
An augmented human and Sarah Connor must stop an advanced liquid
Terminator, from hunting down a young girl, who's fate is critical to the human
race.
[The Terminator (1984) - IMDb]
https://www.imdb.com/title/tt0088247/
Arnold Schwarzenegger and Marianne Muellerleile in The Terminator (1984) ...
in The Terminator (1984) James Cameron and Linda Hamilton in The Terminator
...
!~msdn 千與千尋
@nyconing Something went on fire; status undefined
!~imdb 千與千尋
[Spirited Away (2001) - IMDb]
https://www.imdb.com/title/tt0245429/
Directed by Hayao Miyazaki. With Daveigh Chase, Suzanne Pleshette, Miyu Irino
, Rumi Hiiragi. During her family's move to the suburbs, a sullen 10-year-old girl ...
!~mdn run
@nyconing Could not process input. Error: msg is not defined
!~mdn run
[Loading and running WebAssembly code - WebAssembly | MDN]
https://developer.mozilla.org/en-US/docs/WebAssembly/Loading_and_running
Mar 23, 2019 ... To use WebAssembly in JavaScript, you first need to pull your module into
memory before compilation/instantiation. This article provides a ...
 
4:08 AM
!~xkcd latest
@nyconing Could not process input. Error: args is not defined
!~xkcd latest
[Getting the most recent comic - xkcd]
http://forums.xkcd.com/viewtopic.php?t=3095
Mar 14, 2007 ... If you need to access it from another page with JavaScript, there is a JSONP
proxy at http://dynamic.xkcd.com/api-0/jsonp/comic/ for the latest ...
!~xkcd
Access to XMLHttpRequest at 'https://dynamic.xkcd.com/api-0/jsonp/comicsource=bot' from origin 'https://chat.stackoverflow.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
!~XKCD
!~xkcd
!~xkcd 2233
!~xkcd aurora by latitude
[xkcd: How To Deliver Christmas Presents]
https://xkcd.com/
... Deliver Christmas Presents · |< · < Prev · Random; Next >; >|. Permanent link to
this comic: https://xkcd.com/2234/ Image URL (for hotlinking/embedding): ...
!~youtube ligfsuigldvfbhijlgviuersdfgv
@nyconing Google Fu is rest, try again later
!~youtube terminator trailer
!~ google ilygrefvilyuhberiughfwefqwasdc
@nyconing Google Fu was unable to woooo-OOO-wahhh!
!~youtube otomen
!~xkcd
!~imdb frozen 2
[Frozen II (2019) - IMDb]
https://www.imdb.com/title/tt4520988/
Kristen Bell and Idina Menzel in Frozen II (2019) Idina Menzel in Frozen II (2019)
Sterling K. Brown at an event for Frozen II (2019) Idina Menzel at an event for ...
!~msdn task.run
[Run an async task in a console app and return a result – Http Client ...]
https://blogs.msdn.microsoft.com/jpsanders/2016/10/07/run-an-async-task-in-a-console-app-and-return-a-result/
Oct 7, 2016 ... I had someone ask how to run an async task in Main of a console app. Yes there
are different ways to do it and this is just one! using System ...
!~>good ironman give you some treats later
@nyconing good ironman give you some treats later
 
4:45 AM
google charge me rm2.5cent per search :(
!~cowsay iron man
 _________
< iron man >
 ---------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
!~define niubility
!~define niubility
@nyconing My pocket dictionary just isn't good enough for you.
!~define standard
@nyconing standard Falling within an accepted range of size, amount, power, quality, etc.
!~doge
   wow
           many fail
                      so user
much pro
!~stat
@nyconing You (https://stackoverflow.com/users/5858238/nyconing) have 762 reputation, earned 0 rep today, asked 9 questions, gave 23 answers, for a q:a ratio of 9:23.
avg. rep/post: 23.81. Badges: 0g 7s 27b
!~urban niubility
 
 
3 hours later…
8:22 AM
@Wietbot listcommands
 
evalJs, evalGroovy, evalKotlin, evalNode, evalCSharp, listCommands, join, leave, shutdown
 
^ only evalGroovy wont do stuff
and only I have permissions for shutdown
(intent to be used when Madara starts breaking my bot)
 
@Wietbot evalNode const exec = require('child_process').execSync; const result = exec("whoami", {encoding: "utf-8"}); console.log(result);
 
Result: undefined
Output:
sbx_user1051
 
8:28 AM
well... that works
 
Doesn't help me with anything though...
@Wietbot evalNode const exec = require('child_process').execSync; const result = exec("ping -c 1 216.58.211.110", {encoding: "utf-8"}); console.log(result);
 
{"status":127,"signal":null,"output":[null,"","/bin/sh: ping: command not found\n"],"pid":21,"stdout":"","stderr":"/bin/sh: ping: command not found\n"}
 
Oh nice, it runs sh
How about this then?
@Wietbot evalNode const exec = require('child_process').execSync; const result = exec("bash -c 'ping -c 1 216.58.211.110'", {encoding: "utf-8"}); console.log(result);
 
{"status":127,"signal":null,"output":[null,"","bash: ping: command not found\n"],"pid":22,"stdout":"","stderr":"bash: ping: command not found\n"}
 
that is sad
I expected a different error
 
8:30 AM
Yeah I want to see if I can get network access for some reason
Probably doesn't have a package manager installed either, I guess?
 
ye, network access should be impossible, because it has no network connection
but it looks like ping doesnt exist
@Wietbot evalnode const https = require('https');
https.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY', (resp) => {
let data = '';

// A chunk of data has been recieved.
resp.on('data', (chunk) => {
data += chunk;
});

// The whole response has been received. Print out the result.
resp.on('end', () => {
console.log(JSON.parse(data).explanation);
});

}).on("error", (err) => {
console.log("Error: " + err.message);
});
 
{}
 
thank you, that is helpful
@geisterfurz007Stopthischaos pls make async available
or find out how to do a blocking call
@Wietbot evalcsharp "starting up"
 
starting up
 
@Wietbot evalNode const https = require("https");
const response = await https.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY');
 
8:35 AM
{}
 
that doesn't work, does it?
because await is used outside of an async block?
what?!
 
it appears it worked
 
It should have failed, no?
 
@Wietbot evalcsharp new System.Net.Http.HttpClient().GetAsync("https://google.com/");
 
@Wietbot evalNode const https = require("https");
const response = await https.get('api.nasa.gov/planetary/…');
response;
 
8:36 AM
{}
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,16): error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?))
 
-_-
@Wietbot evalnode const x = 5;
 
<empty result>
 
well, there is that too
same as return
@Wietbot evalnode return 5
 
{}
 
if you can make that work, go ahead :D
 
(return in eval doesnt really work nicely)
 
@Wietbot evalnode undefined; return 5
 
{}
 
@Wietbot evalnode () => { return 5 } ()
 
8:38 AM
{}
 
huh?
shouldnt that work fine?
@Wietbot evalnode (() => { return 5; })()
 
<empty result>
 
> (() => {foo: 1})() // this will return undefined. 'foo: 1' is interpreted as a statement composed of a label and the literal 1.
 
@Wietbot evalNode (() => 5)()
 
<empty result>
 
that is odd
 
@geisterfurz007Stopthischaos 5 Logged: ``
 
Interesting!
eval does return 5 so you messed it up <.<
 
I guess so
ah, I know
if (typeof result === "string")
    return result
else
    return JSON.stringify(result)
@Wietbot evalNode (() => 5)() + ""
 
8:44 AM
5
 
@Wietbot evalNode (() => { return 5; })() + ""
slowpoke?
oh wait, SO chat again
result: 5
not sure how to fix that nicely
I dont want to reply to your message because that will ping non stop basically
I suppose I could do it and expect people to turn off notifications if they like
@geisterfurz007Stopthischaos do you know how to improve that X to string logic?
 
that X to string logic?
 
2 mins ago, by Wietlol
if (typeof result === "string")
    return result
else
    return JSON.stringify(result)
 
Just always JSON stringify it?
 
this way, you get results like this: {"status":127,"signal":null,"output":[null,"","bash: ping: command not found\n"],"pid":22,"stdout":"","stderr":"bash: ping: command not found\n"}
 
8:47 AM
@Wietbot evalNode (JSON.stringify("some string") === "some string") + ""
 
<empty result>
 
but I think this one also breaks 5
 
@Wietbot evalnode JSON.stringify(5) + ""
 
false
5
 
8:48 AM
Oh right, nvm
 
@Wietbot evalnode JSON.stringify(1) + ""
 
1
 
@Wietbot evalnode JSON.stringify(0) + ""
 
0
 
@Wietbot evalnode JSON.stringify(false)
 
8:49 AM
false
 
@Wietbot evalnode false
 
<empty result>
 
uhm....
that is odd
 
What's the code on the lambda end?
 
8:55 AM
approximately this
in JavaScript, 10 hours ago, by Wietlol
exports.handler = async function(event, context) {
    const console = {
        _items: [],
        log: function () {
            console._items.push.apply(console._items, Array.from(arguments).map(e => JSON.stringify(e)));
        }
    };
    console.error = console.info = console.debug = console.log;


    let result = exec(event.code);


    let stdOut = console._items.reduce((l, r) => l + "\r\n" + r);
    if (stdOut === "")
        return {result};
    else
        return {result: `Result: ${result}\r\nOutput\r\n${stdOut}`};
exec is basically eval inside a try catch and then trying to convert the result to a string
@Wietbot evalnode {result: JSON.stringify(5)}
 
5
 
that is... weird
I have no clue how this works
it is JS
 
console._item.join("\r\n") is easier to read btw
Or is that to get around an edge case?
 
oh ye, that is what I use now too
 
8:59 AM
@Wietlol How is that used then?
 
const items = [];
console.log = (obj) => items.push(obj);
const stdOut = items.join("\r\n");
something like that
 

« first day (3331 days earlier)      last day (1608 days later) »