Skip to content

Instantly share code, notes, and snippets.

@RuslanLanket
RuslanLanket / entities-on-off-trigger-conditions.yaml
Last active December 9, 2024 18:16 — forked from Blackshome/smart-light.yaml
Home Assistant Blueprint: Включение и выключение света, выключателя, объекта или сцены с помощью условий запуска
blueprint:
name: 1 Rus Включение и выключение света, выключателя, объекта или сцены с помощью условий запуска
description: >
# Включение и выключение света, выключателя, объекта или сцены с помощью условий запуска
**Version: 1.7**
Наиболее распространенная автоматика, используемая для включения и выключения источника света, выключателя, объекта или сцены с помощью двоичного датчика, высоты солнца, значения освещенности окружающей среды или времени, когда их значение изменяет состояние или превышает заданное значение.
Перевел и подмял под своё усмотрение
@onegreyonewhite
onegreyonewhite / readme.md
Last active April 6, 2024 17:52
Example of script inventory

Example of script inventory

This is an example script for implementing dynamic inventory in Ansible. It could have been written in bash, but python is much easier to read.

How to use

  1. Copy inventory script to any path like $HOME/test_inventroy.py
  2. Make file executable: chmod +x $HOME/test_inventroy.py
  3. Change store to your needs.
@joeyv120
joeyv120 / qmk_c_json.txt
Created November 30, 2021 20:14
QMK commands for converting between json and c keymap files
qmk json2c2 C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.json
qmk c2json -km joeyv120 -kb keebio/iris/rev4 C:/Users/[USERSAME]/qmk_firmware/keyboards/keebio/iris/keymaps/joeyv120/keymap.c
qmk c2json -km JoeNAO -kb jnao C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.c --no-cpp
@joseluisq
joseluisq / resize_disk_image.md
Last active May 5, 2025 18:46
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@mewforest
mewforest / Git help.md
Last active February 1, 2025 21:04
Шпаргалка по использованию git

Шпаргалка для работы с git

Проверка установки

git --help
git --version

Начальная настройка

@CHERTS
CHERTS / generate-ru-locale-on-debian-linux.sh
Created October 8, 2019 14:33
Add ru_RU.UTF-8 locale on Debian
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
locale-gen ru_RU.UTF-8
dpkg-reconfigure locales
@jugatsu
jugatsu / ansible-mikrotik-example.yml
Created January 10, 2018 14:13
ansible-mikrotik-example
---
# tasks file for ansible-role-mikrotik-ipsec
- name: Check RouterOS version.
raw: ":local varif [/system package update get installed-version]; :put \"$varif\""
args: { executable: False }
register: installed_version
changed_when: False
- name: Set custom fact for RouterOS version.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@yuanying
yuanying / vagrant-kvm.md
Last active January 4, 2025 20:29
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

@shamil
shamil / mount_qcow2.md
Last active May 9, 2025 18:51
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8