About Archive Tags RSS Feed

 

Entries tagged mozjs

A heady mixture of photography and programming

29 May 2012 21:50

The past few weeks have consisted of a heady mixture of taking interesting pictures of cute people, and writing code.

I spent a while getting to grips with seccomp filters, using the facilities present in recent GNU/Linux Kernels to filter system calls binaries are allowed to make.

My initial test was to patch GNU Less to only allow it to open, read, and close files. The side-effect of this was that the built in shell-escape was closed, thus allowing me to test it.

After that I toyed around with interfacing with spidermonkey|seamonkey. In this regard I was less succesful, but I did manage to write code in C that would invoke javascript functions loaded dynamically. Similarly I could call from my (loaded) javascript code into functions defined in C.

I don't have a use for a Javascript to/from C bridge, but I'm sure that time will come.

Photography has been a constant distraction, I took some fun shots of the Edinburgh Marathon, and then distracted myself with a volunteer to take an abstract fishnet photograph. We went on to do some more fun shots begin careful to stay on the safe side of the NSFW limit. I think this is borderline NSFW, but we were both clear exactly what we wanted and we got it perfectly there.

Next week will be quieter, but providing we don't have another mini-heatwave in Edinburgh I'll be cheerful regardless.

ObQuote: One, two, Freddy's coming for you. - A Nightmare on Elm Street (original)

| No comments

 

I've posted my javascript stuff

1 June 2012 21:50

I previously mentioned some work I'd done with mixing Javascript & C.

The code is now visible here:

This consists of a binary which allows you to run javascript files, those javascript files have some extra methods available to them, allowing this sample file to execute and do things:

  • Fetch a web-page with curl.
  • Connect to a locally running memcached server.
  • Parse command line arguments.

Not great work, but still a useful exercise.

ObQuote: "Please! I don't wanna go back there, you don't know what it's like to be treated as a freak!" - Shrek

| 2 comments