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
@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

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 / 0 Raspberry Pi 4B - Proxmox-Pimox Homeassistant VM LXC-Containers Docker - INSTALL - Table of Content.md
Last active July 4, 2024 10:28
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
@luckydonald
luckydonald / tg-2021-10-12_16-57-25.md
Created October 12, 2021 14:57
tg-2021-10-12_16-57-25.md

Before:

NONE_TYPE = type(None)
union_params = type_hint.__args__   # this was __union_params__ in python3.5, but __args__ in 3.6+

assert union_params
is_optional = NONE_TYPE in union_params
if len(union_params) == (2 if is_optional else 1):
    # None is the first/second one, the actual type has to be the other.
 raise ValueError('MEhhhh')
@luckydonald
luckydonald / Fallout 4 Save File Format.md
Created April 18, 2021 11:29 — forked from SirTony/Fallout 4 Save File Format.md
The binary format for Fallout 4 PC save files.

Fallout 4 Save File Format

The binary format for Fallout 4 PC save files. This document was created by reverse-engineering files from version 1.2.37.0 of the game.

Note: This document is incomplete!

Table of Contents

extern crate hyper;
extern crate url;
static HOST: &'static str = "www.google.com";
macro_rules! ret_err(
($e:expr) => {{
match $e {
Ok(v) => v,
Err(e) => { println!("Line {}: {}", line!(), e); return; }
@luckydonald
luckydonald / python_like_exception.php
Last active March 23, 2020 21:20
python style exception trace for PHP
static function python_like_exception(
Throwable $e, bool $skip_seen = true, ?array $seen = null
): string {
if ($skip_seen && !$seen) {
$seen = array();
}
$prev = $e->getPrevious();
if ($prev) {
$result[] = self::python_like_exception($prev, $skip_seen, $seen);
$result[] = "\nDuring handling of the above exception, another exception occurred:\n";
@luckydonald
luckydonald / gist:cfde4c8107da30390b17ddc35b964f4a
Created June 11, 2019 13:54 — forked from nerones/gist:6778719
An easy way to log session data and queries with Monolog and Hooks in codeigniter. Some of the code is taken from Profiler class in the core of CI. The hook must be post_controller or post_system
class LoggerHook
{
private $CI;
function __construct()
{
$this->CI =& get_instance();
}
public function log()
{
def num(n):
string = ["", "", ""]
for d in str(int(n)):
for i, l in enumerate(digit(int(d)).split("\n")):
string[i] += l
# end for
# end for
return "\n".join(string)
# end def
@luckydonald
luckydonald / function.cast.php
Created July 23, 2018 21:14 — forked from borzilleri/function.cast.php
PHP function to cast an object from one class to another.
<?php
/**
* Cast an object into a different class.
*
* Currently this only supports casting DOWN the inheritance chain,
* that is, an object may only be cast into a class if that class
* is a descendant of the object's current class.
*
* This is mostly to avoid potentially losing data by casting across
* incompatable classes.