Skip to content

Instantly share code, notes, and snippets.

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

Janez Troha dz0ny

💭
❤️✖️❓🤖
View GitHub Profile
@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,
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
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
set osd_warn_core_temp = ON
set osd_warn_fail_safe = OFF
set osd_warn_rssi = OFF
set osd_rssi_alarm = 30
set osd_cap_alarm = 1200
set osd_alt_alarm = 400
set osd_rssi_pos = 2096
set osd_link_quality_pos = 2096
set osd_link_tx_power_pos = 352
set osd_tim_1_pos = 449
@dz0ny
dz0ny / PA.macro
Last active April 28, 2022 07:55
[respond]
[gcode_macro PA_TUNER]
description: Pressure Advance Tuning Macro
=========================================
parameters with defaults listed below:
TOOLHEAD=""
BED_X_LENGTH=printer.toolhead.axis.maximum.x
BED_Y_LENGTH=printer.toolhead.axis.maximum.y
FILAMENT_DIAMETER=printer...filament_diameter
#!/bin/bash
destination_host=$(/sbin/ip route | awk '/default/ { print $3 }')
if [[ $destination_host != "" ]]; then # check if we have default route (connected to router)
echo "Default gateway found $destination_host ..."
ping -c4 $destination_host >/dev/null # check if destination is reachable - possible by default the router
if [ $? != 0 ]; then
echo "Destination not reachable - reconfigure interface..."
sudo wpa_cli -i wlan0 reconfigure # reconfigure network to trigger reconnect
sudo dhclient -v # ensure connection will be established by refresh dhcp lease
"outcome": "ok",
"scriptName": null,
"exceptions": [],
"logs": [],
"eventTimestamp": 1641222089966,
"event": {
"request": {
"url": "https://bee.paretosecurity.com/i",
"method": "POST",
"headers": {
@dz0ny
dz0ny / hours.1m.py
Last active November 12, 2021 12:37
Track your work hours
#!/usr/bin/python3
# <xbar.title>Work Hours</xbar.title>
# <xbar.desc>A simple command line tool for managing your work hours</xbar.desc>
# <xbar.dependencies>python,ruby,node</xbar.dependencies>
# <xbar.author.github>dz0ny</xbar.author.github>
from argparse import ArgumentParser
import csv
from enum import Enum, auto
import os