Hacker Newsnew | past | comments | ask | show | jobs | submit | nosir33's commentslogin


That was the blog I was looking for. Thanks.


Maybe I missed it. What's the security connection here?


I think this is great. The page is basically a markdown viewer and the link has markdown encoded in it. If you pass the URL through a URL shortener, then the URL shortener is effectively hosting the content of your page. It would be cool if this was static HTML and the markdown was rendered in JS.


This one has a WYSIWYG editor and renders the markdown using only javascript. All content is in the URL and isn't even sent to the server.

http://jbt.github.io/markdown-editor/#bVPBTtwwEL37KwYt0u6W3a...

With source code: https://github.com/jbt/markdown-editor


Nice! Uses compression as well, I see.

Would be super cool if the URL encoding schemes of these two sites were compatible!

OTH, I'm guessing the markdown-editor "site" cannot be searched.

Here is the result for the Google search of channelurl.com for "bird" / http://www.google.ca/cse?q=bird&cx=partner-pub-1886386989888...

Kind of fun that way too!


One of the initial challenges I see from an OPS perspective is that the most recent logs are often the most interesting. The latency of the logs being ingested into a DB would prevent me from using the DB. Generally, I find my self grepping logs on the prod servers.


I don't know of any systems that do this.

As an software developer, I generally use log levels to indicate severity in my logs. So grepping for ERROR should catch anything I had the foresight to log at the ERROR level.

Simple heuristics like the number of WARN level logs a minute may be useful.

Beyond that it sounds interesting. It may be hard to do in a general way, so focusing on Apache logs or something common may be a simpler task.


In addition to logging, you can send out a statsd[0] message, graph it, and use something like Skyline[1] for alerting based on trend issues. You can also use logstash to generate metrics on logs when sending them up to Elasticsearch.

[0] https://github.com/etsy/statsd [1] https://github.com/etsy/skyline


Excellent sample projects, especially Skyline. This seems the closest thing to what I had envisioned sofar.

Very cool stuff. Do you use it?


Skyline was a bit too much overhead, but we took the concept and adapted it to our needs.

When I say too much overhead, I'm referring to the carbon proxy and redis requirements. We found that just using the json output from graphite was sufficient to feed a trend monitoring system.

The output is pretty sensitive, moreso than Icinga2 (Nagios) expects, so we had to turn down a few of the "is this really down" re-checks, since it would silence legitimate trend alerts.


> That's a lot more information than you could get from a binary log without any tools.

The environment I work in I am frequently looking at logs that other teams generate. If I needed to ramp up on their custom logging toolset just to perform simple queries I am going to give up and waste the the teams time by getting them to perform the queries for me.


Sample code to execute some Javascript code inside PyPy.js. I couldn't find any examples.

    import js
    js.eval("console.log(\"hi!\")")


It's a bit messy, but:

    js.eval('var div = document.createElement("div"); div.style.width = "100px"; div.style.height = "100px"; div.style.background = "red"; div.style.color = "white"; div.innerHTML = "Hello"; document.body.appendChild(div);');
manages to append a div.

--

Directly modifying document.body.innerHTML in any way seems to hang it. Both:

    js.eval('document.body.innerHTML += "<div></div>";');
    js.globals.document.body.innerHTML += "<div></div>"
Cause it to hang, though the javascript console shows it was added (or using an img tag instead).

(ChromeOS v43 beta)


It's more fun doing this, since jQuery is already on the page:

    import js
    jq = js.eval("$")
    first_line = jq(jq(".container p")[0])
    first_line.text("jQuery was here")


Just playing around:

    import js
    c = js.globals.document.createElement("canvas")
    js.globals.document.body.appendChild(c)
    ctx = c.getContext("2d")
    ctx.fillRect(10, 10, 10, 10)
Edit: Here is a simple animation:

    import js
    import math
    import time
    c = js.globals.document.createElement("canvas")
    js.globals.document.body.appendChild(c)
    ctx = c.getContext("2d")
    
    def render():
      ctx.clearRect(0, 0, c.width, c.height)
      t = time.time()
      ctx.fillRect(20+math.sin(t*10)*10, 20+math.cos(t*10)*10, 10, 10)
    
    js.globals.window.setInterval(render, 20)
Here's a version you can paste in properly: http://pastebin.com/raw.php?i=67GadSUV


Sadly, if I paste that in, I get:

    >>> import js 
    ... c = js.globals.document.createElement("canvas") 
    ... 
    debug: OperationError:
    debug:  operror-type: SyntaxError
    debug:  operror-value: ('EOL while scanning string literal', ('c callback', 1, 12, "r = c.push('import js\n", 0))
    debug: OperationError:
    debug:  operror-type: KeyError
    debug:  operror-value: 'r'
And then the input window hangs. Strangely enough, if I type it in instead, it's okay.

(ChromeOS v43 beta-channel)


I think the only way around it is to paste each line separately. It seems to be caused by newline characters in the wrong place


'that' refers to

    import js
    c = js.globals.document.createElement("canvas")
and not the pastebin. The pastebin works for me, but only the first time. Subsequent runs result in:

    <RuntimeError object at 0x15d648>
    RPython traceback:
      ...
    Fatal RPython error:


Or this:

    import js
    js.globals.console.log('hi!')


I'm loving this, my head is reeling with the glint of possibilities

    import js
    js.globals.console.log('hi!'*5)


Seems to be some issues with the interop still, eg:

  import js
  >>> "globals" in dir(js)
  True
  >>> "console" in dir(js.globals)
  False
  >>> js
  <module 'js' (built-in)>
  >>> js.globals.console
  <js.Object handle=14>
So apparently introspection doesn't quite work with the wrapped js. Also, if you try: "[ i for i in js.globals]" (or equivalently iterate/loop over the globals-object) - the whole repl/tab hangs.

Not really an issue for running business logic in the browser, but if this was a full python repl-interface (with ipython support!) to the whole browser DOM -- that'd be a fantastic tool.


The introspection bit is because js.globals is implemented with a fancy __getattr__ but doesn't have a __dir__. In general, dir() is not reliable in the face of custom __getattr__ implementations unless the implementor goes out of the way to make it work.


Oh, right. I didn't consider that:

  Welcome to PyPy.js!
  >>> import js
  >>> "console" in js.globals
  True
  >>> "console" in dir(js.globals)
  False


It would be good if they could support a common api with brython, which has "import web" and some other bits...

I guess these things will take a while to shake out, but I'd imagine a python-in-browser-api PEP at some point.


You are visiting this page because we detected an unsupported browser. Your browser does not support security features that we require. We highly recommend that you update your browser. If you believe you have arrived here in error, please contact us. Be sure to include your browser version.


I encounter those types of messages a lot due to my unusual and changing user-agent. My usual response is to click the back button since I can usually find the information on another site.


What browser are you using?


Same issue here.

Google Chrome Version 42.0.2311.135 m on Windows 7 64bit


In terms of alternatives, AWS WorkDocs provides data storage in Ireland (and the US, Singapore and Australia).


But since Amazon has offices in the USA, the NSA considers all AWS hosted data in whatever country the Amazon operated data center is located in, to be under US jurisdiction.

I had a client who pulled all their (encrypted) data off the Ninefold cloud (Ninefold were at the time a fully Australian owned and hosted company) when they leased data center space and opened an office in CA – due to data sovereignty concerns.


Isn't Dropbox also entirely aws-hosted?


Yep, and has exactly the same "company officers residing in the US" exposure to the NSA and any of the agencies fighting the war on [drugs|terrorism|pedos|political-rivals] getting closed or open court warrants with or without gag orders.

In fact Dropbox is doubly at risk, law enforcement or national security could target either (or both) Dropbox themselves - go straight to Amazon to get access at hypervisor level to their entire infrastructure.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: