Skip to content

Instantly share code, notes, and snippets.

View mibli's full-sized avatar
🎲
👌🏻 gotcha~

Miłosz Bliźniak mibli

🎲
👌🏻 gotcha~
View GitHub Profile
@mibli
mibli / README.md
Created July 3, 2025 11:23
Use LF as a Diff Walker

Rationale

Recently I've found myself in need to reinstall the linux system, to change MBR partition to GPT. Before I do that though I need to find files I've had configured for my system, and I could use a bunch of applications for that, none of them though offer a holistic approach. So how about a diff walker (similiar to disk-usage walkers)? I could set up a directory with bare system and investigate what I've added manually. However options for that are limited, but it was easy to implement a simple version of it myself. With use of lf and recently added feature: on-load.

How it works

@mibli
mibli / main.cpp
Created March 8, 2024 00:29
Optimized and readable byte sequence compare
// So the aim of this exercise is to make a bit easier on the eyes (and cpu)
// comparisons of array elements, than comparing byte, by byte.
// Imagine that we have protocol buffer represented by array of bytes:
//
// uint8_t buffer[] = { 42, 84, 54, 32, 06, 12, 14, 05 };
//
// Now we have some logic that has to check header of the buffer for key values
// Normally we would use structores, that we would assign values to... (let's skip that for now)
// Otherwise we would compare each byte, eg.
//
@mibli
mibli / flashing-magisk-a320fl.md
Last active June 15, 2025 21:59
Flashing Magisk on Samsung A3 2017 on Linux

Rooting Samsung A3 2017 (A320FL, a3y17lt) on Linux, the cautious way

First off, I'm not responsible for any damage to Your devices, I'm sharing my experience and it should not be taken as a replacement for manual and common sense. You're following the guide at Your own risk!!

The purpose of this document is to help understand me the process of flashing. The issue with a lot of guides is that they describe only the necessary steps, and provide pre-patched archives and images, pre-downloaded binaries, which is not a very assuring or secure way of approaching things. I will try to describe where to get original binaries, how to patch the original image.

Don't treat the document as an oracle, go check and verify things. Cautious is the way!

Backup your data.

@mibli
mibli / generate_save_copies.FCMacro
Created February 23, 2022 03:08
Generate Copies of Parametrized FreeCAD projects with Spreadsheet
# vim: ft=python
"""
Macro that changes values to presets in columns, and saves modified copies.
This macro is mainly useful for Assembly Workbench (A2Plus)
The sheet should have the following format:
| A | B | C | D | ... | m |
-------------------------------------------------
1 |Width | 200| 300| 200| | |
-------------------------------------------------
@mibli
mibli / git-cleanup.sh
Created June 25, 2021 13:14
git cleanup
#!/bin/bash
die() {
echo "$@"
exit 1
}
confirm() {
ans=
while true; do
@mibli
mibli / proton-run.sh
Created June 8, 2021 23:28
proton-run
#!/bin/bash
die() {
echo "$@"
exit 1
}
library_paths=( /mdata/games/ /data/games /sdata/games )
case "$1" in
-l|list)
@mibli
mibli / xow-notify.service
Created May 6, 2021 10:36
XBox Controller notifications on connect/disconnect
[Unit]
Description=Mopidy
[Service]
ExecStart=sh -c 'journalctl -ft xow | sed -nue "s/.*\s-\s//" -e "/Controller .* \(dis\)\?connected/p;/Battery level:/p" | xargs -I{} notify-send "{}"'
Restart=on-failure
RestartPreventExitStatus=1
SuccessExitStatus=2
RestartForceExitStatus=3 4
@mibli
mibli / log.txt
Created December 19, 2020 16:06
Cyberpunk 2077 linux crash log
Starting app 1091500
Loaded Config for Local Override Path for App ID 1091500, Controller 0: /home/mblizniak/.local/share/Steam//controller_base/empty.vdf
>>> Adding process 256902 for game ID 1091500
GameAction [AppID 1091500, ActionID 3] : LaunchApp changed task to WaitingGameWindow with ""
Fossilize INFO: ExternalReplayer::Impl::kill(): Failed to kill: errno 3.
GameAction [AppID 1091500, ActionID 3] : LaunchApp changed task to Completed with ""
ERROR: ld.so: object '/home/mblizniak/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/mblizniak/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/mblizniak/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/mblizniak/.local/share/Steam/ubuntu12
@mibli
mibli / lfrc.part
Last active May 23, 2017 08:06
Temporary lf bookmarks implementation
cmd mark-new ${{
# querying mark
read -e -p "Mark as: " -n 1 markchar
markfile="${XDG_CONFIG_HOME:-$HOME/.config}/lf/marks"
# removing old mark if present
sed -i "/^$markchar .*/d" "$markfile"
# adding new mark
{ cat "$markfile" 2>/dev/null;
echo "$markchar" "$(pwd)"; } |
sort > "$markfile.tmp"
@mibli
mibli / nvidiabl-pkgbuild.patch
Created January 14, 2017 12:23
Patch for PKGBUILD for AUR package nvidiabl from 2016-12-09 10:32
--- nvidiabl.unp/nvidiabl/PKGBUILD 2016-12-09 11:32:46.000000000 +0100
+++ nvidiabl/PKGBUILD 2017-01-14 13:18:04.928817417 +0100
@@ -27,16 +27,16 @@
}
build() {
- cd $pkgnmame-master
+ cd $pkgname-master
make
}