Skip to content

Instantly share code, notes, and snippets.

View M0nteCarl0's full-sized avatar
🐈
const mutable

Alex M0nteCarl0

🐈
const mutable
View GitHub Profile
@aspose-com-gists
aspose-com-gists / ConvertTTFtoWOFF_CSharp.md
Last active December 7, 2023 02:05
Convert TTF to WOFF using C#
@convict-git
convict-git / concurrency-sync-cpp.md
Created August 8, 2021 13:31
Concurrency and Synchronization using Modern C++ - (Not so) Short Notes

Concurrency and Synchronization using Modern C++

Thread Management

Each running program has at least one thread which is occupied by its entry point. There can be many threads for a single program and the memory is shared among all threads. The objects possessed by the main thread (and shared by other threads as a reference to it) would be destroyed as soon as they go out of scope. This might lead to corrupt memory access by the rest of the threads.

Hence, sometimes, it's very important to make sure that all the threads are joined using std::thread::join() before the main thread terminates. Other times, you basically want a daemon thread running in background even after the termination of main thread and that can be achieved by calling std::thread::detach(), but it may or may not be possible to join a detachable thread.

Resource Acquisition Is Initialization (RAII) is a famous programming idiom in C++ (a misnomer actually) also (better) known and understood as **Scope-Bound Resource Managemen

@charlie-x
charlie-x / gist:96a92aaaa04346bdf1fb4c3621f3e392
Created July 28, 2021 20:55
recompile wsl2 kernel, add modules and CAN modules + can utils.
mines ubuntu 20.04 based, WSL2
in windows
wsl --list -v
* Ubuntu-20.04 Stopped 2
in wsl
# the old update routine
sudo apt-get update -y
# add tools to build kernel, apologies if i missed anything as i already have a bunch of dev stuff setup
sudo apt-get install -y autoconf bison build-essential flex libelf-dev libncurses-dev libssl-dev libtool libudev-dev
@dark-lbp
dark-lbp / solve_aarch64.py
Created July 23, 2021 13:13
This is my solution to QilingLabs challenge
# !/usr/bin/env python3
# coding=utf-8
import sys
from qiling import *
from qiling.os.mapper import QlFsMappedObject
from qiling.const import QL_VERBOSE
base_address = 0x555555554000
@h4x5p4c3
h4x5p4c3 / solve.py
Last active January 25, 2023 18:14
solve script for QilingLab x86_64
#!/usr/bin/env python3
# https://www.shielder.it/blog/2021/07/qilinglab-release/
from qiling import Qiling
from qiling.const import QL_VERBOSE
from qiling.os.mapper import QlFsMappedObject
import struct
def u8(inp):
return struct.unpack("<Q", inp)
@DreamVB
DreamVB / source.cpp
Last active February 18, 2024 14:26
Sorting Algorithms in C++
//Sorting Class with 5 sorting algorithms that can sort arrays
//Compiled in Visual Studio 2013 but should work on any C++ compiler with a few tweaks.
//Incase you need som info on sorting algorithms
//https://en.wikipedia.org/wiki/Sorting_algorithm
// Algorithms in this class
// 1 Boubble Sort
// 2 Merge Sort
// 3 Selection Sort
@tomtzook
tomtzook / CMakeLists.txt
Created January 16, 2021 11:15
Compiling C++ EFI application with CMake and GNU-EFI, and running in QEMU
cmake_minimum_required(VERSION 3.16.3)
project(cppefi C CXX)
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()
if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
endif()
@MrHallows
MrHallows / fastboot_help.md
Last active May 23, 2024 05:29
fastboot commands

Command:

$ fastboot help

Output:

usage: fastboot [OPTION...] COMMAND...

flashing:
@GroupDocsGists
GroupDocsGists / AddImageWatermarkToImage.cs
Last active September 24, 2022 17:42
Add Image Watermark to Images using C# & Java
// Add PNG Image Watermark on an Image using C#
using (Watermarker watermarker = new Watermarker("filePath/image.png"))
{
using (ImageWatermark watermark = new ImageWatermark("filePath/watermarkLogo.png"))
{
// Set Watermark Properties
watermark.X = 20;
watermark.Y = 80;
// Add watermark on image file and save the output
watermarker.Add(watermark);