Skip to content

Instantly share code, notes, and snippets.

@rootVIII
rootVIII / rpath.go
Last active June 26, 2020 15:41
Golang realpath with CGO (Linux)
package main
/*
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
*/
import "C"
import (
"fmt"
@rootVIII
rootVIII / ifaddrs.c
Last active May 30, 2022 16:16
C get all NIC interface names and IP address on Ubuntu
#define _GNU_SOURCE
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/if_link.h>
#include <string.h>
@rootVIII
rootVIII / sec_browse.py
Last active May 31, 2022 21:19
Python sec_browse.py - Auto-configures Firefox network settings and opens a secure Tor/Firefox browser session for the # time specified by -t
#! /usr/bin/python3
from os import popen, remove, getcwd
from selenium import webdriver
from subprocess import call
from sys import exit
from time import sleep
from argparse import ArgumentParser
from threading import Thread
# rootVIII
# sec_browse.py - Auto-configures Firefox network settings
@rootVIII
rootVIII / port_scanner.py
Last active May 30, 2022 16:18
Python Port scanner, scan another Linux host
#! /usr/bin/python3
import socket
from threading import Thread
from argparse import ArgumentParser
class PortScanner:
def __init__(self, target_ip, show):
self.show_ranges = show
self.target_ip = target_ip
@rootVIII
rootVIII / netgearscraper.go
Last active May 30, 2022 16:18
Golang Scrape a Netgear Router's web UI, show devices on your network
package main
// rootVIII
// Netgear router scraper
import (
"fmt"
"io/ioutil"
"net/http"
"os"
@rootVIII
rootVIII / merge_sort.py
Created January 15, 2020 04:04
Python merge sort
#! /usr/bin/python3
# rootVIII
# merge sort
def merge(left, right):
combined, left_index, right_index = [], 0, 0
while left_index < len(left) and right_index < len(right):
if left[left_index] < right[right_index]:
combined.append(left[left_index])
@rootVIII
rootVIII / dfs.py
Last active May 30, 2022 16:20
Python Depth First Search
#! /usr/bin/python3
# rootVIII - my DFS
class Dfs:
def __init__(self, graph, top_node):
self.graph = graph
self.route_travelled = []
self.__trace_route(top_node)
@rootVIII
rootVIII / recursive_turtle.py
Last active May 30, 2022 16:20
Python recursively draw a sine wave with Python
#! /usr/bin/python3
# rootVIII
# Make turtle recursively
# draw a sine wave
from turtle import *
import time
import math
def draw_sine(x):