Skip to content

Instantly share code, notes, and snippets.

@ChekhWasTaken
ChekhWasTaken / jellyfin
Last active March 26, 2025 23:15
AppArmor profile for Jellyfin running under Podman 5.4.0
# This is an AppArmor profile designed to limit a running Jellyfin server's
# access to only the resources it requires.
# Profile was tested using Jellyfin 10.10.6, Podman 5.4.0 on Debian Trixie host.
#
# Copyright (C) 2025 Chekhwastaken
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@ChekhWasTaken
ChekhWasTaken / nginx-stream-proxy.conf
Last active March 31, 2025 23:12
nginx forward https proxy for whitelisting websites by domain name
# This is a working example of having an HTTPS/SSL forward proxy implementation
# with nginx.
#
# Based on https://www.alibabacloud.com/blog/how-to-use-nginx-as-an-https-forward-proxy-server_595799.
#
# This isn't a proxy in traditional sense i.e. you can't use it with curl -x
# or set this as proxy in your browser.
# Instead, you'll need to forward your traffic to it.
#
# Prerequisites (run as root):
@ChekhWasTaken
ChekhWasTaken / PermissionDelegate.kt
Last active September 8, 2019 12:07
A class to handle permission requests and callbacks for fragments in Android.
import android.content.Context
import android.content.pm.PackageManager
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
typealias GrantedCallback = () -> Unit
typealias DeniedCallback = () -> Unit
data class PermissionRequest(
val requestCode: Int,