Skip to content

Instantly share code, notes, and snippets.

View xorz57's full-sized avatar
🏠
Working from home

Georgios Fotopoulos xorz57

🏠
Working from home
View GitHub Profile
@xorz57
xorz57 / hook.cpp
Last active March 27, 2025 12:06
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <dlfcn.h>
#include <unistd.h>
extern "C" {
void *malloc(std::size_t size) {
using malloc_t = decltype(&std::malloc);
static malloc_t native_malloc = reinterpret_cast<malloc_t>(dlsym(RTLD_NEXT, "malloc"));
#include <cstring>
#include <cstdint>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <sys/types.h>
#include <unistd.h>
template <typename T>
@xorz57
xorz57 / Dockerfile
Last active August 12, 2022 06:41
Docker Image based on Ubuntu Focal for C/C++ Development
FROM ubuntu:focal
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates wget perl make gcc-10 g++-10 gdb
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
# Install OpenSSL 1.1.1k
RUN wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz && \
@xorz57
xorz57 / Dockerfile
Last active August 12, 2022 06:41
Docker Image based on Ubuntu Focal with SSH
FROM ubuntu:focal
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y ssh && \
apt-get clean
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/g' /etc/ssh/sshd_config && \
sed -i 's/#LogLevel INFO/LogLevel INFO/g' /etc/ssh/sshd_config && \
service ssh restart