Skip to content

Instantly share code, notes, and snippets.

View retpolanne's full-sized avatar
🏳️‍⚧️

Anne Isabelle "Anya" Macedo retpolanne

🏳️‍⚧️
View GitHub Profile
@retpolanne
retpolanne / bind.c
Created February 22, 2019 23:53
Code for binding a port and spawning a shell
#include <unistd.h>
#include <stdlib.h>
#include <netinet/in.h>
void main() {
int sock = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
@retpolanne
retpolanne / node.go
Created February 22, 2019 23:25
The first code I've ever written in Golang :).
package main
import (
"fmt"
)
type Node struct {
Data int
Next_node *Node
}
@retpolanne
retpolanne / batman_vs_snowwhite.js
Created January 4, 2019 00:27
Wow.... I found the first code I've written, back in 2012, thanks to Codecademy.
var confirm1;
confirm1 = confirm("Are you ready to play?");
if(confirm1===true){
var age = prompt("how old are you?");
if (age < 18){
console.log("you are not old enough to play");
}
else{
console.log("You may start your quest!");
}
@retpolanne
retpolanne / linearprogramming.R
Last active October 28, 2018 23:04
Solver de programação linear para aulas da Fatec
# To run, execute Rscript linearprogramming.R
# based on https://rpubs.com/abhaypadda/linear-optimization-example
library(lpSolve)
# Objective
objective.in <- c(0.06, 0.08)
# Constraint matrix with 3 rows
const.mat <- matrix(c(8, 6, 1, 2, 1, 2), nrow=3, byrow=TRUE)
import argparse
import base64
from bs4 import BeautifulSoup
from http import cookies
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import requests
import os
import socketserver
from urllib.parse import unquote
#!/bin/bash
docker start gdb-docker
docker exec --privileged -it gdb-docker /usr/bin/gdb $1
#!/bin/bash
docker run --privileged --cap-add=SYS_PTRACE --name gdb-docker -v "$PWD":/usr/src/assembly -w /usr/src/assembly -it ubuntu:latest $1
#!/bin/bash
docker exec -it gcc-docker /bin/bash
#!/bin/bash
docker run --name gcc-docker --rm -v "$PWD":/usr/src/assembly -w /usr/src/assembly -it gcc:4.9 $1