Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
lidgnulinux / bwrap.sh
Created September 18, 2025 23:39
bwrap example to launch firefox.
bwrap --bind /home/lfs/browser / \
--dev /dev \
--proc /proc \
--bind /sys /sys \
--bind /run /run \
--bind /home/lfs/.mozilla /home/lfs/.mozilla \
--bind /home/lfs/Downloads /home/lfs/Downloads \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/passwd /etc/passwd \
--ro-bind /etc/group /etc/group \
@lidgnulinux
lidgnulinux / Unblock.md
Last active September 15, 2025 23:39
Unblock blocked sites inside chroot.

I'm using dnscrypt-proxy on main machine and also using firefox inside chroot. I get network working but some site are blocked inside chroot unlike my host. To unblock them I just figured out a simple trick. Turns out I just need to make the resolv.conf from inside chroot using same nameserver like my host (which is 127.0.0.1).

$ cat /etc/resolv.conf
nameserver 127.0.0.1

After set it up, exit the chroot and reenter.

@lidgnulinux
lidgnulinux / 00README.md
Created September 14, 2025 23:38
Simple package builder & installer.

Simple package builder and installer.

Why ?

I've tried some packaging tools / builder on some distros (debian and its based, archlinux, alpine, slackware, crux and dragora). I want to write my own package builder using bash and stow as its manager. It's inspired by slackbuild and qi recipe but I really want to make it really understandable.

Basic

@lidgnulinux
lidgnulinux / Static-linked-exectables-build.md
Last active July 8, 2025 09:36
Static-linked executables collection.

Static-linked Executables build.

What are these ?

These are my static-linked executables I'm building, which I think are interesting.

They consist of tools I use daily. As the name suggest, the static-linked executables don't rely on libraries (CMIIW), so you can just run it (tested in glibc and musl environment).

@lidgnulinux
lidgnulinux / Build-static-android-platform-tools-without-go.md
Last active June 18, 2025 08:53
How to build static android-platform-tools without GO.

Build Static Android Platform Tools without GO.

Some days ago, I found an interesting repository about android tools which can be built without GO compiler (check it here). If you're familiar with adb, fastboot, etc, you know what I'm talking about. It suits me because I have no GO compiler or won't bother to download one because I already have GCC. After firts successful build which result on dynamic linked binaries, I'm curious on building the static linked one. Here is how I did it !

Preparations

Before we go deep into building stuffs, we need to prepare some stuffs.

  • Make sure you have GCC / Clang !
  • Satisfy the dependencies, check on the README !
@lidgnulinux
lidgnulinux / Running-Android-Platform-Tool-Musl.md
Created June 11, 2025 11:50
Running Android Platform Tools on musl.

Running Android Platform Tools on Musl.

Opening

Since I moved to source-based linux distro with musl (Dragora GNU/Linux & LFS Musl), I always wondering about how to run android platform tools on musl. Android platform tools seems built againts glibc so running it on musl is almost impossible. Not until I discovered about patchelf. Turns out, we can use patchelf to make android platform tools binary tool (adb, fastboot, etc) to run on musl, with a bit of trick of course.

@lidgnulinux
lidgnulinux / thunar_4.20_remove_set_as_wallpaper.patch
Created May 30, 2025 09:09
Patch to remove set as wallpaper option.
--- plugins/thunar-wallpaper/twp-provider.c 2025-05-30 15:44:12.534952614 +0700
+++ plugins/thunar-wallpaper/twp-provider.c.new 2025-05-30 16:00:50.899096470 +0700
@@ -145,17 +145,6 @@
/* get the mime type of the file */
mime_type = thunarx_file_info_get_mime_type (files->data);
- if (g_str_has_prefix (mime_type, "image/")
- && (thunarx_file_info_has_mime_type (files->data, "image/jpeg")
- || thunarx_file_info_has_mime_type (files->data, "image/png")
- || thunarx_file_info_has_mime_type (files->data, "image/svg+xml")
@lidgnulinux
lidgnulinux / 00-Kumpulan-kulak-kulik.md
Last active April 22, 2025 00:25
Kumpulan Kulak Kulik.

Kumpulan Kulak Kulik.

Linux related.

How to build gettext and libintl.so on musl.

Gettext with libintl.so.

After did some trials and errors I found a way to build gettext library + its libintl.so library on musl. I need the library so cosmic-files will work properly. Before I finally built gettext + libintl.so, everytime I build gettext I only get libgnuintl.so instead of libintl.so. Turns out, the solution is pretty simple. I just need to rename libintl.h header file from musl build and boom, gettext build will produce libintl.so instead of libgnuintl.so.

Prepare.

  • Musl (obviously).
  • gettext, I use 0.24 version.
@lidgnulinux
lidgnulinux / 00.vanity-gaps-and-foreign-toplevel.patch
Last active May 24, 2025 09:46
Vanity gaps & foreign toplevel management patch for dwl.
diff --git a/Makefile b/Makefile
index 578194f..887a0f8 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,8 @@ dwl: dwl.o util.o
$(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
- wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
+ wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \