Skip to content

Instantly share code, notes, and snippets.

View amrutprabhu's full-sized avatar

Amrut Prabhu amrutprabhu

View GitHub Profile
blueprint:
name: ZHA - Tuya 4-Button Scene Switch
description: Automate your Tuya 4-Button Scene Switch using ZHA events.
domain: automation
input:
tuya_4button_scene_switch:
name: Tuya 4-Button Scene Switch
description: Tuya 4-Button Scene Switch to use
selector:
device:
blueprint:
name: ZHA - Moes Smart Knob for lights
description: 'Control lights with a Moes Smart Knob.
You can set functions for a single press. This allows you to assign, e.g., a scene
or anything else.
Rotating left/right will change the brightness smoothly of the selected light.
Not all functionality of the device is available at time of writing, e.g. double
press, long press and press and rotate.
Original blueprint by seamus65 (https://gist.github.com/seamus65/939a147634942dd885c8704334627f93).
@amrutprabhu
amrutprabhu / zha_moes_smart_knob_media_player_volume.yaml
Last active September 23, 2024 21:21
ZHA - Moes Smart Knob for Media Player
blueprint:
name: ZHA - Moes Smart Knob for Media Player
description: 'Control Media Player with a Moes Smart Knob. You can set functions for a
single press. This allows you to assign, e.g., a scene or anything else. Rotating
left/right will change the volume smoothly of the selected media player. Not all
functionality of the device is available at time of writing, e.g. double press,
long press.
Original blueprint by seamus65 (https://gist.github.com/seamus65/939a147634942dd885c8704334627f93).
partition disk.
```
diskutil partitionDisk /dev/disk4 2 MBRFormat "MS-DOS FAT32" P1 10G "MS-DOS FAT32" P2 5.9G
```
clone disk
```
sudo dd if=/dev/disk4 of=usb.img bs=16M status=progres
sudo dd if=usb.img of=/dev/disk3 bs=16M status=progress
@amrutprabhu
amrutprabhu / Hibernate ubuntu 20.04
Last active May 1, 2022 19:36
Hibernate ubuntu 20.04
First of all, you should increase the size of the /swapfile at least to the size of your RAM.
link: https://linuxhint.com/change_swap_size_ubuntu/
Install dependencies:
`sudo apt install pm-utils hibernate uswsusp`
Find your UUID of swap file:
`findmnt -no UUID -T /swapfile`
get offset
mount the volume
/var/run/docker.sock
e.g
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest /bin/bash
diskutil list
diskutil eraseDisk FAT32 EMPTY MBRFormat disk2
@amrutprabhu
amrutprabhu / Access host port from docker container
Last active April 22, 2021 15:09
Docker container access host port on mac and windows
For Mac and windows that use docker for desktop,
you can use `host.docker.internal` as the hostname to access the host machine's ports
@amrutprabhu
amrutprabhu / Trigger kubernetes cron job manually
Created December 2, 2020 10:00
Command to trigger the kubernetes cron job manually
kubectl create job --from=cronjob/<cronjob-name> <job-name>
@amrutprabhu
amrutprabhu / Kubernetes cheat sheet - Very Helpful
Created December 2, 2020 09:39
Kubernetes cheat sheet - Very Helpful
https://kubernetes.io/docs/reference/kubectl/cheatsheet/