Skip to content

Instantly share code, notes, and snippets.

View fstanis's full-sized avatar

Filip Stanis fstanis

View GitHub Profile
@fstanis
fstanis / Dockerfile
Created August 11, 2026 21:01
PocketBook eReaders SDK 6.8 inside a Docker image
# installs the SDK and all the necessary tooling to use clang and cmake
FROM --platform=linux/amd64 debian:bullseye-slim
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libtinfo5 \
libarchive-tools \
xz-utils \
make \
@fstanis
fstanis / install-tailscale.sh
Created July 17, 2026 16:14
Tailscale CLI - macOS installer
#!/usr/bin/env sh
set -eu
trap '' HUP
readonly PREFIX="/opt/tailscale"
readonly LAUNCH_DAEMON="/Library/LaunchDaemons/homebrew.mxcl.tailscale.plist"
readonly REGISTRY="https://ghcr.io/v2/homebrew/core/tailscale"
readonly FORMULA_API="https://formulae.brew.sh/api/formula/tailscale.json"
readonly TOKEN_ENDPOINT="https://ghcr.io/token?service=ghcr.io&scope=repository:homebrew/core/tailscale:pull"
@fstanis
fstanis / win2usb.sh
Created May 14, 2026 09:16
Bash script to install Windows to a USB drive (Windows To Go)
#!/bin/bash
# win2usb.sh — install Windows to a USB drive from an ISO, on Linux.
#
# Usage: win2usb.sh [--wtg] <iso-path> <target-device> [wim-index]
#
# Partitions the target as GPT (ESP + MSR + NTFS), applies the selected
# WIM index, and sets up UEFI boot via a BCD store built from the ISO's
# BCD-Template.
#
@fstanis
fstanis / mpv-chromeos.md
Created July 8, 2025 10:05
mpv on ChromeOS with hardware decoding
@fstanis
fstanis / tailscale_getfiles.sh
Created June 29, 2025 10:13
A script to periodically check for new files in taildrop and move them.
#!/bin/bash
# A script to periodically check for new files in taildrop and move them.
#
# Usage:
# ./tailscale_getfiles.sh start
# ./tailscale_getfiles.sh stop
readonly TAILSCALE_DIR="$HOME/tailscale"
readonly STATE_DIR="$TAILSCALE_DIR/state"
@fstanis
fstanis / tailscale_manager.sh
Created June 29, 2025 09:46
A script to start, stop or install the Tailscale daemon without root.
#!/bin/bash
# A script to start, stop or install the Tailscale daemon without root.
#
# Usage:
# ./tailscale_manager.sh start
# ./tailscale_manager.sh stop
# ./tailscale_manager.sh install
readonly TAILSCALE_URL='https://pkgs.tailscale.com/stable/tailscale_1.84.0_amd64.tgz'
@fstanis
fstanis / pactlx
Created July 8, 2024 14:43
pactl with extensions
#!/bin/bash
# Copyright 2024 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# This script provides a few extensions to pactl, the tool used to reconfigure
# a running PulseAudio sound server during runtime.
# Added commands:
# exists-card Checks if card exists (args: name)
@fstanis
fstanis / ViewModelScope.kt
Created August 6, 2023 12:43
Hilt inject a CoroutineScope into anything @ViewModelScoped
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
import dagger.hilt.android.ViewModelLifecycle
import dagger.hilt.android.scopes.ViewModelScoped
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import javax.inject.Inject
@fstanis
fstanis / simple.go
Created September 22, 2022 11:04
libmpv/simple/simple.c rewritten in Go
package main
/*
#include <stdlib.h>
#include <mpv/client.h>
#cgo pkg-config: mpv
const char* INPUT_DEFAULT_BINDING = "input-default-bindings";
const char* INPUT_VO_KEYBOARD = "input-vo-keyboard";
const char* YES = "yes";
@fstanis
fstanis / pacmdx
Last active April 30, 2021 14:06
pacmd with extensions
#!/bin/bash
# Copyright 2021 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# This script provides a few extensions to pacmd, the tool used to reconfigure
# a running PulseAudio sound server during runtime.
# Added commands:
# exists-card Checks if card exists (args: name)