Skip to content

Instantly share code, notes, and snippets.

View luckydonald's full-sized avatar
👀
294 people are currently looking at this profile

Luckydonald luckydonald

👀
294 people are currently looking at this profile
  • Some basement in Equestria.
View GitHub Profile
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;

I can confirm that the ETRX357USB-LRS+8M can be flashed with an appropriate EZSP firmware without the use of any programming hardware. So, without any guarantees (you might -but probably won’t- brick your device), here’s how:

  1. Download the firmware. I used some random blob someone put on github that at least seemed to have the right name. What could possibly go wrong, right? https://github.com/yqyunjie/Zigbee-Project/blob/master/firmware/EmberZNet/EM35x-EZSP/build/em35x-ezsp-images/EM357/em357-ncp-uart-xon-xoff-use-with-serial-uart-bl-500.ebl?raw=true
  2. (Install USB-to-serial drivers for the device. Linux will load the driver automatically when you plug in; not sure about other OSes.)
  3. Install a serial port communication app that supports X-MODEM. (debian/ubuntu: sudo apt-get install minicom, installs lrzsz, too) Run it and configure it (sudo minicom -s) to use the fake serial port (/dev/ttyUSB0) at 19200 baud 8N1. Disable both hardware (RTS/CTS) and software (XON/XOFF) flow control.
@luckydonald
luckydonald / answer.md
Last active January 9, 2023 19:14
How to get the hostnames and informations of other hosts in the same docker scale grouping. http://stackoverflow.com/a/39895650/3423324

The way I could do it was by using the docker api. I used the docker-py package to access it.

The api exposes a labels dictionary for each container, and the keys com.docker.compose.container-number, com.docker.compose.project and com.docker.compose.service did what was needed to build the hostname.

The code below is a simplified for code I am now using. You can find my advanced code with caching and fancy stuff that at Github at luckydonald/pbft/dockerus.ServiceInfos (backup at gist.github.com).

@luckydonald
luckydonald / cubietruck_gpio.md
Last active April 12, 2023 03:24
How to setup and use GPIO ports/pins on a Cubietruck

Setup and use GPIOs on a Cubietruck

Cubietruck is also known as Cubieboard 3

Note: This file documents just what I did, first of all as a note for myself. So this is not primarily intended as a tutorial. Because it still might be helpfull, I uploaded it. The GPIO function is now confirmed to work, tested with my multimeter, but I am still waiting for my jumper cables to arrive, so I can use them securely.

Licensed under a Luna-Will-Cry-If-You-Modify-Or-Redistribute-This 1.0 licence.

@luckydonald
luckydonald / installExtensions.bash
Created April 11, 2024 09:12 — forked from BoQsc/installExtensions.bash
Download and Install multiple latest Gnome extensions via Bash
#!/bin/bash
declare gnomeExtensionsList=(
#"dash-to-dock@micxgx.gmail.com" # Dash to Dock
"dash-to-panel@jderose9.github.com" # Dash to Panel
"ding@rastersoft.com" # Desktop Icons NG - introduces a working Drag N Drop for Desktop Icons
)
function installExtensions(){
declare host="https://extensions.gnome.org/download-extension"
for extensionUUID in "${gnomeExtensionsList[@]}"; do
@luckydonald
luckydonald / 0 Raspberry Pi 4B - Proxmox-Pimox Homeassistant VM LXC-Containers Docker - INSTALL - Table of Content.md
Last active April 21, 2024 04:51
Raspberry Pi 4B: Install Proxmox/Pimox, Homeassistent, VM, LXC Containers, Docker

Hello Pi

This is a writedown of how I installed my raspberry pi(s).

The base is a Proxmox, so I don't have to worry about reformat the SD card every time I wanna try out something new, as I can start VMs and LXC containers, as well as Docker containers once it's configured properly.

Note: Those files are versioned, so you can always look what changed from time to time.

Topics

  • Pimox