This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"golang.org/x/sys/unix" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eyberg@s1:~/w$ cat nil.c | |
#include <stdio.h> | |
int main() { | |
int *bob = (int *)0x0; | |
*bob = 42; | |
printf("Value: %d\n", *bob); | |
int *tom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
int vuln(char* src) { | |
int admin = 0; | |
char buf[2]; | |
strcpy(buf, src); | |
printf("%d\n", admin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
fmt.Println("just a test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eyberg@box:~/rtest$ cat hi.rs | |
fn main() { | |
println!("Hello, world!"); | |
} | |
eyberg@box:~/rtest$ cat config.json | |
{ | |
"Args": ["hi.wasm"], | |
"Files": ["hi.wasm"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ 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 | |
{ |
NewerOlder