Skip to content

Instantly share code, notes, and snippets.

View threadexio's full-sized avatar

1337 threadexio

  • EvilCorp Inc
  • Greece
  • 23:09 (UTC +03:00)
View GitHub Profile
@threadexio
threadexio / naidne.h
Created March 10, 2022 18:28
C/C++: Endianess converters
/**
* @file naidne.h
* @author 1337 threadexio (github.com/threadexio)
* @brief Little-Big endian converters
* @version 0.1
* @date 2022-03-10
*
* @copyright Copyright 1337 (c) 2022
*/
#ifndef _NAIDNE_H
@threadexio
threadexio / num_gen.h
Created March 30, 2021 20:18
Cryptographically secure random number generator in C using GMP
// https://github.com/threadexio
#pragma once
#include <stdlib.h> // malloc, free
#include <string.h> // memset
#include <stdio.h> // fopen, fread, fclose
#include <gmp.h>
#define RANDOM_DEV "/dev/urandom"
@threadexio
threadexio / README.md
Last active March 30, 2021 19:44
Linux: How-to access the internet from a network namespace

Linux: Allowing a network namespace to access the internet

Requirements:

  • Be familliar with linux
  • Basic networking knowledge

Creating the namespace

sudo ip netns add net1
sudo ip link add if0 type veth peer name if1