Skip to content

Instantly share code, notes, and snippets.

@warmonkey
warmonkey / build_llama_cpp_windows_amd.bat
Last active June 5, 2025 08:56
compile llama.cpp on windows with AMD ROCm
'BROKEN, DONT TRY
D:\
set PATH=%HIP_PATH%\bin;%PATH%
cd llama.cpp
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg.exe install curl:x64-windows
@warmonkey
warmonkey / remove_amd_adrenalin.reg
Created November 2, 2024 01:34
Remove "AMD Software: Adrenalin Edition" from Windows Explorer context menu
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shellex\ContextMenuHandlers\ACE]
@warmonkey
warmonkey / factorio_update.sh
Last active November 8, 2024 11:44
Factorio server auto update script and systemd service file.
#!/bin/bash
# if the script hangs on wget download, replace `wget` with `wget -4`
: '
/etc/systemd/system/factorio.service
[Unit]
Descritpion=Factorio Headless Server
After=network.target
@warmonkey
warmonkey / attitude_3d.py
Created September 11, 2023 07:11
3d attitude display with pyqt5
import sys
import math
import numpy as np
from stl import mesh # pip install numpy-stl
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import pyqtgraph as pg
from pyqtgraph.opengl import GLViewWidget, GLGridItem, MeshData, GLMeshItem
@warmonkey
warmonkey / qt_creator_gdb_crash_on_windows_fix.md
Last active July 16, 2023 07:55
Fix the "Qt Debugger: The GDB process terminated" error on windows

Some MinGW gdb versions will crash on info registers command. [https://sourceware.org/bugzilla/show_bug.cgi?id=26304]

Once a debugger panel in QtCreator opened, it will keep sending info registers command to gdb.
To stop this, remove Debugger.MainWindow/ChangedDocks and Debugger.MainWindow/State fields from C:\Users\[UserName]\AppData\Roaming\QtProject\QtCreator.ini

[Debugger.MainWindow]
AutoHideTitleBars=true
ShowCentralWidget=true
ChangedDocks=[REMOVED THIS]
@warmonkey
warmonkey / base_block.hpp
Last active July 16, 2023 07:47
a simple replacement for gnuradio runtime / block class
#pragma once
#include <vector>
#include <stdexcept>
#define SDR_DICT
#ifdef SDR_DICT
#include <list>
#include <map>
@warmonkey
warmonkey / mysudo.md
Last active May 25, 2023 08:47
mysudo - GUI prompt to start a GUI application as root

Add this line to ~/.bashrc
alias mysudo='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY'

@warmonkey
warmonkey / open3d_build_win10_python3.11.md
Last active May 6, 2023 08:38
Build Open3D from source on Windows 10 and Python 3.11
@warmonkey
warmonkey / rocm_pytorch_on_amd_integrated_gpu.md
Last active June 8, 2025 16:32
Use ROCm and PyTorch on AMD integrated graphics (iGPU, Ryzen 7 5825u)

UNVERIFIED YET - WAIT FOR UPDATES

pytorch/pytorch#94891 (comment) The pcie atomic issue should be fixed already. Currently i cannot verify.

  1. Install PyTorch with ROCm support
    Following offical installation guide: https://pytorch.org/get-started/locally/#linux-installation
    Choose [Stable] -> [Linux] -> [Pip] -> [Python] -> [ROCm], It should be something like:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2
@warmonkey
warmonkey / XilinxBitHeaderParser.hpp
Last active March 5, 2023 09:50
Xilinx .bit file header parser
class HeaderParser {
private:
uint8_t state;
//0=header len, 1=header data,
//2=key, 3=length, 4=value,
//5=bitstream len, 6=bitstream
uint32_t len;
uint8_t n;
uint8_t key;