Skip to content

Instantly share code, notes, and snippets.

View MilosHavranek's full-sized avatar

Miloš Havránek MilosHavranek

View GitHub Profile
@MilosHavranek
MilosHavranek / mongo + docker.md
Created January 27, 2024 21:24 — forked from x-yuri/mongo + docker.md
mongo + docker

mongo + docker

mongo >= 6: init-mongo.js + MONGO_INITDB_DATABASE in .env-mongo
mongo < 6: init-mongo.sh + no MONGO_INITDB_DATABASE in .env-mongo

.env:

MONGO_USER=user
MONGO_PASSWORD=userpasswd
@MilosHavranek
MilosHavranek / Tuya TS0001 Wall Switches no metering.py
Created January 15, 2024 10:07 — forked from erkr/Tuya TS0001 Wall Switches no metering.py
Custom Quirk for Aubess (Tuya TS0001 _TZ3000_46t1rvdu)
"""Aubess / tuya TS0001 Wall Switches."""
# I bought some Aubess (Tuya TS0001 _TZ3000_46t1rvdu) devices on Ali
# The signature is recognized as a Tuya TS0001 device with power metering support, but it doesn report any values.
# This custom quirk makes it a simple switch device with the option to configure the power on behavior
from zigpy.profiles import zgp, zha
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
@MilosHavranek
MilosHavranek / Tuya TS000F Wall Switches.py
Created January 15, 2024 09:32 — forked from erkr/Tuya TS000F Wall Switches.py
ZHAQuirk for the tuya switch with power monitoring _TZ3000_xkap8wtb model TS000F.
"""tuya TS000F Wall Switches."""
# This quirk scales both the current and summation readout, and it changes the device from a light into a switch
# Note: this quirk is similar to the offical TS000x quirks, except that this device has quite a different signature.
# That includes a unknown cluster ID 0x1888 that I filtered out.
from zigpy.profiles import zgp, zha
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
@MilosHavranek
MilosHavranek / Jenkinsfile
Created January 27, 2023 08:57 — forked from nobbynobbs/Jenkinsfile
example of sidecar service in jenkins declarative pipeline
pipeline {
agent { label "docker" }
stages {
stage("test sidecar") {
steps{
script {
withDockerNetwork { n ->
// we could use Image.withRun() instead of Image.run(),
// and get rid of try/catch/finally blocks
// It's prefferable way, but it doesn't remove volumes after containers
@MilosHavranek
MilosHavranek / synology-shutdown-temperature.md
Created May 16, 2022 17:22 — forked from borekb/synology-shutdown-temperature.md
How to increase the shutdown temperature on Synology NAS

Synology: how to increase shutdown temperature

My Synology DS218+ runs with a single SSD disk that has an operating temperature range of 0–70 °C, which is common for SSDs. Synology, however, has a default shutdown temperature of 61 °C, probably due to HDDs and some lazy programming.

I'm a very light user of NAS – all I want is a network attached storage and silence. My DS218+ has one 2 TB SSD disk in it and I've changed the system fan for a quieter / slower one.

Everything runs fine but about once in a month, I get this notification:

[Synology DS218+]Synology shut down due to disk overheating. >

btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h
@MilosHavranek
MilosHavranek / MultipartFileSender
Created February 1, 2021 23:35 — forked from davinkevin/MultipartFileSender
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@MilosHavranek
MilosHavranek / README.ja.md
Created January 31, 2021 22:06 — forked from niw/README.en.md
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

ARM 版 Windows 10 や Ubuntu for ARM64 を Apple Silicon な Mac で動かす

ARM 版 Windows 10 や Ubuntu を Apple Silicon な Mac で動かす簡単な方法です。

メモ: 2020年12月19日現時点での方法で、今後おおきく改善されていくと思います(だといいな。)

ARM 版 Windows 10 を動かす

  1. Xcode を App Store で、あるいは Command Line Tools を Apple Silicon な Mac にインストール
@MilosHavranek
MilosHavranek / Dockerfile
Created January 31, 2021 22:04 — forked from radimih/Dockerfile
Spring Boot Actuator based Docker HEALTHCHECK
FROM openjdk:11-jre-slim
EXPOSE 8080
ENV TZ=Europe/Moscow
RUN adduser --system --group --home /opt/app appuser
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl jq \
@MilosHavranek
MilosHavranek / a3update.py
Created January 8, 2020 20:04 — forked from marceldev89/a3update.py
Arma 3 Linux server and mod updater (workshop)
#!/usr/bin/python3
# MIT License
#
# Copyright (c) 2017 Marcel de Vries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell