Skip to content

Instantly share code, notes, and snippets.

View M0nteCarl0's full-sized avatar
🐈
const mutable

Alex M0nteCarl0

🐈
const mutable
View GitHub Profile
@M0nteCarl0
M0nteCarl0 / STM32F4_bootloader.icf
Created August 6, 2023 17:32
STM32F4 simple bootloader
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
@M0nteCarl0
M0nteCarl0 / Cubic_interp.cu
Created August 3, 2023 19:01
CUDA C linear & cubic interpolation kernels
__global__ void cubic_interp(float* x, float* y, int n, float* x_new, float* y_new, int m) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx >= m) return;
int i = 1;
while (i < n && x[i] <= x_new[idx]) {
@M0nteCarl0
M0nteCarl0 / Q&A.txt
Created August 3, 2023 18:49
Auriga 2023 Q&A
Q:
By default, Linux builds user-space programs as dynamically linked applications. Please describe scenarios where you would change the default behavior to compile your application as a statically linked one.
A:
There are several scenarios where you would change the default behavior to compile your application as a statically linked one:
1. Portability: If you want to ensure that your application will run on any system without having to worry about missing shared libraries or different versions of the same libraries, then compiling it statically is a good option.
2. Security: If you want to reduce the attack surface of your application by eliminating the need for external dependencies, then compiling it statically can help improve security.
3. Performance: If your application requires fast startup times and low memory usage, then compiling it statically can provide a performance boost since it eliminates the overhead of dynamic linking.
@M0nteCarl0
M0nteCarl0 / HistoryManager.cpp
Created August 3, 2023 09:12
HistoryManager
#include <iostream>
#include <fstream>
#include <vector>
#include <nlohmann/json.hpp>
using namespace std;
using json = nlohmann::json;
struct HistoryEntry {
std::string action;
@M0nteCarl0
M0nteCarl0 / meizu.cpp
Created August 3, 2023 08:38
Meizu project templates
#include <iostream>
#include <thread>
#include <vector>
#include <deque>
#include <mutex>
#include <condition_variable>
#include <boost/asio.hpp>
using boost::asio::ip::tcp;
@M0nteCarl0
M0nteCarl0 / DQE_MTF.py
Created August 3, 2023 08:03
DQE_MTF example
import numpy as np
from scipy.fft import fft2
from scipy.ndimage import sobel, gaussian_filter
from PIL import Image
def compute_dqe(image_path):
# Load the X-ray image
image = Image.open(image_path).convert("L")
image = np.array(image)
@M0nteCarl0
M0nteCarl0 / parser_pwned_passwd.go
Created August 2, 2023 06:49
parser pwned_passwd
package main
import (
"crypto/sha1"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
)
@M0nteCarl0
M0nteCarl0 / Cupy_CPA.py
Created August 1, 2023 14:11
SIMON Cipher CPA
import cupy as cp
from tqdm import tnrange
@cp.fuse()
def rol32(x, n):
return (x << n | x >> (32 - n))
@cp.fuse()
def simon_round_function(x):
return (rol32(x, 1) & rol32(x, 8)) ^ rol32(x, 2)
@M0nteCarl0
M0nteCarl0 / sqlite_task.c
Created July 31, 2023 18:34
SQLlite task for fetch data from database and write to textual file
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "sqlite3.h"
using namespace std;
// Функция обработки результатов запроса к базе данных
static int callback(void* data, int argc, char** argv, char** azColName) {
@M0nteCarl0
M0nteCarl0 / connection manger_HighLoad.go
Last active July 31, 2023 17:14
Golang connection manager
package main
import (
"fmt"
"sync"
)
// ConnectionManager интерфейс определяет методы для управления соединениями
type ConnectionManager interface {
AddConnection(connection Connection)