Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
lidgnulinux / Makefile.curl
Last active December 2, 2025 05:53
bsd.port.mk-inspired build for linux.
COMMENT = URL retrival utility and library
VERSION = 8.17.0
REVISION = 0
CATEGORIES = net
PKGNAME = curl
HOMEPAGE = https://curl.se/
LINK = https://curl.se/download/curl-${VERSION}.tar.xz
ARCHIVE = curl-${VERSION}.tar.xz
SRCCD = archive
BUILD = make
@lidgnulinux
lidgnulinux / build.ninja
Last active November 26, 2025 05:44
Simple and clear build.ninja example.
# build.ninja
pkgname = dwl
version = v0.8-dev
rev = 0
cat = wayland
srcdir = dwl
format = ${pkgname}_${version}_${rev}@${cat}
rule edit
@lidgnulinux
lidgnulinux / Makefile.test
Last active November 24, 2025 01:55
Attempt to build & create package using makefile.
# include build.mk
COMMENT = test
V = 0
PKGNAME = test
REVISION = 0
CATEGORIES = misc
ARCH = amd64
BUILDDIR = sources
ARCHIVE = sources.tar.gz
@lidgnulinux
lidgnulinux / Makefile
Created November 21, 2025 12:19
bmake build example.
COMMENT = Wayland tiling compositor inspired by Ratpoison
V = 3.1.0
PKGNAME = cagebreak
REVISION = 0
CATEGORIES = wayland
U = https://github.com/project-repo/cagebreak
SOURCE = $U/archive/$V.tar.gz
ARCHIVE = $V.tar.gz
BUILD = meson
BUILDDIR = cagebreak-3.1.0
@lidgnulinux
lidgnulinux / libressl-post-upgrade.md
Created October 17, 2025 20:54
Libressl post upgrade, packages need to be rebuilt.

Libressl post upgrade, some packages need to be rebuilt.

  • pipewire
  • eudev
  • cmake
  • git
  • libarchive
  • libevent
  • libsrt
  • libssh2
@lidgnulinux
lidgnulinux / ffmpeg-record-focused-window
Created October 8, 2025 10:38
Record focused window using ffmpeg.
#!/bin/bash
position=$(xdotool getwindowfocus getwindowgeometry | grep Posit | awk '{print $2}')
ffmpeg -f x11grab \
-framerate 30 \
-video_size $1 \
-i ${DISPLAY}+$position \
-c:v libx264 \
-pix_fmt yuv420p \
@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).