Skip to content

Instantly share code, notes, and snippets.

@madagaga
madagaga / gist:cab1e6c03d0efd76a468c103ac9ddc5f
Last active April 20, 2020 07:28
hcidump packet analysis for mijia BT
$hcidump --raw
> 04 3E 25 02 01 00 00 7C C2 DB A8 65 4C 19 02 01 06 15 16 95
FE 50 20 AA 01 09 7C C2 DB A8 65 4C 0D 10 04 D5 00 28 02 AB
7C C2 DB A8 65 4C => mac address
Packet size vary from 37 to 41
when 41 temp and humidity are set on the 2 last bytes before CRC
28 02 => Humidity => big endian reverse 0228 => to int => 552 => 55.2%
// get cookie without FormsAuthentication
protected void FormsAuthentication_OnAuthenticate(Object sender, FormsAuthenticationEventArgs args)
{
}
@madagaga
madagaga / Makefile
Last active November 7, 2018 15:31
openWRT motion package with ffmpeg
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=motion
@madagaga
madagaga / StreamExtenion
Last active June 23, 2016 09:12
Workaround to get object from body with mono 4.2.x
// workaround class
public static class StreamExtension
{
private static MediaTypeFormatterCollection _defaultMediaTypeFormatterCollection = null;
// Using the JsonMediaTypeFormatter for the first time is rather expensive (due to reflection cost
// when creating the default contract resolver). Hence we new up a static collection, such
// that the second call is much faster.
private static MediaTypeFormatterCollection DefaultMediaTypeFormatterCollection
{