Skip to content

Instantly share code, notes, and snippets.

@ShaneQi
ShaneQi / light_turn_on_matter_server.log
Created April 26, 2023 06:48
The matter-server log of simply turning on a light.
2023-04-26 06:07:27 NUC matter_server.server.client_handler[1] DEBUG [140070004330256] Received: {
"message_id": "759d235ee19c4fac94a820c9c2ac8fa5",
"command": "device_command",
"args": {
"node_id": 25,
"endpoint_id": 1,
"cluster_id": 6,
"command_name": "On",
"payload": {},
"response_type": null,
@ShaneQi
ShaneQi / light_turn_on_service_call_matter_server.log
Created April 26, 2023 05:49
The matter-server log when calling light.turn_on with a color from HA.
2023-04-26 05:31:21 NUC matter_server.server.client_handler[1] DEBUG [140069996848624] Received: {
"message_id": "4d34a962261e4eb7a094a62461b51980",
"command": "device_command",
"args": {
"node_id": 25,
"endpoint_id": 1,
"cluster_id": 768,
"command_name": "MoveToHueAndSaturation",
"payload": {
"hue": 6,
@ShaneQi
ShaneQi / matter-server-debug.log
Created April 25, 2023 21:46
The debug log of matter-server when trying to commission Nanoleaf bulb
2023-04-25 04:40:41 NUC matter_server.server.client_handler[1] DEBUG [140070379811792] Received: {
"message_id": "c83c16ae2086448bb73663fedbcf896f",
"command": "commission_with_code",
"args": {
"code": "15158517614"
}
}
2023-04-25 04:40:41 NUC matter_server.server.client_handler[1] DEBUG [140070379811792] Received CommandMessage(message_id='c83c16ae2086448bb73663fedbcf896f', command='commission_with_code', args={'code': '15158517614'})
2023-04-25 04:40:41 NUC matter_server.server.client_handler[1] DEBUG [140070379811792] Handling command commission_with_code
2023-04-25 04:40:41 NUC matter_server.server.helpers.paa_certificates[1] INFO Fetching the latest PAA root certificates from DCL.
@ShaneQi
ShaneQi / latest-tar-bar.bash
Created December 24, 2022 06:47
Get GitHub repo latest release tar ball
curl -s https://api.github.com/repos/shaneqi/splunk-app-cashflow/releases/latest | jq -r .tarball_url
//
// InteractiveModalCardViewController.swift
// Eastwatch
//
// Created by Shane Qi on 1/14/19.
// Copyright © 2019 Shane Qi. All rights reserved.
//
import UIKit
@ShaneQi
ShaneQi / km-action-delay.sh
Created April 20, 2021 04:39
Keyboard Maestro Inter Action Delay Setting
defaults write com.stairways.keyboardmaestro.engine InterActionDelay -float 0.5
@ShaneQi
ShaneQi / sort-all-files-by-size-desc.sh
Created August 20, 2020 03:14
Sort all files by size (desc).
$ find . -type f -exec du -h {} + | sort -r -h
@ShaneQi
ShaneQi / route-vpn.sh
Last active January 3, 2020 20:31
route vpn
$ sudo route -v add -net 192.168.1.1 -netmask 255.255.255.0 -interface ppp0
@ShaneQi
ShaneQi / unifi-controller-nginx.md
Last active November 29, 2019 15:46
Nginx config for reserve proxy unifi controller

This section needs to be in inside your HTTP context ie - HTTP { }

server {
    listen xxx.xxx.xxx.xxx:443 ssl http2;
    server_name unifi.yourdomain.com;
    ssl_certificate /etc/nginx/acme.sh/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/nginx/acme.sh/yourdomain.com/key.pem;
@ShaneQi
ShaneQi / pre-commit
Last active February 5, 2020 23:35
git pre-commit hook for checking author name & email
// The tutorial of setting this up:
// https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
if [[ $(git remote) =~ "origin" ]]
then
if [[ $(git config user.name) != "Shane Qi" ]]
then
echo "Incorrect author name."
exit 1
fi