Skip to content

Instantly share code, notes, and snippets.

View ErnyTech's full-sized avatar
:octocat:
#movingtogithub

Ernesto Castellotti ErnyTech

:octocat:
#movingtogithub
  • Savona, Italy
  • 09:22 (UTC +02:00)
View GitHub Profile
@ErnyTech
ErnyTech / allocaheap.d
Last active July 19, 2023 23:07
Allocate memory on heap, which works like he stack
align(16) struct StackHeader {
StackHeader* next = void;
void* ptrDeep = void; // stack deep ptr
}
static StackHeader* lastAllocatedHeader = null;
void[] allocaHeap(size_t size) {
import core.stdc.stdlib : malloc, free;
@ErnyTech
ErnyTech / dsdt.dsl
Last active August 8, 2022 12:26
Huawei Matebook 16 [AMD] S3 Deep Sleep Patch
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20220331 (64-bit version)
* Copyright (c) 2000 - 2022 Intel Corporation
*
* Disassembling to symbolic ASL+ operators
*
* Disassembly of dsdt.dat, Mon Aug 8 14:02:02 2022
*
* Original Table Header:
@ErnyTech
ErnyTech / intel-gvtg.md
Last active March 19, 2022 21:28
How to setup Intel GVT-g with libvirt
@ErnyTech
ErnyTech / qemu
Last active April 3, 2024 05:40
Qemu hook for Intel GVT-g
#!/bin/sh
GVT_DRIVER=i915
GVT_PCI=0000:00:02.0
function create_gpu {
local GVT_GUID="$1"
local MDEV_TYPE="$2"
pkexec sh -c "echo $GVT_GUID > /sys/bus/pci/drivers/$GVT_DRIVER/$GVT_PCI/mdev_supported_types/$MDEV_TYPE/create"
}
testblink2.elf: formato del file elf32-avr
Disassemblamento della sezione .text:
00000000 <main>:
0: 8f ef ldi r24, 0xFF ; 255
2: 84 b9 out 0x04, r24 ; 4
00000004 <LBB0_1>:
by @ErnyCS
#include <hitgvoip.h>
void update_handler(Object update) {
if(some_function_to_check_if_update_is_a_call_update) {
if(some_function_to_check_if_call_is_ready_state) {
call_params_t params = {true, user_id_to_send_call, your_call_id, CALL_STATE_REQUESTED, {true, true, 65, 65}, {}, {}};
client_t client = create_client(params);
const char *server_config[40] = {"audio_max_bitrate", "20000", audio_max_bitrate_gprs", "8000", "audio_max_bitrate_edge", "16000","audio_max_bitrate_saving", "8000","audio_init_bitrate", "16000","audio_init_bitrate_gprs", "8000","audio_init_bitrate_edge", "8000","audio_init_bitrate_saving", "8000","audio_bitrate_step_incr", "1000","audio_bitrate_step_decr", "1000","audio_min_bitrate", "8000","relay_switch_threshold", "0.8","p2p_to_relay_switch_threshold", "0.6","relay_to_p2p_switch_threshold", "0.8","reconnecting_state_timeout", "2.0","rate_flags", "0xFFFFFFFF","rate_min_rtt", "0.6","rate_min_send_loss", "0.2","packet_loss_for_extra_ec", "0.02","max_unsent_stream_
import std.stdio;
import std.conv;
import core.stdc.stdio;
import core.stdc.stdlib;
import std.string;
struct fileData {
void* data;
size_t numData;
}
#include <iostream>
#include <string>
void asterisco(int q);
int main() {
int N;
std::cout << "Inserisci un numero ";
std::cin >> N;
asterisco(N);