Skip to content

Instantly share code, notes, and snippets.

View zulonas's full-sized avatar

Kasparas Zulonas zulonas

View GitHub Profile
/**********************************************
*
* This simple library is used to redirect
* functions like printf(), scanf(), putchar()
* among other to the UART output on the STM32
* using HAL.
*
* Credits to the book Mastering STM32
* File by Benjamin Calderon 2017
*
@bradtraversy
bradtraversy / docker-help.md
Last active May 11, 2025 15:39
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@rikka0w0
rikka0w0 / licheepi_nano_squashed_rw_root.md
Last active July 20, 2023 13:47
SquashFS + JFFS2 root on LicheePi Nano

In order to save space on the SPI flash, SquashFS + JFFS2 should be used.

SPI Flash structure

Partition	Content		Offset		Size (byte)
mtd0		uboot-bin	0		0x58000 (360448)
		uboot-env	0x58000		0x8000
mtd1		dtb		0x60000		0x4000  (16kB)
mtd2		kernel		0x64000		0x400000 (4MB)
mtd3 rootfs 0x464000	0x4FC000 (4.98MB)
@zulonas
zulonas / hexdump.lua
Created October 5, 2022 14:09
hex dump for lua
local function hex_dump(buf)
for byte=1, #buf, 16 do
local chunk = buf:sub(byte, byte + 15)
io.write(string.format('%08X ', byte - 1))
chunk:gsub('.', function (c) io.write(string.format('%02X ', string.byte(c))) end)
io.write(string.rep(' ', 3 * (16 - #chunk)))
io.write(' ', chunk:gsub('%c', '.'), "\n")
end
end