Skip to content

Instantly share code, notes, and snippets.

@XpycTee
XpycTee / smart_charging_light.yaml
Created October 13, 2025 09:13
Smart Charging (domain: light)
blueprint:
name: Smart Charging (light) 🔌📱
description: >
Automatically turns the socket on and off for phone charging.
If the battery level is low — the socket turns on, or based on a schedule.
When the battery reaches 100%, the socket turns off.
domain: automation
input:
charge_socket:
name: Charging Socket 🔌
@XpycTee
XpycTee / container-station.svg
Last active August 19, 2025 07:28
Container Station Logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@XpycTee
XpycTee / backup-via-rose.rsc
Last active July 21, 2025 06:01
Mikrotik Backup Script for ROSv7 via ROSE-storage package
# WARNING: Requires ROSE-storage package installed and "backups" slot mounted
# backup password
:local backupPassword "Extr@Me9@5uerP@55w0rD!";
:if ([:len [/file find name="backups"]] = 0) do={
:error "Storage 'backups' not mounted! Mount storage first."
}
# get current date
@XpycTee
XpycTee / backup-via-ftp-ros-v7.rsc
Last active July 21, 2025 06:01
Mikrotik Backup Script for ROSv7
# backup password
:local backupPassword "Extr@Me9@5uerP@55w0rD!";
# ftp params
:local ftpip "192.168.255.100";
:local ftpuser "mikrotik";
:local ftppassword "SuperMegaPass1337";
:local ftppath "/path/to/backups";
# get current date
@XpycTee
XpycTee / backup-via-ftp-ros-v6.rsc
Last active July 21, 2025 06:02
Mikrotik Backup Script for ROSv6
# backup password
:local backupPassword "Extr@Me9@5uerP@55w0rD!";
# ftp params
:local ftpip "192.168.255.100";
:local ftpuser "mikrotik";
:local ftppassword "SuperMegaPass1337";
:local ftppath "/path/to/backups";
# months array
@XpycTee
XpycTee / smart_charging_switch.yaml
Last active October 13, 2025 09:12
Smart Charging (domain: switch)
blueprint:
name: Smart Charging (switch) 🔌📱
description: >
Automatically turns the socket on and off for phone charging.
If the battery level is low — the socket turns on, or based on a schedule.
When the battery reaches 100%, the socket turns off.
domain: automation
input:
charge_socket:
name: Charging Socket 🔌
@XpycTee
XpycTee / all_java_install.sh
Created February 13, 2025 08:05
Install all Java
#!/bin/bash
# Define the Java versions and their download URLs
declare -A java_versions=(
["7"]="https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz"
["8"]="https://cdn.azul.com/zulu/bin/zulu8.74.0.17-ca-jdk8.0.392-linux_x64.tar.gz"
["11"]="https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz"
["17"]="https://download.java.net/openjdk/jdk17/ri/openjdk-17+35_linux-x64_bin.tar.gz"
["21"]="https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_linux-x64_bin.tar.gz"
)
@XpycTee
XpycTee / doh
Created January 12, 2025 14:32 — forked from M0r13n/doh
Setup Cloudflare as a DoH (DNS over HTTPS) resolver on Mikrotik devices (RouterOS v7.0.2+)
# Temporarily add a normal upstream DNS resolver
/ip dns set servers=1.1.1.1,1.0.0.1
# CA certificates extracted from Mozilla
/tool fetch url=https://curl.se/ca/cacert.pem
# Import the downloaded ca-store (127 certificates)
/certificate import file-name=cacert.pem passphrase=""
# Set the DoH resolver to cloudflare
@XpycTee
XpycTee / podman-update.sh
Last active January 30, 2025 04:08
Updater docker containers for podman with generating systemd service config file
#!/bin/bash
###################################################
# How to use:
#
# $ podman-update.sh [--force] container_id (OR container_name)
# optional:
# --force: force update even if the image is up to date
###################################################
@XpycTee
XpycTee / keys_to_int.py
Created September 12, 2023 11:10
Dict keys to int
def keys_to_int(data) -> dict:
return {int(k): v for k, v in data.items()}