Skip to content

Instantly share code, notes, and snippets.

backup -> esptool --baud 115200 --port COM3 read_flash 0x0 0x400000 antrian_printer.wifi.bin
@siagung
siagung / telegram_bot.md
Created September 7, 2023 04:31 — forked from zapisnicar/telegram_bot.md
How to create Telegram bot and send messages to group

How to create Telegram Bot and send messages to your group

  1. Create Telegram bot:

    Search for user @BotFather in Telegram app. Type /help in BotFather chat and wait for the reply. Type in the chat:

    /newbot

or select /newbot command from Help text. Answer few setup questions:

@siagung
siagung / gist:46731164f8fad40e6a4ef5fac11028f2
Created May 12, 2023 03:50
Driver TP-803L Iware Thermal
http://bit.ly/driverCD
@siagung
siagung / gist:3b302dd0c92946ff7bcdf0d10851a309
Created May 2, 2023 10:30
Creating a minimalized JRE version
As GraalVM still does not support creation of executable files for Windows, it was decided to take advantage of other capabilities offered by the Java ecosystem, specifically, creation of a minimalized JRE version.
In order to create the minimized JRE version, first it is needed to know the dependencies on certain packages that will be included in the JRE.
First of all, it is necessary to create the “fat jar” file with all dependencies.
Then run the jdeps -s <path to jar file> command to get a list of all dependencies. For example:
jdeps -s application.jar
application.jar -> java.base
{
// Based on: https://gist.github.com/pakLebah/dab98067e9a388a3a8d2f5c0b44a7d3f#file-tasks-json
"version": "2.0.0",
"options": {
"cwd": "${workspaceFolder}",
"env": {
// task settings for files and folders, use full path for commands
"FPC_COMMAND": "fpc",
"PROJECTFILE": "${relativeFile}",
"PROJECTBASE": "${fileBasenameNoExtension}",
@siagung
siagung / avrdude save & restore hex arduino uno
Last active March 28, 2023 07:13
save and restore hex code from Arduino Uno
avrdude for windows -> https://github.com/mariusgreuel/avrdude
avrdude -p atmega328p -c arduino -P com4 -U flash:w:board.hex:i
Change :r: to :w: and you can write the hex file back into the flash of the Arduino. Or upload it to another board.
Uploading Arduino HEX files -> https://www.hobbytronics.co.uk/arduino-xloader
@siagung
siagung / msys2-visual-studio-code.md
Created March 24, 2023 07:23 — forked from dhkatz/msys2-visual-studio-code.md
Using MSYS2 with Visual Studio Code

Using MSYS2 with Visual Studio Code is extremely easy now thanks to the Shell Launcher extension by Tyriar.

First, install the extension and reload Visual Studio Code.

Then, open the settings.json to edit your settings.

Add the field shellLauncher.shells.windows. I recommend using autocompletion here so that all the default shells are added.

You should having something like this now:

@siagung
siagung / go-env-with-msys2.md
Created March 24, 2023 07:22 — forked from voidexp/go-env-with-msys2.md
Go development environment on Windows with MSYS2

Go development environment on Windows with MSYS2

Normally, it is sufficient to grab the Go MSI installer from the website in order to set up the toolchain. However, some packages that provide Go wrappers for C libraries rely on cgo tool, which in turn, needs the GCC toolchain in order to build the glue code. Also, 3rd-party dependencies are usually hosted on services like GitHub, thus Git is also needed. This mini-guide illustrates how to setup a convenient development environment on Windows using MSYS2.

@siagung
siagung / go-env-with-msys2.md
Created March 24, 2023 07:22 — forked from glycerine/go-env-with-msys2.md
Go development environment on Windows with MSYS2

Go development environment on Windows with MSYS2

Normally, it is sufficient to grab the Go MSI installer from the website in order to set up the toolchain. However, some packages that provide Go wrappers for C libraries rely on cgo tool, which in turn, needs the GCC toolchain in order to build the glue code. Also, 3rd-party dependencies are usually hosted on services like GitHub, thus Git is also needed. This mini-guide illustrates how to setup a convenient development environment on Windows using MSYS2.

/**************************************/
/* https://myhomethings.eu */
/* */
/**************************************/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address: "0x3F" or "0x27"
const byte upButtonPin = 4;