Skip to content

Instantly share code, notes, and snippets.

View coredumped7893's full-sized avatar
🏰
Working from home

Maciek Malik coredumped7893

🏰
Working from home
View GitHub Profile
import { diskStorage } from "multer";
import { FileInterceptor } from "@nestjs/platform-express";
import { ApiResponse, ApiConsumes, ApiBody } from "@nestjs/swagger";
import {
Res,
Get,
Post,
Param,
Controller,
@coredumped7893
coredumped7893 / mount_qcow2.md
Created March 11, 2024 00:08 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
# after the virtual disk has already been expanded (e.g. in proxmox)
apk add --no-cache cfdisk e2fsprogs-extra
# choose partition then "Resize" > "Write" (to finalize)
cfdisk
# replace * with partition you are resizing
resize2fs /dev/*
@coredumped7893
coredumped7893 / aes.go
Created January 1, 2024 16:50 — forked from enyachoke/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@coredumped7893
coredumped7893 / load_dotenv.sh
Created July 29, 2023 19:56 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@coredumped7893
coredumped7893 / clear_state_of_contract_on_near_protocol.md
Created May 31, 2022 15:11 — forked from ilyar/clear_state_of_contract_on_near_protocol.md
How do clear the state of a contract on Near protocol?

How do clear the state of a contract on Near protocol?

Prepare

source neardev/dev-account.env
export CONTRACT_NAME=$CONTRACT_NAME

View state

@coredumped7893
coredumped7893 / RPi-GCC-cross-compiler.md
Created February 26, 2021 05:36 — forked from sol-prog/RPi-GCC-cross-compiler.md
How to build a cross compiler for Raspberry Pi

Sources:

http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
https://www.raspberrypi.org/documentation/linux/kernel/building.md


https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F
https://wiki.osdev.org/GCC_Cross-Compiler
https://wiki.osdev.org/Building_GCC
@coredumped7893
coredumped7893 / Makefile
Created November 17, 2020 01:26 — forked from freelsn/Makefile
Universal Makefile for C/C++
# - inc/
# - *.h
# - src/
# - *.c
# - *.cpp
# - obj/
# - *.o
# - main
TARGET := main