Skip to content

Instantly share code, notes, and snippets.

View dz0ny's full-sized avatar
💭
❤️✖️❓🤖

Janez Troha dz0ny

💭
❤️✖️❓🤖
View GitHub Profile
@dz0ny
dz0ny / boot-docker.sh
Last active August 9, 2024 10:37 — forked from mdouchement/boot-docker.sh
Restore Docker on TrueNAS SCALE 23 & 24 and above (no Kubernetes)
#!/usr/bin/env bash
# Using Docker on TrueNAS SCALE 23+ & 24+ (no Kubernetes)
#
# Don't setup Apps via the TrueNAS Web GUI (don't choose a pool for Apps when asked).
# Make a dedicated docker dataset on one of your data pools.
#
# Store this script somewhere else on your pool (not in the Docker dataset).
# Download binaries archive from https://download.docker.com/linux/static/stable/x86_64/ and unarchive them in a `docker' folder in the same directory.
# Like https://download.docker.com/linux/static/stable/x86_64/docker-27.1.1.tgz
@dz0ny
dz0ny / gist:b9e3fce83d0c52e16857
Created October 4, 2014 14:27
fix for fglrx-amdcccle depends on libc6-amd64 (>= 2.3). and fglrx depends on libc6-amd64 (>= 2.3). under ubuntu trusty
#!/bin/sh
mkdir -p driver
mkdir -p cc
dpkg-deb -R fglrx_14.301-0ubuntu1_amd64.deb driver
dpkg-deb -R fglrx-amdcccle_14.301-0ubuntu1_amd64.deb cc
sed -i "s/libc6-amd64/libc6:amd64/" driver/DEBIAN/control
sed -i "s/libc6-amd64/libc6:amd64/" cc/DEBIAN/control
dpkg-deb -b driver fglrx_14.301-0ubuntu1_amd64_fix.deb
dpkg-deb -b cc fglrx-amdcccle_14.301-0ubuntu1_amd64_fix.deb
rm -rf driver
diff all
# version
# INAV/ATOMRCF405NAVI 7.1.0 Feb 14 2024 / 14:10:39 (49325426)
# GCC-10.3.1 20210824 (release)
# start the command batch
batch start
# reset configuration to default settings
@dz0ny
dz0ny / Readme.md
Last active November 3, 2023 10:31
@dz0ny
dz0ny / vreme.si-cache.js
Created July 18, 2023 20:35
Caching proxy za vreme.si
export default {
async fetch(request) {
let url = new URL(request.url);
url.hostname = "www.vreme.si";
let newRequest = new Request(url, request);
let response = await fetch(newRequest, {
cf: {
cacheTtl: 60,
cacheEverything: true,
@dz0ny
dz0ny / mopidy.liq
Last active May 9, 2023 12:39
Gapless streaming for mopidy
#!/usr/bin/liquidsoap
set("log.file.path", "/dev/null")
set("log.stdout", true)
set("server.telnet", false)
set("harbor.bind_addr","0.0.0.0")
# tweak these values if you have lag, skipping, buffer underrun etc
# set("frame.duration",0.04)
# set("root.max_latency",60.)
@dz0ny
dz0ny / svg.conf
Created February 29, 2012 19:54
Nginx svg
location ~* \.svg$ {
default_type image/svg+xml;
# caching za procy in server odstrani ce ne zelis
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
@dz0ny
dz0ny / printer-prusa-mk3s-2021-bondtech.cfg
Last active March 3, 2023 09:08 — forked from nikolak/printer-prusa-mk3s-2021.cfg
Klipper MK3S/+ Config including optional Bondtech Extruder, Bear Extruder, etc.
# This file contains pin mappings and reasonable defaults for Prusa i3 MK3S
# printers. It will work with MK3 (non-S) by selecting the alternative filament
# sensor. References to common community mods are included as well.
#
[include mainsail.cfg]
[skew_correction]
[force_move]
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
function handleOptions(request) {
// Make sure the necessary headers are present
// for this to be a valid pre-flight request
let headers = request.headers;
if (
headers.get("Origin") !== null &&
@dz0ny
dz0ny / arso15m.py
Last active November 2, 2022 08:37
Swiftbar ARSO
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# <bitbar.title>Vreme ARSO</bitbar.title>
# <bitbar.version>v1.0.2</bitbar.version>
# <bitbar.author.github>dz0ny</bitbar.author.github>
import requests
from collections import namedtuple
from collections import OrderedDict