Skip to content

Instantly share code, notes, and snippets.

@ancientGlider
ancientGlider / keenetic_auth.py
Last active April 8, 2024 02:40
Authentication for Keenetic routers for work with CLI via REST API (Python)
# -*- coding: utf-8 -*-
"""
Данные с адресом, логином, паролем хранятся в конфигурационном файле следующего вида:
[Router]
ip_addr = 192.168.1.1:8080
login = admin
passw = anyPassword
{ "GetWantBlocking", "", 4096, "", 0, { } }
{ "GetDistance", "", 4097, "", 1, { "ObjectReferenceID", } }
{ "AddItem", "", 4098, "", 5, { "ObjectID", "Count", "Flag (Optional)", "Level (Optional)", "Equip (Optional)", } }
{ "SetEssential", "", 4099, "", 2, { "Actor Base", "Integer (Optional)", } }
{ "Rotate", "", 4100, "", 2, { "Axis", "Speed", } }
{ "GetLocked", "", 4101, "", 0, { } }
{ "GetPos", "", 4102, "", 1, { "Axis", } }
{ "SetPos", "", 4103, "", 2, { "Axis", "Float", } }
{ "GetAngle", "", 4104, "", 1, { "Axis", } }
{ "SetAngle", "", 4105, "", 2, { "Axis", "Float", } }
@amgine
amgine / WindowsMessage.cs
Created April 16, 2012 02:02
All windows messages as C# enum
namespace NAMESPACE
{
public enum WindowsMessage
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ACTIVATE = 0x0006,