Skip to content

Instantly share code, notes, and snippets.

View alexrashed's full-sized avatar
🚀

Alex Rashed alexrashed

🚀
View GitHub Profile
@alexrashed
alexrashed / ikea-five-button-remote-fixed-toggle.yaml
Last active October 26, 2021 13:53
Ikea Five Button Remote Blueprint - Fixed Light Toggle
blueprint:
name: Z2M - IKEA five button remote for lights - Fixed toggle
description: |
Control lights with an IKEA five button remote (the round ones).
The middle "on" button, toggle the lights on/off to the last set brightness
(unless the force brightness is toggled on in the blueprint).
If any light in the target is turned on it will be turned off, otherwise it will be turned on.
@alexrashed
alexrashed / zfs-ext4-docker.sh
Created October 7, 2021 11:48
Creates a new ZFS volume for docker with ext4
#!/bin/bash
# This is just a writeup to build an ext4 FS on top of ZFS to overcome issues with the Docker ZFS storage driver.
# DO NOT EXECUTE THIS SCRIPT IF YOU DO NOT KNOW WHAT YOU'RE DOING!
sudo zfs create -V 100G rpool/docker-overlay
sudo mkfs.ext4 /dev/zvol/rpool/docker-overlay
sudo mount /dev/zvol/rpool/docker-overlay /var/lib/docker-overlay
docker system prune -af
sudo su
cat > /etc/docker/daemon.json << EOF
{
@alexrashed
alexrashed / libreelec-ir-remote.md
Created February 5, 2021 19:10
IR Remote on LibreElec
  • Enable gpio-ir on GPIO port 18
    mount -o remount,rw /flash
    echo "dtoverlay=gpio-ir,gpio_pin=18" >> /flash/config.txt
    
  • Get codes sent by IR remote
    ir-keytable -p all -t
    
  • Create keymap in /storage/.config/rc_keymaps/
{
"openapi" : "3.0.1",
"info" : {
"title" : "FormData Test Api Documentation",
"description" : "Minimal OpenAPI spec file to showcase duplicated params for formData.",
"version" : "0.0.1"
},
"servers" : [ {
"url" : "/backend/rest"
} ],

Keybase proof

I hereby claim:

  • I am alexrashed on github.
  • I am alexrashed (https://keybase.io/alexrashed) on keybase.
  • I have a public key ASB2MNW4Q_qKEqrtT-uZx-KIiwIN_9sS1rFh1_ALI4C_xgo

To claim this, I am signing this object:

#!/bin/bash
convert () {
drawiofile=$1
file=${drawiofile::-7}
pdffile="${file}.pdf"
echo "Updating $file"
curl --data-urlencode "format=pdf" --data-urlencode "xml@$drawiofile" --output $pdffile https:\//exp.draw.io/ImageExport4/export
pdfcrop $pdffile $pdffile
}
@alexrashed
alexrashed / hooks.py
Last active September 12, 2017 09:50
Notifications on GLS parcel status changes
from urlwatch import filters
import json
class JsonFilter(filters.FilterBase):
__kind__ = 'json'
def filter(self, data, subfilter=None):
self._no_subfilters(subfilter)
data = json.loads(data)
return json.dumps(data, sort_keys=True)