Skip to content

Instantly share code, notes, and snippets.

View aldemira's full-sized avatar
👍

Aldemir Akpinar aldemira

👍
View GitHub Profile
@aldemira
aldemira / search_k8s_env_var.sh
Last active December 11, 2024 07:10
search for an env var value in all k8s namespaces
#!/bin/bash
for i in `kubectl get ns`;do
kubectl set env deployment --all --list -n $i | egrep -e '(^#|=my_value)'
done
@aldemira
aldemira / Compiling nginx-otel on debian bookworm
Last active February 5, 2025 09:36
Compiling nginx-otel on debian bookworm
apt-get install nginx-dev
cd /usr/share/nginx/src
./configure --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-threads --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module
cd /opt
apt-get install -y cmake build-essential libssl-dev zlib1g-dev libpcre3-dev pkg-config libc-ares-dev libre2-dev git
git clone https://github.com/nginxinc/nginx-otel.git
cd nginx-otel
mkdir build && cd build
cmake -DNGX_OTEL_NGINX_BUILD_DIR=/usr/share/nginx/src/
@aldemira
aldemira / autostart librespot
Created October 8, 2024 06:24
Sysv init script for librespot
cd /etc/rc2.d && ln -s ../init.d/librespot S03librespot
cd /etc/rc6.d && ln -s ../init.d/librespot K01librespot
cd /etc/rc0.d && ln -s ../init.d/librespot K01librespot
@aldemira
aldemira / gist:a33132a2d4cb2712c8d74f8b93aef1d0
Last active October 7, 2024 18:44
Install Debian Bookworm on a raspberry pi zero 2w without a keyboard

Get your desired Debian version for raspberry pi 3 from https://raspi.debian.net/daily-images/ Write it to the sdcard with:

xzcat 20210408_raspi_3_bullseye.xz | sudo dd of=/dev/{YOUR_DEVICE} bs=64k oflag=dsync status=progress If on macos, get the device name with: sudo diskutil list and umount any mounted volumes e.g. sudo diskutil unmount /dev/disk4s1 NOTE: Also omit oflag=dsync on macos. When done mount the sdcard (mount /dev/sdb2 /mnt) and chroot to it (chroot /mnt), also mount first partition (/dev/sdb1) to /mn/boot/firmware before chroot.

@aldemira
aldemira / Cross compile librespot armel on debian bookworm
Last active December 19, 2024 05:46
Install spotifyd on raspberry pi1 b using Debian bookworm
apt-get install gcc-arm-linux-gnueabi curl nvi git pkg-config gcc
#### Below is for arm32 bit arch #######
dpkg --add-architecture armel && apt-get update && apt-get install libssl-dev:armel libasound2-dev:armel
#############
Install rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Add env: