Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <arpa/inet.h>
int main(void) {
struct addrinfo* res = NULL;
getaddrinfo("google.com", "443", 0, &res);
eyberg@venus:~/rr/rtest$ ops run target/debug/rtest
running local instance
booting /home/eyberg/.ops/images/rtest ...
en1: assigned 10.0.2.15
en1: assigned FE80::DCBF:CDFF:FEB4:8BB2
{
"origin": "191.96.255.108",
}
eyberg@venus:~/rr/rtest$ cat src/main.rs
eyberg@s1:~/w$ cat nil.c
#include <stdio.h>
int main() {
int *bob = (int *)0x0;
*bob = 42;
printf("Value: %d\n", *bob);
int *tom;
#include <stdio.h>
#include <string.h>
int vuln(char* src) {
int admin = 0;
char buf[2];
strcpy(buf, src);
printf("%d\n", admin);
--- a/src/unix/syscall.c
+++ b/src/unix/syscall.c
@@ -303,6 +303,7 @@ sysreturn readv(int fd, struct iovec *iov, int iovcnt)
sysreturn write(int fd, u8 *body, bytes length)
{
+ return 0;
if (!validate_user_memory(body, length, false))
return -EFAULT;
fdesc f = resolve_fd(current->p, fd);
package main
import (
"fmt"
"net/http"
)
func main() {
fmt.Println("just a test")
eyberg@box:~/rtest$ cat hi.rs
fn main() {
println!("Hello, world!");
}
eyberg@box:~/rtest$ cat config.json
{
"Args": ["hi.wasm"],
"Files": ["hi.wasm"]
}
eyberg@s1:~/r$ cat config.json
{
"files":["hi.r"],
"Args":["hi.r", "--args", "hello","you"]
}
eyberg@s1:~/r$ ops pkg load R_3.4.4 -c config.json
booting /home/eyberg/.ops/images/R ...
en1: assigned 10.0.2.15
[1] "hello you"
➜ r ops pkg load R_3.4.4 -c config.json -a hi.r
booting /Users/eyberg/.ops/images/R ...
en1: assigned 10.0.2.15
[1] "Hello World!"
Warning message:
system call failed: Function not implemented
exit status 1
➜ r cat config.json
{
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to my website!")