Skip to content

Instantly share code, notes, and snippets.

View amrutprabhu's full-sized avatar

Amrut Prabhu amrutprabhu

View GitHub Profile
diskutil list
diskutil eraseDisk FAT32 EMPTY MBRFormat disk2
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
@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
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 / zha_moes_smart_knob_media_player_volume.yaml
Last active April 25, 2025 22:17
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).
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).
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:
@amrutprabhu
amrutprabhu / testing.txt
Created November 3, 2024 13:38
Testing commands
sysbench cpu --cpu-max-prime=20000 --threads=4 --time=0 --events=100000 run